diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index 3cf0637a842b..7ad03af7d074 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -49,6 +49,13 @@ pom import + + com.google.cloud + google-cloud-alloydb-bom + 0.0.1-SNAPSHOT + pom + import + com.google.analytics google-analytics-admin-bom diff --git a/java-advisorynotifications/README.md b/java-advisorynotifications/README.md index 928a6698ebf5..a2b693690105 100644 --- a/java-advisorynotifications/README.md +++ b/java-advisorynotifications/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Advisory Notifications API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-advisorynotifications" % "0.0.0" ``` + ## Authentication diff --git a/java-alloydb/.OwlBot.yaml b/java-alloydb/.OwlBot.yaml new file mode 100644 index 000000000000..0d85032ca1f3 --- /dev/null +++ b/java-alloydb/.OwlBot.yaml @@ -0,0 +1,36 @@ +# 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-alloydb/grpc-google-.*/src" +- "/java-alloydb/proto-google-.*/src" +- "/java-alloydb/google-.*/src" +- "/java-alloydb/samples/snippets/generated" + +deep-preserve-regex: +- "/java-alloydb/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/alloydb/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-alloydb/$1/proto-google-cloud-alloydb-$1/src" +- source: "/google/cloud/alloydb/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-alloydb/$1/grpc-google-cloud-alloydb-$1/src" +- source: "/google/cloud/alloydb/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-alloydb/$1/google-cloud-alloydb/src" +- source: "/google/cloud/alloydb/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-alloydb/$1/samples/snippets/generated" + + +api-name: alloydb \ No newline at end of file diff --git a/java-alloydb/.repo-metadata.json b/java-alloydb/.repo-metadata.json new file mode 100644 index 000000000000..81a356dc9bbf --- /dev/null +++ b/java-alloydb/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "alloydb", + "name_pretty": "AlloyDB", + "product_documentation": "https://cloud.google.com/alloydb/", + "api_description": "AlloyDB is a fully managed, PostgreSQL-compatible database service with industry-leading performance, availability, and scale.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-alloydb/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-alloydb", + "repo_short": "java-alloydb", + "distribution_name": "com.google.cloud:google-cloud-alloydb", + "api_id": "alloydb.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-alloydb/README.md b/java-alloydb/README.md new file mode 100644 index 000000000000..ed5d48f0d3e9 --- /dev/null +++ b/java-alloydb/README.md @@ -0,0 +1,201 @@ +# Google AlloyDB Client for Java + +Java idiomatic client for [AlloyDB][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-alloydb + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-alloydb:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-alloydb" % "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 AlloyDB APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the AlloyDB API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the AlloyDB [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google AlloyDB. +[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-alloydb` library. See the [Quickstart](#quickstart) section +to add `google-cloud-alloydb` as a dependency in your code. + +## About AlloyDB + + +[AlloyDB][product-docs] AlloyDB is a fully managed, PostgreSQL-compatible database service with industry-leading performance, availability, and scale. + +See the [AlloyDB client library docs][javadocs] to learn how to +use this AlloyDB Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +AlloyDB 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/alloydb/ +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-alloydb/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-alloydb/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-alloydb/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-alloydb/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-alloydb/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-alloydb/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-alloydb/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-alloydb/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-alloydb/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-alloydb/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-alloydb/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-alloydb.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-alloydb&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-alloydb/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-alloydb/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-alloydb/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=alloydb.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-alloydb/google-cloud-alloydb-bom/pom.xml b/java-alloydb/google-cloud-alloydb-bom/pom.xml new file mode 100644 index 000000000000..4f1f5b97dd13 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb-bom/pom.xml @@ -0,0 +1,64 @@ + + + 4.0.0 + com.google.cloud + google-cloud-alloydb-bom + 0.0.1-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 1.6.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google AlloyDB BOM + + BOM for AlloyDB + + + + true + + + + + + com.google.cloud + google-cloud-alloydb + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-alloydb-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-alloydb-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-alloydb-v1alpha + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-alloydb-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-alloydb-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-alloydb-v1alpha + 0.0.1-SNAPSHOT + + + + diff --git a/java-alloydb/google-cloud-alloydb/pom.xml b/java-alloydb/google-cloud-alloydb/pom.xml new file mode 100644 index 000000000000..372f168271a9 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/pom.xml @@ -0,0 +1,131 @@ + + + 4.0.0 + com.google.cloud + google-cloud-alloydb + 0.0.1-SNAPSHOT + jar + Google AlloyDB + AlloyDB AlloyDB is a fully managed, PostgreSQL-compatible database service with industry-leading performance, availability, and scale. + + com.google.cloud + google-cloud-alloydb-parent + 0.0.1-SNAPSHOT + + + google-cloud-alloydb + + + + 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-alloydb-v1 + + + com.google.api.grpc + proto-google-cloud-alloydb-v1beta + + + com.google.api.grpc + proto-google-cloud-alloydb-v1alpha + + + 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-alloydb-v1beta + test + + + com.google.api.grpc + grpc-google-cloud-alloydb-v1 + test + + + com.google.api.grpc + grpc-google-cloud-alloydb-v1alpha + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminClient.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminClient.java new file mode 100644 index 000000000000..86ed211e2148 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminClient.java @@ -0,0 +1,3696 @@ +/* + * 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.alloydb.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.alloydb.v1.stub.AlloyDBAdminStub; +import com.google.cloud.alloydb.v1.stub.AlloyDBAdminStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service describing handlers for resources + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+ *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+ *   Cluster response = alloyDBAdminClient.getCluster(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the AlloyDBAdminClient 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 AlloyDBAdminSettings 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
+ * AlloyDBAdminSettings alloyDBAdminSettings =
+ *     AlloyDBAdminSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings);
+ * }
+ * + *

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
+ * AlloyDBAdminSettings alloyDBAdminSettings =
+ *     AlloyDBAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings);
+ * }
+ * + *

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
+ * AlloyDBAdminSettings alloyDBAdminSettings = AlloyDBAdminSettings.newHttpJsonBuilder().build();
+ * AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class AlloyDBAdminClient implements BackgroundResource { + private final AlloyDBAdminSettings settings; + private final AlloyDBAdminStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of AlloyDBAdminClient with default settings. */ + public static final AlloyDBAdminClient create() throws IOException { + return create(AlloyDBAdminSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AlloyDBAdminClient, 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 AlloyDBAdminClient create(AlloyDBAdminSettings settings) throws IOException { + return new AlloyDBAdminClient(settings); + } + + /** + * Constructs an instance of AlloyDBAdminClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(AlloyDBAdminSettings). + */ + public static final AlloyDBAdminClient create(AlloyDBAdminStub stub) { + return new AlloyDBAdminClient(stub); + } + + /** + * Constructs an instance of AlloyDBAdminClient, 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 AlloyDBAdminClient(AlloyDBAdminSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AlloyDBAdminStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected AlloyDBAdminClient(AlloyDBAdminStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final AlloyDBAdminSettings getSettings() { + return settings; + } + + public AlloyDBAdminStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Clusters in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Cluster element : alloyDBAdminClient.listClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an aggregated list + * operation by specifying a value with the following format: * + * projects/{project}/locations/- + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListClustersPagedResponse listClusters(LocationName parent) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listClusters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Clusters in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Cluster element : alloyDBAdminClient.listClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an aggregated list + * operation by specifying a value with the following format: * + * projects/{project}/locations/- + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListClustersPagedResponse listClusters(String parent) { + ListClustersRequest request = ListClustersRequest.newBuilder().setParent(parent).build(); + return listClusters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Clusters in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Cluster element : alloyDBAdminClient.listClusters(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 ListClustersPagedResponse listClusters(ListClustersRequest request) { + return listClustersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Clusters in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.listClustersPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Cluster element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listClustersPagedCallable() { + return stub.listClustersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Clusters in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListClustersResponse response = alloyDBAdminClient.listClustersCallable().call(request);
+   *     for (Cluster element : response.getClustersList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listClustersCallable() { + return stub.listClustersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   Cluster response = alloyDBAdminClient.getCluster(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Cluster getCluster(ClusterName name) { + GetClusterRequest request = + GetClusterRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getCluster(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   Cluster response = alloyDBAdminClient.getCluster(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Cluster getCluster(String name) { + GetClusterRequest request = GetClusterRequest.newBuilder().setName(name).build(); + return getCluster(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetClusterRequest request =
+   *       GetClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.getCluster(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 Cluster getCluster(GetClusterRequest request) { + return getClusterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetClusterRequest request =
+   *       GetClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.getClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getClusterCallable() { + return stub.getClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response = alloyDBAdminClient.createClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * @param cluster Required. The resource being created + * @param clusterId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createClusterAsync( + LocationName parent, Cluster cluster, String clusterId) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setCluster(cluster) + .setClusterId(clusterId) + .build(); + return createClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response = alloyDBAdminClient.createClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * @param cluster Required. The resource being created + * @param clusterId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createClusterAsync( + String parent, Cluster cluster, String clusterId) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(parent) + .setCluster(cluster) + .setClusterId(clusterId) + .build(); + return createClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.createClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createClusterAsync( + CreateClusterRequest request) { + return createClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.createClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createClusterOperationCallable() { + return stub.createClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.createClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createClusterCallable() { + return stub.createClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Cluster response = alloyDBAdminClient.updateClusterAsync(cluster, updateMask).get();
+   * }
+   * }
+ * + * @param cluster Required. The resource being updated + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. The fields specified in the update_mask are relative to the + * resource, not the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateClusterAsync( + Cluster cluster, FieldMask updateMask) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder().setCluster(cluster).setUpdateMask(updateMask).build(); + return updateClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateClusterRequest request =
+   *       UpdateClusterRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.updateClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateClusterAsync( + UpdateClusterRequest request) { + return updateClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateClusterRequest request =
+   *       UpdateClusterRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.updateClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateClusterOperationCallable() { + return stub.updateClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateClusterRequest request =
+   *       UpdateClusterRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.updateClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateClusterCallable() { + return stub.updateClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   alloyDBAdminClient.deleteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteClusterAsync(ClusterName name) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   alloyDBAdminClient.deleteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteClusterAsync(String name) { + DeleteClusterRequest request = DeleteClusterRequest.newBuilder().setName(name).build(); + return deleteClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .setForce(true)
+   *           .build();
+   *   alloyDBAdminClient.deleteClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteClusterAsync( + DeleteClusterRequest request) { + return deleteClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .setForce(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.deleteClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteClusterOperationCallable() { + return stub.deleteClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.deleteClusterCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteClusterCallable() { + return stub.deleteClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and location, with a volume restored from the provided + * source, either a backup ID or a point-in-time and a source cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestoreClusterRequest request =
+   *       RestoreClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.restoreClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture restoreClusterAsync( + RestoreClusterRequest request) { + return restoreClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and location, with a volume restored from the provided + * source, either a backup ID or a point-in-time and a source cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestoreClusterRequest request =
+   *       RestoreClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.restoreClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + restoreClusterOperationCallable() { + return stub.restoreClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and location, with a volume restored from the provided + * source, either a backup ID or a point-in-time and a source cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestoreClusterRequest request =
+   *       RestoreClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.restoreClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable restoreClusterCallable() { + return stub.restoreClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   for (Instance element : alloyDBAdminClient.listInstances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an aggregated list + * operation by specifying a value with one of the following formats: * + * projects/{project}/locations/-/clusters/- * + * projects/{project}/locations/{region}/clusters/- + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(ClusterName parent) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   for (Instance element : alloyDBAdminClient.listInstances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an aggregated list + * operation by specifying a value with one of the following formats: * + * projects/{project}/locations/-/clusters/- * + * projects/{project}/locations/{region}/clusters/- + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(String parent) { + ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Instance element : alloyDBAdminClient.listInstances(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 ListInstancesPagedResponse listInstances(ListInstancesRequest request) { + return listInstancesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.listInstancesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Instance element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listInstancesPagedCallable() { + return stub.listInstancesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListInstancesResponse response = alloyDBAdminClient.listInstancesCallable().call(request);
+   *     for (Instance element : response.getInstancesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listInstancesCallable() { + return stub.listInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   Instance response = alloyDBAdminClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(InstanceName name) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   Instance response = alloyDBAdminClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(String name) { + GetInstanceRequest request = GetInstanceRequest.newBuilder().setName(name).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setView(InstanceView.forNumber(0))
+   *           .build();
+   *   Instance response = alloyDBAdminClient.getInstance(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 Instance getInstance(GetInstanceRequest request) { + return getInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setView(InstanceView.forNumber(0))
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.getInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getInstanceCallable() { + return stub.getInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       alloyDBAdminClient.createInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param instance Required. The resource being created + * @param instanceId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + ClusterName parent, Instance instance, String instanceId) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       alloyDBAdminClient.createInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param instance Required. The resource being created + * @param instanceId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + String parent, Instance instance, String instanceId) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.createInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + CreateInstanceRequest request) { + return createInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.createInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createInstanceOperationCallable() { + return stub.createInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.createInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createInstanceCallable() { + return stub.createInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates new instances under the given project, location and cluster. There can be only one + * primary instance in a cluster. If the primary instance exists in the cluster as well as this + * request, then API will throw an error. The primary instance should exist before any read pool + * instance is created. If the primary instance is a part of the request payload, then the API + * will take care of creating instances in the correct order. This method is here to support + * Google-internal use cases, and is not meant for external customers to consume. Please do not + * start relying on it; its behavior is subject to change without notice. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BatchCreateInstancesRequest request =
+   *       BatchCreateInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequests(CreateInstanceRequests.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   BatchCreateInstancesResponse response =
+   *       alloyDBAdminClient.batchCreateInstancesAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + batchCreateInstancesAsync(BatchCreateInstancesRequest request) { + return batchCreateInstancesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates new instances under the given project, location and cluster. There can be only one + * primary instance in a cluster. If the primary instance exists in the cluster as well as this + * request, then API will throw an error. The primary instance should exist before any read pool + * instance is created. If the primary instance is a part of the request payload, then the API + * will take care of creating instances in the correct order. This method is here to support + * Google-internal use cases, and is not meant for external customers to consume. Please do not + * start relying on it; its behavior is subject to change without notice. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BatchCreateInstancesRequest request =
+   *       BatchCreateInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequests(CreateInstanceRequests.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.batchCreateInstancesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   BatchCreateInstancesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable() { + return stub.batchCreateInstancesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates new instances under the given project, location and cluster. There can be only one + * primary instance in a cluster. If the primary instance exists in the cluster as well as this + * request, then API will throw an error. The primary instance should exist before any read pool + * instance is created. If the primary instance is a part of the request payload, then the API + * will take care of creating instances in the correct order. This method is here to support + * Google-internal use cases, and is not meant for external customers to consume. Please do not + * start relying on it; its behavior is subject to change without notice. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BatchCreateInstancesRequest request =
+   *       BatchCreateInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequests(CreateInstanceRequests.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.batchCreateInstancesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + batchCreateInstancesCallable() { + return stub.batchCreateInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   Instance instance = Instance.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Instance response = alloyDBAdminClient.updateInstanceAsync(instance, updateMask).get();
+   * }
+   * }
+ * + * @param instance Required. The resource being updated + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. The fields specified in the update_mask are relative to + * the resource, not the full request. A field will be overwritten if it is in the mask. If + * the user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateInstanceAsync( + Instance instance, FieldMask updateMask) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder().setInstance(instance).setUpdateMask(updateMask).build(); + return updateInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.updateInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateInstanceAsync( + UpdateInstanceRequest request) { + return updateInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.updateInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateInstanceOperationCallable() { + return stub.updateInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.updateInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateInstanceCallable() { + return stub.updateInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   alloyDBAdminClient.deleteInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteInstanceAsync(InstanceName name) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   alloyDBAdminClient.deleteInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteInstanceAsync(String name) { + DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   alloyDBAdminClient.deleteInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteInstanceAsync( + DeleteInstanceRequest request) { + return deleteInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.deleteInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteInstanceOperationCallable() { + return stub.deleteInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.deleteInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteInstanceCallable() { + return stub.deleteInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Forces a Failover for a highly available instance. Failover promotes the HA standby instance as + * the new primary. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   Instance response = alloyDBAdminClient.failoverInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture failoverInstanceAsync( + InstanceName name) { + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return failoverInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Forces a Failover for a highly available instance. Failover promotes the HA standby instance as + * the new primary. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   Instance response = alloyDBAdminClient.failoverInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture failoverInstanceAsync(String name) { + FailoverInstanceRequest request = FailoverInstanceRequest.newBuilder().setName(name).build(); + return failoverInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Forces a Failover for a highly available instance. Failover promotes the HA standby instance as + * the new primary. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   FailoverInstanceRequest request =
+   *       FailoverInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.failoverInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture failoverInstanceAsync( + FailoverInstanceRequest request) { + return failoverInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Forces a Failover for a highly available instance. Failover promotes the HA standby instance as + * the new primary. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   FailoverInstanceRequest request =
+   *       FailoverInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.failoverInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + failoverInstanceOperationCallable() { + return stub.failoverInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Forces a Failover for a highly available instance. Failover promotes the HA standby instance as + * the new primary. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   FailoverInstanceRequest request =
+   *       FailoverInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.failoverInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable failoverInstanceCallable() { + return stub.failoverInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   Instance response = alloyDBAdminClient.restartInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture restartInstanceAsync( + InstanceName name) { + RestartInstanceRequest request = + RestartInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return restartInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   Instance response = alloyDBAdminClient.restartInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture restartInstanceAsync(String name) { + RestartInstanceRequest request = RestartInstanceRequest.newBuilder().setName(name).build(); + return restartInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestartInstanceRequest request =
+   *       RestartInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.restartInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture restartInstanceAsync( + RestartInstanceRequest request) { + return restartInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestartInstanceRequest request =
+   *       RestartInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.restartInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + restartInstanceOperationCallable() { + return stub.restartInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestartInstanceRequest request =
+   *       RestartInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.restartInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable restartInstanceCallable() { + return stub.restartInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListBackupsRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(LocationName parent) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListBackupsRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(String parent) { + ListBackupsRequest request = ListBackupsRequest.newBuilder().setParent(parent).build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Backup element : alloyDBAdminClient.listBackups(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 ListBackupsPagedResponse listBackups(ListBackupsRequest request) { + return listBackupsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.listBackupsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Backup element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listBackupsPagedCallable() { + return stub.listBackupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListBackupsResponse response = alloyDBAdminClient.listBackupsCallable().call(request);
+   *     for (Backup element : response.getBackupsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listBackupsCallable() { + return stub.listBackupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]");
+   *   Backup response = alloyDBAdminClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(BackupName name) { + GetBackupRequest request = + GetBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString();
+   *   Backup response = alloyDBAdminClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(String name) { + GetBackupRequest request = GetBackupRequest.newBuilder().setName(name).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   Backup response = alloyDBAdminClient.getBackup(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 Backup getBackup(GetBackupRequest request) { + return getBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.getBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getBackupCallable() { + return stub.getBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Backup in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Backup backup = Backup.newBuilder().build();
+   *   String backupId = "backupId2121930365";
+   *   Backup response = alloyDBAdminClient.createBackupAsync(parent, backup, backupId).get();
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param backup Required. The resource being created + * @param backupId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createBackupAsync( + LocationName parent, Backup backup, String backupId) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBackup(backup) + .setBackupId(backupId) + .build(); + return createBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Backup in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Backup backup = Backup.newBuilder().build();
+   *   String backupId = "backupId2121930365";
+   *   Backup response = alloyDBAdminClient.createBackupAsync(parent, backup, backupId).get();
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param backup Required. The resource being created + * @param backupId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createBackupAsync( + String parent, Backup backup, String backupId) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(parent) + .setBackup(backup) + .setBackupId(backupId) + .build(); + return createBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Backup in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBackupId("backupId2121930365")
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Backup response = alloyDBAdminClient.createBackupAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createBackupAsync( + CreateBackupRequest request) { + return createBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Backup in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBackupId("backupId2121930365")
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.createBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createBackupOperationCallable() { + return stub.createBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Backup in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBackupId("backupId2121930365")
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.createBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createBackupCallable() { + return stub.createBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   Backup backup = Backup.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Backup response = alloyDBAdminClient.updateBackupAsync(backup, updateMask).get();
+   * }
+   * }
+ * + * @param backup Required. The resource being updated + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. The fields specified in the update_mask are relative to the + * resource, not the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateBackupAsync( + Backup backup, FieldMask updateMask) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder().setBackup(backup).setUpdateMask(updateMask).build(); + return updateBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   Backup response = alloyDBAdminClient.updateBackupAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateBackupAsync( + UpdateBackupRequest request) { + return updateBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.updateBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateBackupOperationCallable() { + return stub.updateBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.updateBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateBackupCallable() { + return stub.updateBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]");
+   *   alloyDBAdminClient.deleteBackupAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. For the required format, see the comment on the + * Backup.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteBackupAsync(BackupName name) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString();
+   *   alloyDBAdminClient.deleteBackupAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. For the required format, see the comment on the + * Backup.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteBackupAsync(String name) { + DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name).build(); + return deleteBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   alloyDBAdminClient.deleteBackupAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteBackupAsync( + DeleteBackupRequest request) { + return deleteBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.deleteBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteBackupOperationCallable() { + return stub.deleteBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.deleteBackupCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteBackupCallable() { + return stub.deleteBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (SupportedDatabaseFlag element :
+   *       alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. The required format is: * + * projects/{project}/locations/{location} + *

Regardless of the parent specified here, as long it is contains a valid project and + * location, the service will return a static list of supported flags resources. Note that we + * do not yet support region-specific flags. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags( + LocationName parent) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listSupportedDatabaseFlags(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (SupportedDatabaseFlag element :
+   *       alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. The required format is: * + * projects/{project}/locations/{location} + *

Regardless of the parent specified here, as long it is contains a valid project and + * location, the service will return a static list of supported flags resources. Note that we + * do not yet support region-specific flags. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags(String parent) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder().setParent(parent).build(); + return listSupportedDatabaseFlags(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListSupportedDatabaseFlagsRequest request =
+   *       ListSupportedDatabaseFlagsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (SupportedDatabaseFlag element :
+   *       alloyDBAdminClient.listSupportedDatabaseFlags(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 ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags( + ListSupportedDatabaseFlagsRequest request) { + return listSupportedDatabaseFlagsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListSupportedDatabaseFlagsRequest request =
+   *       ListSupportedDatabaseFlagsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.listSupportedDatabaseFlagsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (SupportedDatabaseFlag element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsPagedCallable() { + return stub.listSupportedDatabaseFlagsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListSupportedDatabaseFlagsRequest request =
+   *       ListSupportedDatabaseFlagsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListSupportedDatabaseFlagsResponse response =
+   *         alloyDBAdminClient.listSupportedDatabaseFlagsCallable().call(request);
+   *     for (SupportedDatabaseFlag element : response.getSupportedDatabaseFlagsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listSupportedDatabaseFlagsCallable() { + return stub.listSupportedDatabaseFlagsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : alloyDBAdminClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = alloyDBAdminClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = alloyDBAdminClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = alloyDBAdminClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @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 ListClustersPagedResponse + extends AbstractPagedListResponse< + ListClustersRequest, + ListClustersResponse, + Cluster, + ListClustersPage, + ListClustersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListClustersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListClustersPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListClustersPagedResponse(ListClustersPage page) { + super(page, ListClustersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListClustersPage + extends AbstractPage { + + private ListClustersPage( + PageContext context, + ListClustersResponse response) { + super(context, response); + } + + private static ListClustersPage createEmptyPage() { + return new ListClustersPage(null, null); + } + + @Override + protected ListClustersPage createPage( + PageContext context, + ListClustersResponse response) { + return new ListClustersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListClustersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListClustersRequest, + ListClustersResponse, + Cluster, + ListClustersPage, + ListClustersFixedSizeCollection> { + + private ListClustersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListClustersFixedSizeCollection createEmptyCollection() { + return new ListClustersFixedSizeCollection(null, 0); + } + + @Override + protected ListClustersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListClustersFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListInstancesPagedResponse + extends AbstractPagedListResponse< + ListInstancesRequest, + ListInstancesResponse, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListInstancesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListInstancesPagedResponse(ListInstancesPage page) { + super(page, ListInstancesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListInstancesPage + extends AbstractPage< + ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage> { + + private ListInstancesPage( + PageContext context, + ListInstancesResponse response) { + super(context, response); + } + + private static ListInstancesPage createEmptyPage() { + return new ListInstancesPage(null, null); + } + + @Override + protected ListInstancesPage createPage( + PageContext context, + ListInstancesResponse response) { + return new ListInstancesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListInstancesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstancesRequest, + ListInstancesResponse, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + private ListInstancesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInstancesFixedSizeCollection createEmptyCollection() { + return new ListInstancesFixedSizeCollection(null, 0); + } + + @Override + protected ListInstancesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInstancesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListBackupsPagedResponse + extends AbstractPagedListResponse< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBackupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListBackupsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListBackupsPagedResponse(ListBackupsPage page) { + super(page, ListBackupsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBackupsPage + extends AbstractPage { + + private ListBackupsPage( + PageContext context, + ListBackupsResponse response) { + super(context, response); + } + + private static ListBackupsPage createEmptyPage() { + return new ListBackupsPage(null, null); + } + + @Override + protected ListBackupsPage createPage( + PageContext context, + ListBackupsResponse response) { + return new ListBackupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBackupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + private ListBackupsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBackupsFixedSizeCollection createEmptyCollection() { + return new ListBackupsFixedSizeCollection(null, 0); + } + + @Override + protected ListBackupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBackupsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListSupportedDatabaseFlagsPagedResponse + extends AbstractPagedListResponse< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag, + ListSupportedDatabaseFlagsPage, + ListSupportedDatabaseFlagsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSupportedDatabaseFlagsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSupportedDatabaseFlagsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSupportedDatabaseFlagsPagedResponse(ListSupportedDatabaseFlagsPage page) { + super(page, ListSupportedDatabaseFlagsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSupportedDatabaseFlagsPage + extends AbstractPage< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag, + ListSupportedDatabaseFlagsPage> { + + private ListSupportedDatabaseFlagsPage( + PageContext< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + context, + ListSupportedDatabaseFlagsResponse response) { + super(context, response); + } + + private static ListSupportedDatabaseFlagsPage createEmptyPage() { + return new ListSupportedDatabaseFlagsPage(null, null); + } + + @Override + protected ListSupportedDatabaseFlagsPage createPage( + PageContext< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + context, + ListSupportedDatabaseFlagsResponse response) { + return new ListSupportedDatabaseFlagsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSupportedDatabaseFlagsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag, + ListSupportedDatabaseFlagsPage, + ListSupportedDatabaseFlagsFixedSizeCollection> { + + private ListSupportedDatabaseFlagsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSupportedDatabaseFlagsFixedSizeCollection createEmptyCollection() { + return new ListSupportedDatabaseFlagsFixedSizeCollection(null, 0); + } + + @Override + protected ListSupportedDatabaseFlagsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSupportedDatabaseFlagsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminSettings.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminSettings.java new file mode 100644 index 000000000000..daf03f64dbb8 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminSettings.java @@ -0,0 +1,608 @@ +/* + * 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.alloydb.v1; + +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +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.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.alloydb.v1.stub.AlloyDBAdminStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.Operation; +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 AlloyDBAdminClient}. + * + *

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

    + *
  • The default service address (alloydb.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 getCluster 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
+ * AlloyDBAdminSettings.Builder alloyDBAdminSettingsBuilder = AlloyDBAdminSettings.newBuilder();
+ * alloyDBAdminSettingsBuilder
+ *     .getClusterSettings()
+ *     .setRetrySettings(
+ *         alloyDBAdminSettingsBuilder
+ *             .getClusterSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AlloyDBAdminSettings alloyDBAdminSettings = alloyDBAdminSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class AlloyDBAdminSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listClusters. */ + public PagedCallSettings + listClustersSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listClustersSettings(); + } + + /** Returns the object with the settings used for calls to getCluster. */ + public UnaryCallSettings getClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getClusterSettings(); + } + + /** Returns the object with the settings used for calls to createCluster. */ + public UnaryCallSettings createClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createClusterSettings(); + } + + /** Returns the object with the settings used for calls to createCluster. */ + public OperationCallSettings + createClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public UnaryCallSettings updateClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateClusterSettings(); + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public OperationCallSettings + updateClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public UnaryCallSettings deleteClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteClusterSettings(); + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public OperationCallSettings + deleteClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to restoreCluster. */ + public UnaryCallSettings restoreClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).restoreClusterSettings(); + } + + /** Returns the object with the settings used for calls to restoreCluster. */ + public OperationCallSettings + restoreClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).restoreClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listInstancesSettings(); + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to batchCreateInstances. */ + public UnaryCallSettings batchCreateInstancesSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).batchCreateInstancesSettings(); + } + + /** Returns the object with the settings used for calls to batchCreateInstances. */ + public OperationCallSettings< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).batchCreateInstancesOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateInstanceSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public OperationCallSettings + updateInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteInstanceSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public OperationCallSettings + deleteInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to failoverInstance. */ + public UnaryCallSettings failoverInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).failoverInstanceSettings(); + } + + /** Returns the object with the settings used for calls to failoverInstance. */ + public OperationCallSettings + failoverInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).failoverInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to restartInstance. */ + public UnaryCallSettings restartInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).restartInstanceSettings(); + } + + /** Returns the object with the settings used for calls to restartInstance. */ + public OperationCallSettings + restartInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).restartInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listBackupsSettings(); + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getBackupSettings(); + } + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createBackupSettings(); + } + + /** Returns the object with the settings used for calls to createBackup. */ + public OperationCallSettings + createBackupOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateBackupSettings(); + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public OperationCallSettings + updateBackupOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteBackupSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public OperationCallSettings + deleteBackupOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to listSupportedDatabaseFlags. */ + public PagedCallSettings< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listSupportedDatabaseFlagsSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final AlloyDBAdminSettings create(AlloyDBAdminStubSettings stub) + throws IOException { + return new AlloyDBAdminSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AlloyDBAdminStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AlloyDBAdminStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AlloyDBAdminStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AlloyDBAdminStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AlloyDBAdminStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return AlloyDBAdminStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AlloyDBAdminStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AlloyDBAdminStubSettings.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 AlloyDBAdminSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AlloyDBAdminSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(AlloyDBAdminStubSettings.newBuilder(clientContext)); + } + + protected Builder(AlloyDBAdminSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AlloyDBAdminStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(AlloyDBAdminStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(AlloyDBAdminStubSettings.newHttpJsonBuilder()); + } + + public AlloyDBAdminStubSettings.Builder getStubSettingsBuilder() { + return ((AlloyDBAdminStubSettings.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 listClusters. */ + public PagedCallSettings.Builder< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings() { + return getStubSettingsBuilder().listClustersSettings(); + } + + /** Returns the builder for the settings used for calls to getCluster. */ + public UnaryCallSettings.Builder getClusterSettings() { + return getStubSettingsBuilder().getClusterSettings(); + } + + /** Returns the builder for the settings used for calls to createCluster. */ + public UnaryCallSettings.Builder createClusterSettings() { + return getStubSettingsBuilder().createClusterSettings(); + } + + /** Returns the builder for the settings used for calls to createCluster. */ + public OperationCallSettings.Builder + createClusterOperationSettings() { + return getStubSettingsBuilder().createClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + public UnaryCallSettings.Builder updateClusterSettings() { + return getStubSettingsBuilder().updateClusterSettings(); + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + public OperationCallSettings.Builder + updateClusterOperationSettings() { + return getStubSettingsBuilder().updateClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteCluster. */ + public UnaryCallSettings.Builder deleteClusterSettings() { + return getStubSettingsBuilder().deleteClusterSettings(); + } + + /** Returns the builder for the settings used for calls to deleteCluster. */ + public OperationCallSettings.Builder + deleteClusterOperationSettings() { + return getStubSettingsBuilder().deleteClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to restoreCluster. */ + public UnaryCallSettings.Builder restoreClusterSettings() { + return getStubSettingsBuilder().restoreClusterSettings(); + } + + /** Returns the builder for the settings used for calls to restoreCluster. */ + public OperationCallSettings.Builder + restoreClusterOperationSettings() { + return getStubSettingsBuilder().restoreClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return getStubSettingsBuilder().listInstancesSettings(); + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getStubSettingsBuilder().getInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return getStubSettingsBuilder().createInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return getStubSettingsBuilder().createInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to batchCreateInstances. */ + public UnaryCallSettings.Builder + batchCreateInstancesSettings() { + return getStubSettingsBuilder().batchCreateInstancesSettings(); + } + + /** Returns the builder for the settings used for calls to batchCreateInstances. */ + public OperationCallSettings.Builder< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings() { + return getStubSettingsBuilder().batchCreateInstancesOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return getStubSettingsBuilder().updateInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return getStubSettingsBuilder().updateInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return getStubSettingsBuilder().deleteInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return getStubSettingsBuilder().deleteInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to failoverInstance. */ + public UnaryCallSettings.Builder + failoverInstanceSettings() { + return getStubSettingsBuilder().failoverInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to failoverInstance. */ + public OperationCallSettings.Builder + failoverInstanceOperationSettings() { + return getStubSettingsBuilder().failoverInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to restartInstance. */ + public UnaryCallSettings.Builder restartInstanceSettings() { + return getStubSettingsBuilder().restartInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to restartInstance. */ + public OperationCallSettings.Builder + restartInstanceOperationSettings() { + return getStubSettingsBuilder().restartInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return getStubSettingsBuilder().listBackupsSettings(); + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getStubSettingsBuilder().getBackupSettings(); + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return getStubSettingsBuilder().createBackupSettings(); + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public OperationCallSettings.Builder + createBackupOperationSettings() { + return getStubSettingsBuilder().createBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return getStubSettingsBuilder().updateBackupSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public OperationCallSettings.Builder + updateBackupOperationSettings() { + return getStubSettingsBuilder().updateBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return getStubSettingsBuilder().deleteBackupSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public OperationCallSettings.Builder + deleteBackupOperationSettings() { + return getStubSettingsBuilder().deleteBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listSupportedDatabaseFlags. */ + public PagedCallSettings.Builder< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings() { + return getStubSettingsBuilder().listSupportedDatabaseFlagsSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public AlloyDBAdminSettings build() throws IOException { + return new AlloyDBAdminSettings(this); + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/gapic_metadata.json b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/gapic_metadata.json new file mode 100644 index 000000000000..6c3643d85cf2 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/gapic_metadata.json @@ -0,0 +1,84 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.alloydb.v1", + "libraryPackage": "com.google.cloud.alloydb.v1", + "services": { + "AlloyDBAdmin": { + "clients": { + "grpc": { + "libraryClient": "AlloyDBAdminClient", + "rpcs": { + "BatchCreateInstances": { + "methods": ["batchCreateInstancesAsync", "batchCreateInstancesOperationCallable", "batchCreateInstancesCallable"] + }, + "CreateBackup": { + "methods": ["createBackupAsync", "createBackupAsync", "createBackupAsync", "createBackupOperationCallable", "createBackupCallable"] + }, + "CreateCluster": { + "methods": ["createClusterAsync", "createClusterAsync", "createClusterAsync", "createClusterOperationCallable", "createClusterCallable"] + }, + "CreateInstance": { + "methods": ["createInstanceAsync", "createInstanceAsync", "createInstanceAsync", "createInstanceOperationCallable", "createInstanceCallable"] + }, + "DeleteBackup": { + "methods": ["deleteBackupAsync", "deleteBackupAsync", "deleteBackupAsync", "deleteBackupOperationCallable", "deleteBackupCallable"] + }, + "DeleteCluster": { + "methods": ["deleteClusterAsync", "deleteClusterAsync", "deleteClusterAsync", "deleteClusterOperationCallable", "deleteClusterCallable"] + }, + "DeleteInstance": { + "methods": ["deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceOperationCallable", "deleteInstanceCallable"] + }, + "FailoverInstance": { + "methods": ["failoverInstanceAsync", "failoverInstanceAsync", "failoverInstanceAsync", "failoverInstanceOperationCallable", "failoverInstanceCallable"] + }, + "GetBackup": { + "methods": ["getBackup", "getBackup", "getBackup", "getBackupCallable"] + }, + "GetCluster": { + "methods": ["getCluster", "getCluster", "getCluster", "getClusterCallable"] + }, + "GetInstance": { + "methods": ["getInstance", "getInstance", "getInstance", "getInstanceCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListBackups": { + "methods": ["listBackups", "listBackups", "listBackups", "listBackupsPagedCallable", "listBackupsCallable"] + }, + "ListClusters": { + "methods": ["listClusters", "listClusters", "listClusters", "listClustersPagedCallable", "listClustersCallable"] + }, + "ListInstances": { + "methods": ["listInstances", "listInstances", "listInstances", "listInstancesPagedCallable", "listInstancesCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListSupportedDatabaseFlags": { + "methods": ["listSupportedDatabaseFlags", "listSupportedDatabaseFlags", "listSupportedDatabaseFlags", "listSupportedDatabaseFlagsPagedCallable", "listSupportedDatabaseFlagsCallable"] + }, + "RestartInstance": { + "methods": ["restartInstanceAsync", "restartInstanceAsync", "restartInstanceAsync", "restartInstanceOperationCallable", "restartInstanceCallable"] + }, + "RestoreCluster": { + "methods": ["restoreClusterAsync", "restoreClusterOperationCallable", "restoreClusterCallable"] + }, + "UpdateBackup": { + "methods": ["updateBackupAsync", "updateBackupAsync", "updateBackupOperationCallable", "updateBackupCallable"] + }, + "UpdateCluster": { + "methods": ["updateClusterAsync", "updateClusterAsync", "updateClusterOperationCallable", "updateClusterCallable"] + }, + "UpdateInstance": { + "methods": ["updateInstanceAsync", "updateInstanceAsync", "updateInstanceOperationCallable", "updateInstanceCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/package-info.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/package-info.java new file mode 100644 index 000000000000..fd7047d02df9 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/package-info.java @@ -0,0 +1,43 @@ +/* + * 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 AlloyDB API + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================= AlloyDBAdminClient ======================= + * + *

Service Description: Service describing handlers for resources + * + *

Sample for AlloyDBAdminClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+ *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+ *   Cluster response = alloyDBAdminClient.getCluster(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.alloydb.v1; + +import javax.annotation.Generated; diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/AlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/AlloyDBAdminStub.java new file mode 100644 index 000000000000..55ea0c8d4f52 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/AlloyDBAdminStub.java @@ -0,0 +1,266 @@ +/* + * 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.alloydb.v1.stub; + +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.CreateBackupRequest; +import com.google.cloud.alloydb.v1.CreateClusterRequest; +import com.google.cloud.alloydb.v1.CreateInstanceRequest; +import com.google.cloud.alloydb.v1.DeleteBackupRequest; +import com.google.cloud.alloydb.v1.DeleteClusterRequest; +import com.google.cloud.alloydb.v1.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1.GetBackupRequest; +import com.google.cloud.alloydb.v1.GetClusterRequest; +import com.google.cloud.alloydb.v1.GetInstanceRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.ListBackupsRequest; +import com.google.cloud.alloydb.v1.ListBackupsResponse; +import com.google.cloud.alloydb.v1.ListClustersRequest; +import com.google.cloud.alloydb.v1.ListClustersResponse; +import com.google.cloud.alloydb.v1.ListInstancesRequest; +import com.google.cloud.alloydb.v1.ListInstancesResponse; +import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.cloud.alloydb.v1.RestartInstanceRequest; +import com.google.cloud.alloydb.v1.RestoreClusterRequest; +import com.google.cloud.alloydb.v1.UpdateBackupRequest; +import com.google.cloud.alloydb.v1.UpdateClusterRequest; +import com.google.cloud.alloydb.v1.UpdateInstanceRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the AlloyDBAdmin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class AlloyDBAdminStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable listClustersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listClustersPagedCallable()"); + } + + public UnaryCallable listClustersCallable() { + throw new UnsupportedOperationException("Not implemented: listClustersCallable()"); + } + + public UnaryCallable getClusterCallable() { + throw new UnsupportedOperationException("Not implemented: getClusterCallable()"); + } + + public OperationCallable + createClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createClusterOperationCallable()"); + } + + public UnaryCallable createClusterCallable() { + throw new UnsupportedOperationException("Not implemented: createClusterCallable()"); + } + + public OperationCallable + updateClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateClusterOperationCallable()"); + } + + public UnaryCallable updateClusterCallable() { + throw new UnsupportedOperationException("Not implemented: updateClusterCallable()"); + } + + public OperationCallable + deleteClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteClusterOperationCallable()"); + } + + public UnaryCallable deleteClusterCallable() { + throw new UnsupportedOperationException("Not implemented: deleteClusterCallable()"); + } + + public OperationCallable + restoreClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: restoreClusterOperationCallable()"); + } + + public UnaryCallable restoreClusterCallable() { + throw new UnsupportedOperationException("Not implemented: restoreClusterCallable()"); + } + + public UnaryCallable + listInstancesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesPagedCallable()"); + } + + public UnaryCallable listInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesCallable()"); + } + + public UnaryCallable getInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: getInstanceCallable()"); + } + + public OperationCallable + createInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceOperationCallable()"); + } + + public UnaryCallable createInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceCallable()"); + } + + public OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: batchCreateInstancesOperationCallable()"); + } + + public UnaryCallable batchCreateInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: batchCreateInstancesCallable()"); + } + + public OperationCallable + updateInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceOperationCallable()"); + } + + public UnaryCallable updateInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceCallable()"); + } + + public OperationCallable + deleteInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceOperationCallable()"); + } + + public UnaryCallable deleteInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceCallable()"); + } + + public OperationCallable + failoverInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: failoverInstanceOperationCallable()"); + } + + public UnaryCallable failoverInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: failoverInstanceCallable()"); + } + + public OperationCallable + restartInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: restartInstanceOperationCallable()"); + } + + public UnaryCallable restartInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: restartInstanceCallable()"); + } + + public UnaryCallable listBackupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsPagedCallable()"); + } + + public UnaryCallable listBackupsCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsCallable()"); + } + + public UnaryCallable getBackupCallable() { + throw new UnsupportedOperationException("Not implemented: getBackupCallable()"); + } + + public OperationCallable + createBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupOperationCallable()"); + } + + public UnaryCallable createBackupCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupCallable()"); + } + + public OperationCallable + updateBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupOperationCallable()"); + } + + public UnaryCallable updateBackupCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupCallable()"); + } + + public OperationCallable + deleteBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupOperationCallable()"); + } + + public UnaryCallable deleteBackupCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupCallable()"); + } + + public UnaryCallable + listSupportedDatabaseFlagsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listSupportedDatabaseFlagsPagedCallable()"); + } + + public UnaryCallable + listSupportedDatabaseFlagsCallable() { + throw new UnsupportedOperationException( + "Not implemented: listSupportedDatabaseFlagsCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/AlloyDBAdminStubSettings.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/AlloyDBAdminStubSettings.java new file mode 100644 index 000000000000..7b337a8397f7 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/AlloyDBAdminStubSettings.java @@ -0,0 +1,1787 @@ +/* + * 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.alloydb.v1.stub; + +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +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.grpc.ProtoOperationTransformers; +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.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.CreateBackupRequest; +import com.google.cloud.alloydb.v1.CreateClusterRequest; +import com.google.cloud.alloydb.v1.CreateInstanceRequest; +import com.google.cloud.alloydb.v1.DeleteBackupRequest; +import com.google.cloud.alloydb.v1.DeleteClusterRequest; +import com.google.cloud.alloydb.v1.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1.GetBackupRequest; +import com.google.cloud.alloydb.v1.GetClusterRequest; +import com.google.cloud.alloydb.v1.GetInstanceRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.ListBackupsRequest; +import com.google.cloud.alloydb.v1.ListBackupsResponse; +import com.google.cloud.alloydb.v1.ListClustersRequest; +import com.google.cloud.alloydb.v1.ListClustersResponse; +import com.google.cloud.alloydb.v1.ListInstancesRequest; +import com.google.cloud.alloydb.v1.ListInstancesResponse; +import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.cloud.alloydb.v1.RestartInstanceRequest; +import com.google.cloud.alloydb.v1.RestoreClusterRequest; +import com.google.cloud.alloydb.v1.SupportedDatabaseFlag; +import com.google.cloud.alloydb.v1.UpdateBackupRequest; +import com.google.cloud.alloydb.v1.UpdateClusterRequest; +import com.google.cloud.alloydb.v1.UpdateInstanceRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import 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 AlloyDBAdminStub}. + * + *

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

    + *
  • The default service address (alloydb.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 getCluster 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
+ * AlloyDBAdminStubSettings.Builder alloyDBAdminSettingsBuilder =
+ *     AlloyDBAdminStubSettings.newBuilder();
+ * alloyDBAdminSettingsBuilder
+ *     .getClusterSettings()
+ *     .setRetrySettings(
+ *         alloyDBAdminSettingsBuilder
+ *             .getClusterSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AlloyDBAdminStubSettings alloyDBAdminSettings = alloyDBAdminSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class AlloyDBAdminStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings; + private final UnaryCallSettings getClusterSettings; + private final UnaryCallSettings createClusterSettings; + private final OperationCallSettings + createClusterOperationSettings; + private final UnaryCallSettings updateClusterSettings; + private final OperationCallSettings + updateClusterOperationSettings; + private final UnaryCallSettings deleteClusterSettings; + private final OperationCallSettings + deleteClusterOperationSettings; + private final UnaryCallSettings restoreClusterSettings; + private final OperationCallSettings + restoreClusterOperationSettings; + private final PagedCallSettings< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings getInstanceSettings; + private final UnaryCallSettings createInstanceSettings; + private final OperationCallSettings + createInstanceOperationSettings; + private final UnaryCallSettings + batchCreateInstancesSettings; + private final OperationCallSettings< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings; + private final UnaryCallSettings updateInstanceSettings; + private final OperationCallSettings + updateInstanceOperationSettings; + private final UnaryCallSettings deleteInstanceSettings; + private final OperationCallSettings + deleteInstanceOperationSettings; + private final UnaryCallSettings failoverInstanceSettings; + private final OperationCallSettings + failoverInstanceOperationSettings; + private final UnaryCallSettings restartInstanceSettings; + private final OperationCallSettings + restartInstanceOperationSettings; + private final PagedCallSettings + listBackupsSettings; + private final UnaryCallSettings getBackupSettings; + private final UnaryCallSettings createBackupSettings; + private final OperationCallSettings + createBackupOperationSettings; + private final UnaryCallSettings updateBackupSettings; + private final OperationCallSettings + updateBackupOperationSettings; + private final UnaryCallSettings deleteBackupSettings; + private final OperationCallSettings + deleteBackupOperationSettings; + private final PagedCallSettings< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor + LIST_CLUSTERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListClustersRequest injectToken(ListClustersRequest payload, String token) { + return ListClustersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListClustersRequest injectPageSize(ListClustersRequest payload, int pageSize) { + return ListClustersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListClustersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListClustersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListClustersResponse payload) { + return payload.getClustersList() == null + ? ImmutableList.of() + : payload.getClustersList(); + } + }; + + private static final PagedListDescriptor + LIST_INSTANCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListInstancesRequest injectToken(ListInstancesRequest payload, String token) { + return ListInstancesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListInstancesRequest injectPageSize(ListInstancesRequest payload, int pageSize) { + return ListInstancesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListInstancesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListInstancesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListInstancesResponse payload) { + return payload.getInstancesList() == null + ? ImmutableList.of() + : payload.getInstancesList(); + } + }; + + private static final PagedListDescriptor + LIST_BACKUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBackupsRequest injectToken(ListBackupsRequest payload, String token) { + return ListBackupsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBackupsRequest injectPageSize(ListBackupsRequest payload, int pageSize) { + return ListBackupsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBackupsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBackupsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBackupsResponse payload) { + return payload.getBackupsList() == null + ? ImmutableList.of() + : payload.getBackupsList(); + } + }; + + private static final PagedListDescriptor< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_DESC = + new PagedListDescriptor< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSupportedDatabaseFlagsRequest injectToken( + ListSupportedDatabaseFlagsRequest payload, String token) { + return ListSupportedDatabaseFlagsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListSupportedDatabaseFlagsRequest injectPageSize( + ListSupportedDatabaseFlagsRequest payload, int pageSize) { + return ListSupportedDatabaseFlagsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListSupportedDatabaseFlagsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSupportedDatabaseFlagsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListSupportedDatabaseFlagsResponse payload) { + return payload.getSupportedDatabaseFlagsList() == null + ? ImmutableList.of() + : payload.getSupportedDatabaseFlagsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + LIST_CLUSTERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListClustersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CLUSTERS_PAGE_STR_DESC, request, context); + return ListClustersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + LIST_INSTANCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInstancesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INSTANCES_PAGE_STR_DESC, request, context); + return ListInstancesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + LIST_BACKUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBackupsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BACKUPS_PAGE_STR_DESC, request, context); + return ListBackupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListSupportedDatabaseFlagsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + pageContext = + PageContext.create( + callable, LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_DESC, request, context); + return ListSupportedDatabaseFlagsPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listClusters. */ + public PagedCallSettings + listClustersSettings() { + return listClustersSettings; + } + + /** Returns the object with the settings used for calls to getCluster. */ + public UnaryCallSettings getClusterSettings() { + return getClusterSettings; + } + + /** Returns the object with the settings used for calls to createCluster. */ + public UnaryCallSettings createClusterSettings() { + return createClusterSettings; + } + + /** Returns the object with the settings used for calls to createCluster. */ + public OperationCallSettings + createClusterOperationSettings() { + return createClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public UnaryCallSettings updateClusterSettings() { + return updateClusterSettings; + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public OperationCallSettings + updateClusterOperationSettings() { + return updateClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public UnaryCallSettings deleteClusterSettings() { + return deleteClusterSettings; + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public OperationCallSettings + deleteClusterOperationSettings() { + return deleteClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to restoreCluster. */ + public UnaryCallSettings restoreClusterSettings() { + return restoreClusterSettings; + } + + /** Returns the object with the settings used for calls to restoreCluster. */ + public OperationCallSettings + restoreClusterOperationSettings() { + return restoreClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to batchCreateInstances. */ + public UnaryCallSettings batchCreateInstancesSettings() { + return batchCreateInstancesSettings; + } + + /** Returns the object with the settings used for calls to batchCreateInstances. */ + public OperationCallSettings< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings() { + return batchCreateInstancesOperationSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public OperationCallSettings + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public OperationCallSettings + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to failoverInstance. */ + public UnaryCallSettings failoverInstanceSettings() { + return failoverInstanceSettings; + } + + /** Returns the object with the settings used for calls to failoverInstance. */ + public OperationCallSettings + failoverInstanceOperationSettings() { + return failoverInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to restartInstance. */ + public UnaryCallSettings restartInstanceSettings() { + return restartInstanceSettings; + } + + /** Returns the object with the settings used for calls to restartInstance. */ + public OperationCallSettings + restartInstanceOperationSettings() { + return restartInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return getBackupSettings; + } + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return createBackupSettings; + } + + /** Returns the object with the settings used for calls to createBackup. */ + public OperationCallSettings + createBackupOperationSettings() { + return createBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public OperationCallSettings + updateBackupOperationSettings() { + return updateBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return deleteBackupSettings; + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public OperationCallSettings + deleteBackupOperationSettings() { + return deleteBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to listSupportedDatabaseFlags. */ + public PagedCallSettings< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings() { + return listSupportedDatabaseFlagsSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public AlloyDBAdminStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAlloyDBAdminStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonAlloyDBAdminStub.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 "alloydb.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "alloydb.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(AlloyDBAdminStubSettings.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(AlloyDBAdminStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AlloyDBAdminStubSettings.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 AlloyDBAdminStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listClustersSettings = settingsBuilder.listClustersSettings().build(); + getClusterSettings = settingsBuilder.getClusterSettings().build(); + createClusterSettings = settingsBuilder.createClusterSettings().build(); + createClusterOperationSettings = settingsBuilder.createClusterOperationSettings().build(); + updateClusterSettings = settingsBuilder.updateClusterSettings().build(); + updateClusterOperationSettings = settingsBuilder.updateClusterOperationSettings().build(); + deleteClusterSettings = settingsBuilder.deleteClusterSettings().build(); + deleteClusterOperationSettings = settingsBuilder.deleteClusterOperationSettings().build(); + restoreClusterSettings = settingsBuilder.restoreClusterSettings().build(); + restoreClusterOperationSettings = settingsBuilder.restoreClusterOperationSettings().build(); + listInstancesSettings = settingsBuilder.listInstancesSettings().build(); + getInstanceSettings = settingsBuilder.getInstanceSettings().build(); + createInstanceSettings = settingsBuilder.createInstanceSettings().build(); + createInstanceOperationSettings = settingsBuilder.createInstanceOperationSettings().build(); + batchCreateInstancesSettings = settingsBuilder.batchCreateInstancesSettings().build(); + batchCreateInstancesOperationSettings = + settingsBuilder.batchCreateInstancesOperationSettings().build(); + updateInstanceSettings = settingsBuilder.updateInstanceSettings().build(); + updateInstanceOperationSettings = settingsBuilder.updateInstanceOperationSettings().build(); + deleteInstanceSettings = settingsBuilder.deleteInstanceSettings().build(); + deleteInstanceOperationSettings = settingsBuilder.deleteInstanceOperationSettings().build(); + failoverInstanceSettings = settingsBuilder.failoverInstanceSettings().build(); + failoverInstanceOperationSettings = settingsBuilder.failoverInstanceOperationSettings().build(); + restartInstanceSettings = settingsBuilder.restartInstanceSettings().build(); + restartInstanceOperationSettings = settingsBuilder.restartInstanceOperationSettings().build(); + listBackupsSettings = settingsBuilder.listBackupsSettings().build(); + getBackupSettings = settingsBuilder.getBackupSettings().build(); + createBackupSettings = settingsBuilder.createBackupSettings().build(); + createBackupOperationSettings = settingsBuilder.createBackupOperationSettings().build(); + updateBackupSettings = settingsBuilder.updateBackupSettings().build(); + updateBackupOperationSettings = settingsBuilder.updateBackupOperationSettings().build(); + deleteBackupSettings = settingsBuilder.deleteBackupSettings().build(); + deleteBackupOperationSettings = settingsBuilder.deleteBackupOperationSettings().build(); + listSupportedDatabaseFlagsSettings = + settingsBuilder.listSupportedDatabaseFlagsSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for AlloyDBAdminStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings; + private final UnaryCallSettings.Builder getClusterSettings; + private final UnaryCallSettings.Builder createClusterSettings; + private final OperationCallSettings.Builder + createClusterOperationSettings; + private final UnaryCallSettings.Builder updateClusterSettings; + private final OperationCallSettings.Builder + updateClusterOperationSettings; + private final UnaryCallSettings.Builder deleteClusterSettings; + private final OperationCallSettings.Builder + deleteClusterOperationSettings; + private final UnaryCallSettings.Builder + restoreClusterSettings; + private final OperationCallSettings.Builder + restoreClusterOperationSettings; + private final PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings.Builder getInstanceSettings; + private final UnaryCallSettings.Builder + createInstanceSettings; + private final OperationCallSettings.Builder + createInstanceOperationSettings; + private final UnaryCallSettings.Builder + batchCreateInstancesSettings; + private final OperationCallSettings.Builder< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings; + private final UnaryCallSettings.Builder + updateInstanceSettings; + private final OperationCallSettings.Builder + updateInstanceOperationSettings; + private final UnaryCallSettings.Builder + deleteInstanceSettings; + private final OperationCallSettings.Builder + deleteInstanceOperationSettings; + private final UnaryCallSettings.Builder + failoverInstanceSettings; + private final OperationCallSettings.Builder< + FailoverInstanceRequest, Instance, OperationMetadata> + failoverInstanceOperationSettings; + private final UnaryCallSettings.Builder + restartInstanceSettings; + private final OperationCallSettings.Builder + restartInstanceOperationSettings; + private final PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings; + private final UnaryCallSettings.Builder getBackupSettings; + private final UnaryCallSettings.Builder createBackupSettings; + private final OperationCallSettings.Builder + createBackupOperationSettings; + private final UnaryCallSettings.Builder updateBackupSettings; + private final OperationCallSettings.Builder + updateBackupOperationSettings; + private final UnaryCallSettings.Builder deleteBackupSettings; + private final OperationCallSettings.Builder + deleteBackupOperationSettings; + private final PagedCallSettings.Builder< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + 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() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + 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); + + listClustersSettings = PagedCallSettings.newBuilder(LIST_CLUSTERS_PAGE_STR_FACT); + getClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createClusterOperationSettings = OperationCallSettings.newBuilder(); + updateClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateClusterOperationSettings = OperationCallSettings.newBuilder(); + deleteClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteClusterOperationSettings = OperationCallSettings.newBuilder(); + restoreClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restoreClusterOperationSettings = OperationCallSettings.newBuilder(); + listInstancesSettings = PagedCallSettings.newBuilder(LIST_INSTANCES_PAGE_STR_FACT); + getInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createInstanceOperationSettings = OperationCallSettings.newBuilder(); + batchCreateInstancesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + batchCreateInstancesOperationSettings = OperationCallSettings.newBuilder(); + updateInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateInstanceOperationSettings = OperationCallSettings.newBuilder(); + deleteInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteInstanceOperationSettings = OperationCallSettings.newBuilder(); + failoverInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + failoverInstanceOperationSettings = OperationCallSettings.newBuilder(); + restartInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restartInstanceOperationSettings = OperationCallSettings.newBuilder(); + listBackupsSettings = PagedCallSettings.newBuilder(LIST_BACKUPS_PAGE_STR_FACT); + getBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createBackupOperationSettings = OperationCallSettings.newBuilder(); + updateBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateBackupOperationSettings = OperationCallSettings.newBuilder(); + deleteBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBackupOperationSettings = OperationCallSettings.newBuilder(); + listSupportedDatabaseFlagsSettings = + PagedCallSettings.newBuilder(LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_FACT); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listClustersSettings, + getClusterSettings, + createClusterSettings, + updateClusterSettings, + deleteClusterSettings, + restoreClusterSettings, + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + batchCreateInstancesSettings, + updateInstanceSettings, + deleteInstanceSettings, + failoverInstanceSettings, + restartInstanceSettings, + listBackupsSettings, + getBackupSettings, + createBackupSettings, + updateBackupSettings, + deleteBackupSettings, + listSupportedDatabaseFlagsSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(AlloyDBAdminStubSettings settings) { + super(settings); + + listClustersSettings = settings.listClustersSettings.toBuilder(); + getClusterSettings = settings.getClusterSettings.toBuilder(); + createClusterSettings = settings.createClusterSettings.toBuilder(); + createClusterOperationSettings = settings.createClusterOperationSettings.toBuilder(); + updateClusterSettings = settings.updateClusterSettings.toBuilder(); + updateClusterOperationSettings = settings.updateClusterOperationSettings.toBuilder(); + deleteClusterSettings = settings.deleteClusterSettings.toBuilder(); + deleteClusterOperationSettings = settings.deleteClusterOperationSettings.toBuilder(); + restoreClusterSettings = settings.restoreClusterSettings.toBuilder(); + restoreClusterOperationSettings = settings.restoreClusterOperationSettings.toBuilder(); + listInstancesSettings = settings.listInstancesSettings.toBuilder(); + getInstanceSettings = settings.getInstanceSettings.toBuilder(); + createInstanceSettings = settings.createInstanceSettings.toBuilder(); + createInstanceOperationSettings = settings.createInstanceOperationSettings.toBuilder(); + batchCreateInstancesSettings = settings.batchCreateInstancesSettings.toBuilder(); + batchCreateInstancesOperationSettings = + settings.batchCreateInstancesOperationSettings.toBuilder(); + updateInstanceSettings = settings.updateInstanceSettings.toBuilder(); + updateInstanceOperationSettings = settings.updateInstanceOperationSettings.toBuilder(); + deleteInstanceSettings = settings.deleteInstanceSettings.toBuilder(); + deleteInstanceOperationSettings = settings.deleteInstanceOperationSettings.toBuilder(); + failoverInstanceSettings = settings.failoverInstanceSettings.toBuilder(); + failoverInstanceOperationSettings = settings.failoverInstanceOperationSettings.toBuilder(); + restartInstanceSettings = settings.restartInstanceSettings.toBuilder(); + restartInstanceOperationSettings = settings.restartInstanceOperationSettings.toBuilder(); + listBackupsSettings = settings.listBackupsSettings.toBuilder(); + getBackupSettings = settings.getBackupSettings.toBuilder(); + createBackupSettings = settings.createBackupSettings.toBuilder(); + createBackupOperationSettings = settings.createBackupOperationSettings.toBuilder(); + updateBackupSettings = settings.updateBackupSettings.toBuilder(); + updateBackupOperationSettings = settings.updateBackupOperationSettings.toBuilder(); + deleteBackupSettings = settings.deleteBackupSettings.toBuilder(); + deleteBackupOperationSettings = settings.deleteBackupOperationSettings.toBuilder(); + listSupportedDatabaseFlagsSettings = settings.listSupportedDatabaseFlagsSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listClustersSettings, + getClusterSettings, + createClusterSettings, + updateClusterSettings, + deleteClusterSettings, + restoreClusterSettings, + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + batchCreateInstancesSettings, + updateInstanceSettings, + deleteInstanceSettings, + failoverInstanceSettings, + restartInstanceSettings, + listBackupsSettings, + getBackupSettings, + createBackupSettings, + updateBackupSettings, + deleteBackupSettings, + listSupportedDatabaseFlagsSettings, + listLocationsSettings, + getLocationSettings); + } + + 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 + .listClustersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .restoreClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .batchCreateInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .failoverInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .restartInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listBackupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listSupportedDatabaseFlagsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .restoreClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .batchCreateInstancesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + BatchCreateInstancesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .failoverInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .restartInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createBackupOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Backup.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateBackupOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Backup.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteBackupOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * 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 listClusters. */ + public PagedCallSettings.Builder< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings() { + return listClustersSettings; + } + + /** Returns the builder for the settings used for calls to getCluster. */ + public UnaryCallSettings.Builder getClusterSettings() { + return getClusterSettings; + } + + /** Returns the builder for the settings used for calls to createCluster. */ + public UnaryCallSettings.Builder createClusterSettings() { + return createClusterSettings; + } + + /** Returns the builder for the settings used for calls to createCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createClusterOperationSettings() { + return createClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + public UnaryCallSettings.Builder updateClusterSettings() { + return updateClusterSettings; + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateClusterOperationSettings() { + return updateClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteCluster. */ + public UnaryCallSettings.Builder deleteClusterSettings() { + return deleteClusterSettings; + } + + /** Returns the builder for the settings used for calls to deleteCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteClusterOperationSettings() { + return deleteClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to restoreCluster. */ + public UnaryCallSettings.Builder restoreClusterSettings() { + return restoreClusterSettings; + } + + /** Returns the builder for the settings used for calls to restoreCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + restoreClusterOperationSettings() { + return restoreClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to batchCreateInstances. */ + public UnaryCallSettings.Builder + batchCreateInstancesSettings() { + return batchCreateInstancesSettings; + } + + /** Returns the builder for the settings used for calls to batchCreateInstances. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings() { + return batchCreateInstancesOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to failoverInstance. */ + public UnaryCallSettings.Builder + failoverInstanceSettings() { + return failoverInstanceSettings; + } + + /** Returns the builder for the settings used for calls to failoverInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + failoverInstanceOperationSettings() { + return failoverInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to restartInstance. */ + public UnaryCallSettings.Builder restartInstanceSettings() { + return restartInstanceSettings; + } + + /** Returns the builder for the settings used for calls to restartInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + restartInstanceOperationSettings() { + return restartInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getBackupSettings; + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return createBackupSettings; + } + + /** Returns the builder for the settings used for calls to createBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createBackupOperationSettings() { + return createBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateBackupOperationSettings() { + return updateBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return deleteBackupSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteBackupOperationSettings() { + return deleteBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to listSupportedDatabaseFlags. */ + public PagedCallSettings.Builder< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings() { + return listSupportedDatabaseFlagsSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + @Override + public AlloyDBAdminStubSettings build() throws IOException { + return new AlloyDBAdminStubSettings(this); + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/GrpcAlloyDBAdminCallableFactory.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/GrpcAlloyDBAdminCallableFactory.java new file mode 100644 index 000000000000..a5fadfd1e08b --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/GrpcAlloyDBAdminCallableFactory.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.alloydb.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 AlloyDBAdmin service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcAlloyDBAdminCallableFactory 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-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/GrpcAlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/GrpcAlloyDBAdminStub.java new file mode 100644 index 000000000000..fcea56f73f33 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/GrpcAlloyDBAdminStub.java @@ -0,0 +1,1051 @@ +/* + * 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.alloydb.v1.stub; + +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.CreateBackupRequest; +import com.google.cloud.alloydb.v1.CreateClusterRequest; +import com.google.cloud.alloydb.v1.CreateInstanceRequest; +import com.google.cloud.alloydb.v1.DeleteBackupRequest; +import com.google.cloud.alloydb.v1.DeleteClusterRequest; +import com.google.cloud.alloydb.v1.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1.GetBackupRequest; +import com.google.cloud.alloydb.v1.GetClusterRequest; +import com.google.cloud.alloydb.v1.GetInstanceRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.ListBackupsRequest; +import com.google.cloud.alloydb.v1.ListBackupsResponse; +import com.google.cloud.alloydb.v1.ListClustersRequest; +import com.google.cloud.alloydb.v1.ListClustersResponse; +import com.google.cloud.alloydb.v1.ListInstancesRequest; +import com.google.cloud.alloydb.v1.ListInstancesResponse; +import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.cloud.alloydb.v1.RestartInstanceRequest; +import com.google.cloud.alloydb.v1.RestoreClusterRequest; +import com.google.cloud.alloydb.v1.UpdateBackupRequest; +import com.google.cloud.alloydb.v1.UpdateClusterRequest; +import com.google.cloud.alloydb.v1.UpdateInstanceRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +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 AlloyDBAdmin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { + private static final MethodDescriptor + listClustersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/ListClusters") + .setRequestMarshaller(ProtoUtils.marshaller(ListClustersRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListClustersResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/GetCluster") + .setRequestMarshaller(ProtoUtils.marshaller(GetClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Cluster.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/CreateCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/UpdateCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/DeleteCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + restoreClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/RestoreCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(RestoreClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listInstancesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/ListInstances") + .setRequestMarshaller( + ProtoUtils.marshaller(ListInstancesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListInstancesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/GetInstance") + .setRequestMarshaller(ProtoUtils.marshaller(GetInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Instance.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/CreateInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + batchCreateInstancesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/BatchCreateInstances") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchCreateInstancesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/UpdateInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/DeleteInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + failoverInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/FailoverInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(FailoverInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + restartInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/RestartInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(RestartInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listBackupsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/ListBackups") + .setRequestMarshaller(ProtoUtils.marshaller(ListBackupsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListBackupsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/GetBackup") + .setRequestMarshaller(ProtoUtils.marshaller(GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Backup.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/CreateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/UpdateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/DeleteBackup") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsResponse> + listSupportedDatabaseFlagsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/ListSupportedDatabaseFlags") + .setRequestMarshaller( + ProtoUtils.marshaller(ListSupportedDatabaseFlagsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSupportedDatabaseFlagsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private final UnaryCallable listClustersCallable; + private final UnaryCallable + listClustersPagedCallable; + private final UnaryCallable getClusterCallable; + private final UnaryCallable createClusterCallable; + private final OperationCallable + createClusterOperationCallable; + private final UnaryCallable updateClusterCallable; + private final OperationCallable + updateClusterOperationCallable; + private final UnaryCallable deleteClusterCallable; + private final OperationCallable + deleteClusterOperationCallable; + private final UnaryCallable restoreClusterCallable; + private final OperationCallable + restoreClusterOperationCallable; + private final UnaryCallable listInstancesCallable; + private final UnaryCallable + listInstancesPagedCallable; + private final UnaryCallable getInstanceCallable; + private final UnaryCallable createInstanceCallable; + private final OperationCallable + createInstanceOperationCallable; + private final UnaryCallable batchCreateInstancesCallable; + private final OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable; + private final UnaryCallable updateInstanceCallable; + private final OperationCallable + updateInstanceOperationCallable; + private final UnaryCallable deleteInstanceCallable; + private final OperationCallable + deleteInstanceOperationCallable; + private final UnaryCallable failoverInstanceCallable; + private final OperationCallable + failoverInstanceOperationCallable; + private final UnaryCallable restartInstanceCallable; + private final OperationCallable + restartInstanceOperationCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable + listBackupsPagedCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable createBackupCallable; + private final OperationCallable + createBackupOperationCallable; + private final UnaryCallable updateBackupCallable; + private final OperationCallable + updateBackupOperationCallable; + private final UnaryCallable deleteBackupCallable; + private final OperationCallable + deleteBackupOperationCallable; + private final UnaryCallable + listSupportedDatabaseFlagsCallable; + private final UnaryCallable< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAlloyDBAdminStub create(AlloyDBAdminStubSettings settings) + throws IOException { + return new GrpcAlloyDBAdminStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAlloyDBAdminStub create(ClientContext clientContext) throws IOException { + return new GrpcAlloyDBAdminStub(AlloyDBAdminStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAlloyDBAdminStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAlloyDBAdminStub( + AlloyDBAdminStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAlloyDBAdminStub, 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 GrpcAlloyDBAdminStub(AlloyDBAdminStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcAlloyDBAdminCallableFactory()); + } + + /** + * Constructs an instance of GrpcAlloyDBAdminStub, 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 GrpcAlloyDBAdminStub( + AlloyDBAdminStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listClustersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listClustersMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("cluster.name", String.valueOf(request.getCluster().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings restoreClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restoreClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings listInstancesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listInstancesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings batchCreateInstancesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchCreateInstancesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("instance.name", String.valueOf(request.getInstance().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings failoverInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(failoverInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings restartInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restartInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listBackupsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBackupMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBackupMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("backup.name", String.valueOf(request.getBackup().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listSupportedDatabaseFlagsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listSupportedDatabaseFlagsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + + this.listClustersCallable = + callableFactory.createUnaryCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.listClustersPagedCallable = + callableFactory.createPagedCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.getClusterCallable = + callableFactory.createUnaryCallable( + getClusterTransportSettings, settings.getClusterSettings(), clientContext); + this.createClusterCallable = + callableFactory.createUnaryCallable( + createClusterTransportSettings, settings.createClusterSettings(), clientContext); + this.createClusterOperationCallable = + callableFactory.createOperationCallable( + createClusterTransportSettings, + settings.createClusterOperationSettings(), + clientContext, + operationsStub); + this.updateClusterCallable = + callableFactory.createUnaryCallable( + updateClusterTransportSettings, settings.updateClusterSettings(), clientContext); + this.updateClusterOperationCallable = + callableFactory.createOperationCallable( + updateClusterTransportSettings, + settings.updateClusterOperationSettings(), + clientContext, + operationsStub); + this.deleteClusterCallable = + callableFactory.createUnaryCallable( + deleteClusterTransportSettings, settings.deleteClusterSettings(), clientContext); + this.deleteClusterOperationCallable = + callableFactory.createOperationCallable( + deleteClusterTransportSettings, + settings.deleteClusterOperationSettings(), + clientContext, + operationsStub); + this.restoreClusterCallable = + callableFactory.createUnaryCallable( + restoreClusterTransportSettings, settings.restoreClusterSettings(), clientContext); + this.restoreClusterOperationCallable = + callableFactory.createOperationCallable( + restoreClusterTransportSettings, + settings.restoreClusterOperationSettings(), + clientContext, + operationsStub); + this.listInstancesCallable = + callableFactory.createUnaryCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.listInstancesPagedCallable = + callableFactory.createPagedCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.getInstanceCallable = + callableFactory.createUnaryCallable( + getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); + this.createInstanceCallable = + callableFactory.createUnaryCallable( + createInstanceTransportSettings, settings.createInstanceSettings(), clientContext); + this.createInstanceOperationCallable = + callableFactory.createOperationCallable( + createInstanceTransportSettings, + settings.createInstanceOperationSettings(), + clientContext, + operationsStub); + this.batchCreateInstancesCallable = + callableFactory.createUnaryCallable( + batchCreateInstancesTransportSettings, + settings.batchCreateInstancesSettings(), + clientContext); + this.batchCreateInstancesOperationCallable = + callableFactory.createOperationCallable( + batchCreateInstancesTransportSettings, + settings.batchCreateInstancesOperationSettings(), + clientContext, + operationsStub); + this.updateInstanceCallable = + callableFactory.createUnaryCallable( + updateInstanceTransportSettings, settings.updateInstanceSettings(), clientContext); + this.updateInstanceOperationCallable = + callableFactory.createOperationCallable( + updateInstanceTransportSettings, + settings.updateInstanceOperationSettings(), + clientContext, + operationsStub); + this.deleteInstanceCallable = + callableFactory.createUnaryCallable( + deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); + this.deleteInstanceOperationCallable = + callableFactory.createOperationCallable( + deleteInstanceTransportSettings, + settings.deleteInstanceOperationSettings(), + clientContext, + operationsStub); + this.failoverInstanceCallable = + callableFactory.createUnaryCallable( + failoverInstanceTransportSettings, settings.failoverInstanceSettings(), clientContext); + this.failoverInstanceOperationCallable = + callableFactory.createOperationCallable( + failoverInstanceTransportSettings, + settings.failoverInstanceOperationSettings(), + clientContext, + operationsStub); + this.restartInstanceCallable = + callableFactory.createUnaryCallable( + restartInstanceTransportSettings, settings.restartInstanceSettings(), clientContext); + this.restartInstanceOperationCallable = + callableFactory.createOperationCallable( + restartInstanceTransportSettings, + settings.restartInstanceOperationSettings(), + clientContext, + operationsStub); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.listBackupsPagedCallable = + callableFactory.createPagedCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.createBackupCallable = + callableFactory.createUnaryCallable( + createBackupTransportSettings, settings.createBackupSettings(), clientContext); + this.createBackupOperationCallable = + callableFactory.createOperationCallable( + createBackupTransportSettings, + settings.createBackupOperationSettings(), + clientContext, + operationsStub); + this.updateBackupCallable = + callableFactory.createUnaryCallable( + updateBackupTransportSettings, settings.updateBackupSettings(), clientContext); + this.updateBackupOperationCallable = + callableFactory.createOperationCallable( + updateBackupTransportSettings, + settings.updateBackupOperationSettings(), + clientContext, + operationsStub); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + this.deleteBackupOperationCallable = + callableFactory.createOperationCallable( + deleteBackupTransportSettings, + settings.deleteBackupOperationSettings(), + clientContext, + operationsStub); + this.listSupportedDatabaseFlagsCallable = + callableFactory.createUnaryCallable( + listSupportedDatabaseFlagsTransportSettings, + settings.listSupportedDatabaseFlagsSettings(), + clientContext); + this.listSupportedDatabaseFlagsPagedCallable = + callableFactory.createPagedCallable( + listSupportedDatabaseFlagsTransportSettings, + settings.listSupportedDatabaseFlagsSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listClustersCallable() { + return listClustersCallable; + } + + @Override + public UnaryCallable listClustersPagedCallable() { + return listClustersPagedCallable; + } + + @Override + public UnaryCallable getClusterCallable() { + return getClusterCallable; + } + + @Override + public UnaryCallable createClusterCallable() { + return createClusterCallable; + } + + @Override + public OperationCallable + createClusterOperationCallable() { + return createClusterOperationCallable; + } + + @Override + public UnaryCallable updateClusterCallable() { + return updateClusterCallable; + } + + @Override + public OperationCallable + updateClusterOperationCallable() { + return updateClusterOperationCallable; + } + + @Override + public UnaryCallable deleteClusterCallable() { + return deleteClusterCallable; + } + + @Override + public OperationCallable + deleteClusterOperationCallable() { + return deleteClusterOperationCallable; + } + + @Override + public UnaryCallable restoreClusterCallable() { + return restoreClusterCallable; + } + + @Override + public OperationCallable + restoreClusterOperationCallable() { + return restoreClusterOperationCallable; + } + + @Override + public UnaryCallable listInstancesCallable() { + return listInstancesCallable; + } + + @Override + public UnaryCallable + listInstancesPagedCallable() { + return listInstancesPagedCallable; + } + + @Override + public UnaryCallable getInstanceCallable() { + return getInstanceCallable; + } + + @Override + public UnaryCallable createInstanceCallable() { + return createInstanceCallable; + } + + @Override + public OperationCallable + createInstanceOperationCallable() { + return createInstanceOperationCallable; + } + + @Override + public UnaryCallable batchCreateInstancesCallable() { + return batchCreateInstancesCallable; + } + + @Override + public OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable() { + return batchCreateInstancesOperationCallable; + } + + @Override + public UnaryCallable updateInstanceCallable() { + return updateInstanceCallable; + } + + @Override + public OperationCallable + updateInstanceOperationCallable() { + return updateInstanceOperationCallable; + } + + @Override + public UnaryCallable deleteInstanceCallable() { + return deleteInstanceCallable; + } + + @Override + public OperationCallable + deleteInstanceOperationCallable() { + return deleteInstanceOperationCallable; + } + + @Override + public UnaryCallable failoverInstanceCallable() { + return failoverInstanceCallable; + } + + @Override + public OperationCallable + failoverInstanceOperationCallable() { + return failoverInstanceOperationCallable; + } + + @Override + public UnaryCallable restartInstanceCallable() { + return restartInstanceCallable; + } + + @Override + public OperationCallable + restartInstanceOperationCallable() { + return restartInstanceOperationCallable; + } + + @Override + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @Override + public UnaryCallable listBackupsPagedCallable() { + return listBackupsPagedCallable; + } + + @Override + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + @Override + public UnaryCallable createBackupCallable() { + return createBackupCallable; + } + + @Override + public OperationCallable + createBackupOperationCallable() { + return createBackupOperationCallable; + } + + @Override + public UnaryCallable updateBackupCallable() { + return updateBackupCallable; + } + + @Override + public OperationCallable + updateBackupOperationCallable() { + return updateBackupOperationCallable; + } + + @Override + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + @Override + public OperationCallable + deleteBackupOperationCallable() { + return deleteBackupOperationCallable; + } + + @Override + public UnaryCallable + listSupportedDatabaseFlagsCallable() { + return listSupportedDatabaseFlagsCallable; + } + + @Override + public UnaryCallable + listSupportedDatabaseFlagsPagedCallable() { + return listSupportedDatabaseFlagsPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @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-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/HttpJsonAlloyDBAdminCallableFactory.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/HttpJsonAlloyDBAdminCallableFactory.java new file mode 100644 index 000000000000..a198d3c618c6 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/HttpJsonAlloyDBAdminCallableFactory.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.alloydb.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 AlloyDBAdmin service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonAlloyDBAdminCallableFactory + 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-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/HttpJsonAlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/HttpJsonAlloyDBAdminStub.java new file mode 100644 index 000000000000..a979279e3d2d --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/HttpJsonAlloyDBAdminStub.java @@ -0,0 +1,1660 @@ +/* + * 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.alloydb.v1.stub; + +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +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.HttpJsonOperationSnapshot; +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.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.CreateBackupRequest; +import com.google.cloud.alloydb.v1.CreateClusterRequest; +import com.google.cloud.alloydb.v1.CreateInstanceRequest; +import com.google.cloud.alloydb.v1.DeleteBackupRequest; +import com.google.cloud.alloydb.v1.DeleteClusterRequest; +import com.google.cloud.alloydb.v1.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1.GetBackupRequest; +import com.google.cloud.alloydb.v1.GetClusterRequest; +import com.google.cloud.alloydb.v1.GetInstanceRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.ListBackupsRequest; +import com.google.cloud.alloydb.v1.ListBackupsResponse; +import com.google.cloud.alloydb.v1.ListClustersRequest; +import com.google.cloud.alloydb.v1.ListClustersResponse; +import com.google.cloud.alloydb.v1.ListInstancesRequest; +import com.google.cloud.alloydb.v1.ListInstancesResponse; +import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.cloud.alloydb.v1.RestartInstanceRequest; +import com.google.cloud.alloydb.v1.RestoreClusterRequest; +import com.google.cloud.alloydb.v1.UpdateBackupRequest; +import com.google.cloud.alloydb.v1.UpdateClusterRequest; +import com.google.cloud.alloydb.v1.UpdateInstanceRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.Operation; +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 AlloyDBAdmin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(BatchCreateInstancesResponse.getDescriptor()) + .add(Empty.getDescriptor()) + .add(Cluster.getDescriptor()) + .add(Backup.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .add(Instance.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listClustersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/ListClusters") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/clusters", + 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, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListClustersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/GetCluster") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/clusters/*}", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Cluster.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/CreateCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/clusters", + 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, "clusterId", request.getClusterId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("cluster", request.getCluster(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/UpdateCluster") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{cluster.name=projects/*/locations/*/clusters/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "cluster.name", request.getCluster().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("cluster", request.getCluster(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/DeleteCluster") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/clusters/*}", + 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(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam(fields, "force", request.getForce()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + restoreClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/RestoreCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/clusters:restore", + 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, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (RestoreClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/ListInstances") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/clusters/*}/instances", + 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, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListInstancesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/GetInstance") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/clusters/*/instances/*}", + 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(); + serializer.putQueryParam(fields, "view", request.getViewValue()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Instance.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/CreateInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/clusters/*}/instances", + 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, "instanceId", request.getInstanceId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("instance", request.getInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + batchCreateInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/BatchCreateInstances") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate", + 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, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("requests", request.getRequests(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (BatchCreateInstancesRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/UpdateInstance") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{instance.name=projects/*/locations/*/clusters/*/instances/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "instance.name", request.getInstance().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("instance", request.getInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/DeleteInstance") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/clusters/*/instances/*}", + 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(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + failoverInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/FailoverInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:failover", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (FailoverInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + restartInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/RestartInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:restart", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (RestartInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listBackupsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/ListBackups") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/backups", + 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, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListBackupsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/GetBackup") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/backups/*}", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Backup.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/CreateBackup") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/backups", + 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, "backupId", request.getBackupId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("backup", request.getBackup(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateBackupRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/UpdateBackup") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{backup.name=projects/*/locations/*/backups/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "backup.name", request.getBackup().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("backup", request.getBackup(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateBackupRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/DeleteBackup") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/backups/*}", + 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(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteBackupRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsResponse> + listSupportedDatabaseFlagsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/ListSupportedDatabaseFlags") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/supportedDatabaseFlags", + 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()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSupportedDatabaseFlagsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listClustersCallable; + private final UnaryCallable + listClustersPagedCallable; + private final UnaryCallable getClusterCallable; + private final UnaryCallable createClusterCallable; + private final OperationCallable + createClusterOperationCallable; + private final UnaryCallable updateClusterCallable; + private final OperationCallable + updateClusterOperationCallable; + private final UnaryCallable deleteClusterCallable; + private final OperationCallable + deleteClusterOperationCallable; + private final UnaryCallable restoreClusterCallable; + private final OperationCallable + restoreClusterOperationCallable; + private final UnaryCallable listInstancesCallable; + private final UnaryCallable + listInstancesPagedCallable; + private final UnaryCallable getInstanceCallable; + private final UnaryCallable createInstanceCallable; + private final OperationCallable + createInstanceOperationCallable; + private final UnaryCallable batchCreateInstancesCallable; + private final OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable; + private final UnaryCallable updateInstanceCallable; + private final OperationCallable + updateInstanceOperationCallable; + private final UnaryCallable deleteInstanceCallable; + private final OperationCallable + deleteInstanceOperationCallable; + private final UnaryCallable failoverInstanceCallable; + private final OperationCallable + failoverInstanceOperationCallable; + private final UnaryCallable restartInstanceCallable; + private final OperationCallable + restartInstanceOperationCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable + listBackupsPagedCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable createBackupCallable; + private final OperationCallable + createBackupOperationCallable; + private final UnaryCallable updateBackupCallable; + private final OperationCallable + updateBackupOperationCallable; + private final UnaryCallable deleteBackupCallable; + private final OperationCallable + deleteBackupOperationCallable; + private final UnaryCallable + listSupportedDatabaseFlagsCallable; + private final UnaryCallable< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonAlloyDBAdminStub create(AlloyDBAdminStubSettings settings) + throws IOException { + return new HttpJsonAlloyDBAdminStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAlloyDBAdminStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonAlloyDBAdminStub( + AlloyDBAdminStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonAlloyDBAdminStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAlloyDBAdminStub( + AlloyDBAdminStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonAlloyDBAdminStub, 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 HttpJsonAlloyDBAdminStub(AlloyDBAdminStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonAlloyDBAdminCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAlloyDBAdminStub, 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 HttpJsonAlloyDBAdminStub( + AlloyDBAdminStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings listClustersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listClustersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings restoreClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(restoreClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listInstancesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInstancesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + batchCreateInstancesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(batchCreateInstancesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings failoverInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(failoverInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings restartInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(restartInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listBackupsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listSupportedDatabaseFlagsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listSupportedDatabaseFlagsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listClustersCallable = + callableFactory.createUnaryCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.listClustersPagedCallable = + callableFactory.createPagedCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.getClusterCallable = + callableFactory.createUnaryCallable( + getClusterTransportSettings, settings.getClusterSettings(), clientContext); + this.createClusterCallable = + callableFactory.createUnaryCallable( + createClusterTransportSettings, settings.createClusterSettings(), clientContext); + this.createClusterOperationCallable = + callableFactory.createOperationCallable( + createClusterTransportSettings, + settings.createClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateClusterCallable = + callableFactory.createUnaryCallable( + updateClusterTransportSettings, settings.updateClusterSettings(), clientContext); + this.updateClusterOperationCallable = + callableFactory.createOperationCallable( + updateClusterTransportSettings, + settings.updateClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteClusterCallable = + callableFactory.createUnaryCallable( + deleteClusterTransportSettings, settings.deleteClusterSettings(), clientContext); + this.deleteClusterOperationCallable = + callableFactory.createOperationCallable( + deleteClusterTransportSettings, + settings.deleteClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.restoreClusterCallable = + callableFactory.createUnaryCallable( + restoreClusterTransportSettings, settings.restoreClusterSettings(), clientContext); + this.restoreClusterOperationCallable = + callableFactory.createOperationCallable( + restoreClusterTransportSettings, + settings.restoreClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listInstancesCallable = + callableFactory.createUnaryCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.listInstancesPagedCallable = + callableFactory.createPagedCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.getInstanceCallable = + callableFactory.createUnaryCallable( + getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); + this.createInstanceCallable = + callableFactory.createUnaryCallable( + createInstanceTransportSettings, settings.createInstanceSettings(), clientContext); + this.createInstanceOperationCallable = + callableFactory.createOperationCallable( + createInstanceTransportSettings, + settings.createInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.batchCreateInstancesCallable = + callableFactory.createUnaryCallable( + batchCreateInstancesTransportSettings, + settings.batchCreateInstancesSettings(), + clientContext); + this.batchCreateInstancesOperationCallable = + callableFactory.createOperationCallable( + batchCreateInstancesTransportSettings, + settings.batchCreateInstancesOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateInstanceCallable = + callableFactory.createUnaryCallable( + updateInstanceTransportSettings, settings.updateInstanceSettings(), clientContext); + this.updateInstanceOperationCallable = + callableFactory.createOperationCallable( + updateInstanceTransportSettings, + settings.updateInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteInstanceCallable = + callableFactory.createUnaryCallable( + deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); + this.deleteInstanceOperationCallable = + callableFactory.createOperationCallable( + deleteInstanceTransportSettings, + settings.deleteInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.failoverInstanceCallable = + callableFactory.createUnaryCallable( + failoverInstanceTransportSettings, settings.failoverInstanceSettings(), clientContext); + this.failoverInstanceOperationCallable = + callableFactory.createOperationCallable( + failoverInstanceTransportSettings, + settings.failoverInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.restartInstanceCallable = + callableFactory.createUnaryCallable( + restartInstanceTransportSettings, settings.restartInstanceSettings(), clientContext); + this.restartInstanceOperationCallable = + callableFactory.createOperationCallable( + restartInstanceTransportSettings, + settings.restartInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.listBackupsPagedCallable = + callableFactory.createPagedCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.createBackupCallable = + callableFactory.createUnaryCallable( + createBackupTransportSettings, settings.createBackupSettings(), clientContext); + this.createBackupOperationCallable = + callableFactory.createOperationCallable( + createBackupTransportSettings, + settings.createBackupOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateBackupCallable = + callableFactory.createUnaryCallable( + updateBackupTransportSettings, settings.updateBackupSettings(), clientContext); + this.updateBackupOperationCallable = + callableFactory.createOperationCallable( + updateBackupTransportSettings, + settings.updateBackupOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + this.deleteBackupOperationCallable = + callableFactory.createOperationCallable( + deleteBackupTransportSettings, + settings.deleteBackupOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listSupportedDatabaseFlagsCallable = + callableFactory.createUnaryCallable( + listSupportedDatabaseFlagsTransportSettings, + settings.listSupportedDatabaseFlagsSettings(), + clientContext); + this.listSupportedDatabaseFlagsPagedCallable = + callableFactory.createPagedCallable( + listSupportedDatabaseFlagsTransportSettings, + settings.listSupportedDatabaseFlagsSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listClustersMethodDescriptor); + methodDescriptors.add(getClusterMethodDescriptor); + methodDescriptors.add(createClusterMethodDescriptor); + methodDescriptors.add(updateClusterMethodDescriptor); + methodDescriptors.add(deleteClusterMethodDescriptor); + methodDescriptors.add(restoreClusterMethodDescriptor); + methodDescriptors.add(listInstancesMethodDescriptor); + methodDescriptors.add(getInstanceMethodDescriptor); + methodDescriptors.add(createInstanceMethodDescriptor); + methodDescriptors.add(batchCreateInstancesMethodDescriptor); + methodDescriptors.add(updateInstanceMethodDescriptor); + methodDescriptors.add(deleteInstanceMethodDescriptor); + methodDescriptors.add(failoverInstanceMethodDescriptor); + methodDescriptors.add(restartInstanceMethodDescriptor); + methodDescriptors.add(listBackupsMethodDescriptor); + methodDescriptors.add(getBackupMethodDescriptor); + methodDescriptors.add(createBackupMethodDescriptor); + methodDescriptors.add(updateBackupMethodDescriptor); + methodDescriptors.add(deleteBackupMethodDescriptor); + methodDescriptors.add(listSupportedDatabaseFlagsMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable listClustersCallable() { + return listClustersCallable; + } + + @Override + public UnaryCallable listClustersPagedCallable() { + return listClustersPagedCallable; + } + + @Override + public UnaryCallable getClusterCallable() { + return getClusterCallable; + } + + @Override + public UnaryCallable createClusterCallable() { + return createClusterCallable; + } + + @Override + public OperationCallable + createClusterOperationCallable() { + return createClusterOperationCallable; + } + + @Override + public UnaryCallable updateClusterCallable() { + return updateClusterCallable; + } + + @Override + public OperationCallable + updateClusterOperationCallable() { + return updateClusterOperationCallable; + } + + @Override + public UnaryCallable deleteClusterCallable() { + return deleteClusterCallable; + } + + @Override + public OperationCallable + deleteClusterOperationCallable() { + return deleteClusterOperationCallable; + } + + @Override + public UnaryCallable restoreClusterCallable() { + return restoreClusterCallable; + } + + @Override + public OperationCallable + restoreClusterOperationCallable() { + return restoreClusterOperationCallable; + } + + @Override + public UnaryCallable listInstancesCallable() { + return listInstancesCallable; + } + + @Override + public UnaryCallable + listInstancesPagedCallable() { + return listInstancesPagedCallable; + } + + @Override + public UnaryCallable getInstanceCallable() { + return getInstanceCallable; + } + + @Override + public UnaryCallable createInstanceCallable() { + return createInstanceCallable; + } + + @Override + public OperationCallable + createInstanceOperationCallable() { + return createInstanceOperationCallable; + } + + @Override + public UnaryCallable batchCreateInstancesCallable() { + return batchCreateInstancesCallable; + } + + @Override + public OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable() { + return batchCreateInstancesOperationCallable; + } + + @Override + public UnaryCallable updateInstanceCallable() { + return updateInstanceCallable; + } + + @Override + public OperationCallable + updateInstanceOperationCallable() { + return updateInstanceOperationCallable; + } + + @Override + public UnaryCallable deleteInstanceCallable() { + return deleteInstanceCallable; + } + + @Override + public OperationCallable + deleteInstanceOperationCallable() { + return deleteInstanceOperationCallable; + } + + @Override + public UnaryCallable failoverInstanceCallable() { + return failoverInstanceCallable; + } + + @Override + public OperationCallable + failoverInstanceOperationCallable() { + return failoverInstanceOperationCallable; + } + + @Override + public UnaryCallable restartInstanceCallable() { + return restartInstanceCallable; + } + + @Override + public OperationCallable + restartInstanceOperationCallable() { + return restartInstanceOperationCallable; + } + + @Override + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @Override + public UnaryCallable listBackupsPagedCallable() { + return listBackupsPagedCallable; + } + + @Override + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + @Override + public UnaryCallable createBackupCallable() { + return createBackupCallable; + } + + @Override + public OperationCallable + createBackupOperationCallable() { + return createBackupOperationCallable; + } + + @Override + public UnaryCallable updateBackupCallable() { + return updateBackupCallable; + } + + @Override + public OperationCallable + updateBackupOperationCallable() { + return updateBackupOperationCallable; + } + + @Override + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + @Override + public OperationCallable + deleteBackupOperationCallable() { + return deleteBackupOperationCallable; + } + + @Override + public UnaryCallable + listSupportedDatabaseFlagsCallable() { + return listSupportedDatabaseFlagsCallable; + } + + @Override + public UnaryCallable + listSupportedDatabaseFlagsPagedCallable() { + return listSupportedDatabaseFlagsPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @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-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClient.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClient.java new file mode 100644 index 000000000000..e5fe881604cd --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClient.java @@ -0,0 +1,4462 @@ +/* + * 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.alloydb.v1alpha; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.alloydb.v1alpha.stub.AlloyDBAdminStub; +import com.google.cloud.alloydb.v1alpha.stub.AlloyDBAdminStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service describing handlers for resources + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+ *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+ *   Cluster response = alloyDBAdminClient.getCluster(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the AlloyDBAdminClient 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 AlloyDBAdminSettings 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
+ * AlloyDBAdminSettings alloyDBAdminSettings =
+ *     AlloyDBAdminSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings);
+ * }
+ * + *

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
+ * AlloyDBAdminSettings alloyDBAdminSettings =
+ *     AlloyDBAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings);
+ * }
+ * + *

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
+ * AlloyDBAdminSettings alloyDBAdminSettings = AlloyDBAdminSettings.newHttpJsonBuilder().build();
+ * AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class AlloyDBAdminClient implements BackgroundResource { + private final AlloyDBAdminSettings settings; + private final AlloyDBAdminStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of AlloyDBAdminClient with default settings. */ + public static final AlloyDBAdminClient create() throws IOException { + return create(AlloyDBAdminSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AlloyDBAdminClient, 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 AlloyDBAdminClient create(AlloyDBAdminSettings settings) throws IOException { + return new AlloyDBAdminClient(settings); + } + + /** + * Constructs an instance of AlloyDBAdminClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(AlloyDBAdminSettings). + */ + public static final AlloyDBAdminClient create(AlloyDBAdminStub stub) { + return new AlloyDBAdminClient(stub); + } + + /** + * Constructs an instance of AlloyDBAdminClient, 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 AlloyDBAdminClient(AlloyDBAdminSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AlloyDBAdminStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected AlloyDBAdminClient(AlloyDBAdminStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final AlloyDBAdminSettings getSettings() { + return settings; + } + + public AlloyDBAdminStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Clusters in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Cluster element : alloyDBAdminClient.listClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an aggregated list + * operation by specifying a value with the following format: * + * projects/{project}/locations/- + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListClustersPagedResponse listClusters(LocationName parent) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listClusters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Clusters in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Cluster element : alloyDBAdminClient.listClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an aggregated list + * operation by specifying a value with the following format: * + * projects/{project}/locations/- + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListClustersPagedResponse listClusters(String parent) { + ListClustersRequest request = ListClustersRequest.newBuilder().setParent(parent).build(); + return listClusters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Clusters in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Cluster element : alloyDBAdminClient.listClusters(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 ListClustersPagedResponse listClusters(ListClustersRequest request) { + return listClustersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Clusters in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.listClustersPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Cluster element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listClustersPagedCallable() { + return stub.listClustersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Clusters in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListClustersResponse response = alloyDBAdminClient.listClustersCallable().call(request);
+   *     for (Cluster element : response.getClustersList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listClustersCallable() { + return stub.listClustersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   Cluster response = alloyDBAdminClient.getCluster(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Cluster getCluster(ClusterName name) { + GetClusterRequest request = + GetClusterRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getCluster(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   Cluster response = alloyDBAdminClient.getCluster(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Cluster getCluster(String name) { + GetClusterRequest request = GetClusterRequest.newBuilder().setName(name).build(); + return getCluster(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetClusterRequest request =
+   *       GetClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.getCluster(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 Cluster getCluster(GetClusterRequest request) { + return getClusterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetClusterRequest request =
+   *       GetClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.getClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getClusterCallable() { + return stub.getClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response = alloyDBAdminClient.createClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * @param cluster Required. The resource being created + * @param clusterId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createClusterAsync( + LocationName parent, Cluster cluster, String clusterId) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setCluster(cluster) + .setClusterId(clusterId) + .build(); + return createClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response = alloyDBAdminClient.createClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * @param cluster Required. The resource being created + * @param clusterId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createClusterAsync( + String parent, Cluster cluster, String clusterId) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(parent) + .setCluster(cluster) + .setClusterId(clusterId) + .build(); + return createClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.createClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createClusterAsync( + CreateClusterRequest request) { + return createClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.createClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createClusterOperationCallable() { + return stub.createClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.createClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createClusterCallable() { + return stub.createClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Cluster response = alloyDBAdminClient.updateClusterAsync(cluster, updateMask).get();
+   * }
+   * }
+ * + * @param cluster Required. The resource being updated + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. The fields specified in the update_mask are relative to the + * resource, not the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateClusterAsync( + Cluster cluster, FieldMask updateMask) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder().setCluster(cluster).setUpdateMask(updateMask).build(); + return updateClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateClusterRequest request =
+   *       UpdateClusterRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.updateClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateClusterAsync( + UpdateClusterRequest request) { + return updateClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateClusterRequest request =
+   *       UpdateClusterRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.updateClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateClusterOperationCallable() { + return stub.updateClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateClusterRequest request =
+   *       UpdateClusterRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.updateClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateClusterCallable() { + return stub.updateClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   alloyDBAdminClient.deleteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteClusterAsync(ClusterName name) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   alloyDBAdminClient.deleteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteClusterAsync(String name) { + DeleteClusterRequest request = DeleteClusterRequest.newBuilder().setName(name).build(); + return deleteClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .setForce(true)
+   *           .build();
+   *   alloyDBAdminClient.deleteClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteClusterAsync( + DeleteClusterRequest request) { + return deleteClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .setForce(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.deleteClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteClusterOperationCallable() { + return stub.deleteClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.deleteClusterCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteClusterCallable() { + return stub.deleteClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes + * a secondary cluster into its own standalone cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   Cluster response = alloyDBAdminClient.promoteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture promoteClusterAsync(ClusterName name) { + PromoteClusterRequest request = + PromoteClusterRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return promoteClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes + * a secondary cluster into its own standalone cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   Cluster response = alloyDBAdminClient.promoteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture promoteClusterAsync(String name) { + PromoteClusterRequest request = PromoteClusterRequest.newBuilder().setName(name).build(); + return promoteClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes + * a secondary cluster into its own standalone cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   PromoteClusterRequest request =
+   *       PromoteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.promoteClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture promoteClusterAsync( + PromoteClusterRequest request) { + return promoteClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes + * a secondary cluster into its own standalone cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   PromoteClusterRequest request =
+   *       PromoteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.promoteClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + promoteClusterOperationCallable() { + return stub.promoteClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes + * a secondary cluster into its own standalone cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   PromoteClusterRequest request =
+   *       PromoteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.promoteClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable promoteClusterCallable() { + return stub.promoteClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and location, with a volume restored from the provided + * source, either a backup ID or a point-in-time and a source cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestoreClusterRequest request =
+   *       RestoreClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.restoreClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture restoreClusterAsync( + RestoreClusterRequest request) { + return restoreClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and location, with a volume restored from the provided + * source, either a backup ID or a point-in-time and a source cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestoreClusterRequest request =
+   *       RestoreClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.restoreClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + restoreClusterOperationCallable() { + return stub.restoreClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and location, with a volume restored from the provided + * source, either a backup ID or a point-in-time and a source cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestoreClusterRequest request =
+   *       RestoreClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.restoreClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable restoreClusterCallable() { + return stub.restoreClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster of type SECONDARY in the given location using the primary cluster as the + * source. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response =
+   *       alloyDBAdminClient.createSecondaryClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource (the primary cluster). For the required + * format, see the comment on the Cluster.name field. + * @param cluster Required. Configuration of the requesting object (the secondary cluster). + * @param clusterId Required. ID of the requesting object (the secondary cluster). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryClusterAsync( + LocationName parent, Cluster cluster, String clusterId) { + CreateSecondaryClusterRequest request = + CreateSecondaryClusterRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setCluster(cluster) + .setClusterId(clusterId) + .build(); + return createSecondaryClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster of type SECONDARY in the given location using the primary cluster as the + * source. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response =
+   *       alloyDBAdminClient.createSecondaryClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource (the primary cluster). For the required + * format, see the comment on the Cluster.name field. + * @param cluster Required. Configuration of the requesting object (the secondary cluster). + * @param clusterId Required. ID of the requesting object (the secondary cluster). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryClusterAsync( + String parent, Cluster cluster, String clusterId) { + CreateSecondaryClusterRequest request = + CreateSecondaryClusterRequest.newBuilder() + .setParent(parent) + .setCluster(cluster) + .setClusterId(clusterId) + .build(); + return createSecondaryClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster of type SECONDARY in the given location using the primary cluster as the + * source. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryClusterRequest request =
+   *       CreateSecondaryClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.createSecondaryClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryClusterAsync( + CreateSecondaryClusterRequest request) { + return createSecondaryClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster of type SECONDARY in the given location using the primary cluster as the + * source. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryClusterRequest request =
+   *       CreateSecondaryClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.createSecondaryClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createSecondaryClusterOperationCallable() { + return stub.createSecondaryClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster of type SECONDARY in the given location using the primary cluster as the + * source. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryClusterRequest request =
+   *       CreateSecondaryClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.createSecondaryClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createSecondaryClusterCallable() { + return stub.createSecondaryClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   for (Instance element : alloyDBAdminClient.listInstances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an aggregated list + * operation by specifying a value with one of the following formats: * + * projects/{project}/locations/-/clusters/- * + * projects/{project}/locations/{region}/clusters/- + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(ClusterName parent) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   for (Instance element : alloyDBAdminClient.listInstances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an aggregated list + * operation by specifying a value with one of the following formats: * + * projects/{project}/locations/-/clusters/- * + * projects/{project}/locations/{region}/clusters/- + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(String parent) { + ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Instance element : alloyDBAdminClient.listInstances(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 ListInstancesPagedResponse listInstances(ListInstancesRequest request) { + return listInstancesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.listInstancesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Instance element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listInstancesPagedCallable() { + return stub.listInstancesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListInstancesResponse response = alloyDBAdminClient.listInstancesCallable().call(request);
+   *     for (Instance element : response.getInstancesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listInstancesCallable() { + return stub.listInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   Instance response = alloyDBAdminClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(InstanceName name) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   Instance response = alloyDBAdminClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(String name) { + GetInstanceRequest request = GetInstanceRequest.newBuilder().setName(name).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setView(InstanceView.forNumber(0))
+   *           .build();
+   *   Instance response = alloyDBAdminClient.getInstance(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 Instance getInstance(GetInstanceRequest request) { + return getInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setView(InstanceView.forNumber(0))
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.getInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getInstanceCallable() { + return stub.getInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       alloyDBAdminClient.createInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param instance Required. The resource being created + * @param instanceId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + ClusterName parent, Instance instance, String instanceId) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       alloyDBAdminClient.createInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param instance Required. The resource being created + * @param instanceId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + String parent, Instance instance, String instanceId) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.createInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + CreateInstanceRequest request) { + return createInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.createInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createInstanceOperationCallable() { + return stub.createInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.createInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createInstanceCallable() { + return stub.createInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new SECONDARY Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       alloyDBAdminClient.createSecondaryInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param instance Required. The resource being created + * @param instanceId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryInstanceAsync( + ClusterName parent, Instance instance, String instanceId) { + CreateSecondaryInstanceRequest request = + CreateSecondaryInstanceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createSecondaryInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new SECONDARY Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       alloyDBAdminClient.createSecondaryInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param instance Required. The resource being created + * @param instanceId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryInstanceAsync( + String parent, Instance instance, String instanceId) { + CreateSecondaryInstanceRequest request = + CreateSecondaryInstanceRequest.newBuilder() + .setParent(parent) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createSecondaryInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new SECONDARY Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryInstanceRequest request =
+   *       CreateSecondaryInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.createSecondaryInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryInstanceAsync( + CreateSecondaryInstanceRequest request) { + return createSecondaryInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new SECONDARY Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryInstanceRequest request =
+   *       CreateSecondaryInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.createSecondaryInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createSecondaryInstanceOperationCallable() { + return stub.createSecondaryInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new SECONDARY Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryInstanceRequest request =
+   *       CreateSecondaryInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.createSecondaryInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createSecondaryInstanceCallable() { + return stub.createSecondaryInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates new instances under the given project, location and cluster. There can be only one + * primary instance in a cluster. If the primary instance exists in the cluster as well as this + * request, then API will throw an error. The primary instance should exist before any read pool + * instance is created. If the primary instance is a part of the request payload, then the API + * will take care of creating instances in the correct order. This method is here to support + * Google-internal use cases, and is not meant for external customers to consume. Please do not + * start relying on it; its behavior is subject to change without notice. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BatchCreateInstancesRequest request =
+   *       BatchCreateInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequests(CreateInstanceRequests.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   BatchCreateInstancesResponse response =
+   *       alloyDBAdminClient.batchCreateInstancesAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + batchCreateInstancesAsync(BatchCreateInstancesRequest request) { + return batchCreateInstancesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates new instances under the given project, location and cluster. There can be only one + * primary instance in a cluster. If the primary instance exists in the cluster as well as this + * request, then API will throw an error. The primary instance should exist before any read pool + * instance is created. If the primary instance is a part of the request payload, then the API + * will take care of creating instances in the correct order. This method is here to support + * Google-internal use cases, and is not meant for external customers to consume. Please do not + * start relying on it; its behavior is subject to change without notice. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BatchCreateInstancesRequest request =
+   *       BatchCreateInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequests(CreateInstanceRequests.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.batchCreateInstancesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   BatchCreateInstancesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable() { + return stub.batchCreateInstancesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates new instances under the given project, location and cluster. There can be only one + * primary instance in a cluster. If the primary instance exists in the cluster as well as this + * request, then API will throw an error. The primary instance should exist before any read pool + * instance is created. If the primary instance is a part of the request payload, then the API + * will take care of creating instances in the correct order. This method is here to support + * Google-internal use cases, and is not meant for external customers to consume. Please do not + * start relying on it; its behavior is subject to change without notice. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BatchCreateInstancesRequest request =
+   *       BatchCreateInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequests(CreateInstanceRequests.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.batchCreateInstancesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + batchCreateInstancesCallable() { + return stub.batchCreateInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   Instance instance = Instance.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Instance response = alloyDBAdminClient.updateInstanceAsync(instance, updateMask).get();
+   * }
+   * }
+ * + * @param instance Required. The resource being updated + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. The fields specified in the update_mask are relative to + * the resource, not the full request. A field will be overwritten if it is in the mask. If + * the user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateInstanceAsync( + Instance instance, FieldMask updateMask) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder().setInstance(instance).setUpdateMask(updateMask).build(); + return updateInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.updateInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateInstanceAsync( + UpdateInstanceRequest request) { + return updateInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.updateInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateInstanceOperationCallable() { + return stub.updateInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.updateInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateInstanceCallable() { + return stub.updateInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   alloyDBAdminClient.deleteInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteInstanceAsync(InstanceName name) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   alloyDBAdminClient.deleteInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteInstanceAsync(String name) { + DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   alloyDBAdminClient.deleteInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteInstanceAsync( + DeleteInstanceRequest request) { + return deleteInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.deleteInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteInstanceOperationCallable() { + return stub.deleteInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.deleteInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteInstanceCallable() { + return stub.deleteInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Forces a Failover for a highly available instance. Failover promotes the HA standby instance as + * the new primary. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   Instance response = alloyDBAdminClient.failoverInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture failoverInstanceAsync( + InstanceName name) { + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return failoverInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Forces a Failover for a highly available instance. Failover promotes the HA standby instance as + * the new primary. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   Instance response = alloyDBAdminClient.failoverInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture failoverInstanceAsync(String name) { + FailoverInstanceRequest request = FailoverInstanceRequest.newBuilder().setName(name).build(); + return failoverInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Forces a Failover for a highly available instance. Failover promotes the HA standby instance as + * the new primary. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   FailoverInstanceRequest request =
+   *       FailoverInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.failoverInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture failoverInstanceAsync( + FailoverInstanceRequest request) { + return failoverInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Forces a Failover for a highly available instance. Failover promotes the HA standby instance as + * the new primary. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   FailoverInstanceRequest request =
+   *       FailoverInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.failoverInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + failoverInstanceOperationCallable() { + return stub.failoverInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Forces a Failover for a highly available instance. Failover promotes the HA standby instance as + * the new primary. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   FailoverInstanceRequest request =
+   *       FailoverInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.failoverInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable failoverInstanceCallable() { + return stub.failoverInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   Instance response = alloyDBAdminClient.restartInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture restartInstanceAsync( + InstanceName name) { + RestartInstanceRequest request = + RestartInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return restartInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   Instance response = alloyDBAdminClient.restartInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture restartInstanceAsync(String name) { + RestartInstanceRequest request = RestartInstanceRequest.newBuilder().setName(name).build(); + return restartInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestartInstanceRequest request =
+   *       RestartInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.restartInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture restartInstanceAsync( + RestartInstanceRequest request) { + return restartInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestartInstanceRequest request =
+   *       RestartInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.restartInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + restartInstanceOperationCallable() { + return stub.restartInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestartInstanceRequest request =
+   *       RestartInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.restartInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable restartInstanceCallable() { + return stub.restartInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListBackupsRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(LocationName parent) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListBackupsRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(String parent) { + ListBackupsRequest request = ListBackupsRequest.newBuilder().setParent(parent).build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Backup element : alloyDBAdminClient.listBackups(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 ListBackupsPagedResponse listBackups(ListBackupsRequest request) { + return listBackupsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.listBackupsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Backup element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listBackupsPagedCallable() { + return stub.listBackupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListBackupsResponse response = alloyDBAdminClient.listBackupsCallable().call(request);
+   *     for (Backup element : response.getBackupsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listBackupsCallable() { + return stub.listBackupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]");
+   *   Backup response = alloyDBAdminClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(BackupName name) { + GetBackupRequest request = + GetBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString();
+   *   Backup response = alloyDBAdminClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(String name) { + GetBackupRequest request = GetBackupRequest.newBuilder().setName(name).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   Backup response = alloyDBAdminClient.getBackup(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 Backup getBackup(GetBackupRequest request) { + return getBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.getBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getBackupCallable() { + return stub.getBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Backup in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Backup backup = Backup.newBuilder().build();
+   *   String backupId = "backupId2121930365";
+   *   Backup response = alloyDBAdminClient.createBackupAsync(parent, backup, backupId).get();
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param backup Required. The resource being created + * @param backupId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createBackupAsync( + LocationName parent, Backup backup, String backupId) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBackup(backup) + .setBackupId(backupId) + .build(); + return createBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Backup in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Backup backup = Backup.newBuilder().build();
+   *   String backupId = "backupId2121930365";
+   *   Backup response = alloyDBAdminClient.createBackupAsync(parent, backup, backupId).get();
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param backup Required. The resource being created + * @param backupId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createBackupAsync( + String parent, Backup backup, String backupId) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(parent) + .setBackup(backup) + .setBackupId(backupId) + .build(); + return createBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Backup in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBackupId("backupId2121930365")
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Backup response = alloyDBAdminClient.createBackupAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createBackupAsync( + CreateBackupRequest request) { + return createBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Backup in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBackupId("backupId2121930365")
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.createBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createBackupOperationCallable() { + return stub.createBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Backup in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBackupId("backupId2121930365")
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.createBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createBackupCallable() { + return stub.createBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   Backup backup = Backup.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Backup response = alloyDBAdminClient.updateBackupAsync(backup, updateMask).get();
+   * }
+   * }
+ * + * @param backup Required. The resource being updated + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. The fields specified in the update_mask are relative to the + * resource, not the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateBackupAsync( + Backup backup, FieldMask updateMask) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder().setBackup(backup).setUpdateMask(updateMask).build(); + return updateBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   Backup response = alloyDBAdminClient.updateBackupAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateBackupAsync( + UpdateBackupRequest request) { + return updateBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.updateBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateBackupOperationCallable() { + return stub.updateBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.updateBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateBackupCallable() { + return stub.updateBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]");
+   *   alloyDBAdminClient.deleteBackupAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. For the required format, see the comment on the + * Backup.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteBackupAsync(BackupName name) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString();
+   *   alloyDBAdminClient.deleteBackupAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. For the required format, see the comment on the + * Backup.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteBackupAsync(String name) { + DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name).build(); + return deleteBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   alloyDBAdminClient.deleteBackupAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteBackupAsync( + DeleteBackupRequest request) { + return deleteBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.deleteBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteBackupOperationCallable() { + return stub.deleteBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.deleteBackupCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteBackupCallable() { + return stub.deleteBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (SupportedDatabaseFlag element :
+   *       alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. The required format is: * + * projects/{project}/locations/{location} + *

Regardless of the parent specified here, as long it is contains a valid project and + * location, the service will return a static list of supported flags resources. Note that we + * do not yet support region-specific flags. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags( + LocationName parent) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listSupportedDatabaseFlags(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (SupportedDatabaseFlag element :
+   *       alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. The required format is: * + * projects/{project}/locations/{location} + *

Regardless of the parent specified here, as long it is contains a valid project and + * location, the service will return a static list of supported flags resources. Note that we + * do not yet support region-specific flags. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags(String parent) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder().setParent(parent).build(); + return listSupportedDatabaseFlags(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListSupportedDatabaseFlagsRequest request =
+   *       ListSupportedDatabaseFlagsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (SupportedDatabaseFlag element :
+   *       alloyDBAdminClient.listSupportedDatabaseFlags(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 ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags( + ListSupportedDatabaseFlagsRequest request) { + return listSupportedDatabaseFlagsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListSupportedDatabaseFlagsRequest request =
+   *       ListSupportedDatabaseFlagsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.listSupportedDatabaseFlagsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (SupportedDatabaseFlag element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsPagedCallable() { + return stub.listSupportedDatabaseFlagsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListSupportedDatabaseFlagsRequest request =
+   *       ListSupportedDatabaseFlagsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListSupportedDatabaseFlagsResponse response =
+   *         alloyDBAdminClient.listSupportedDatabaseFlagsCallable().call(request);
+   *     for (SupportedDatabaseFlag element : response.getSupportedDatabaseFlagsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listSupportedDatabaseFlagsCallable() { + return stub.listSupportedDatabaseFlagsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to + * support the Auth Proxy client and the endpoint's behavior is subject to change without notice, + * so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy + * client. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   GenerateClientCertificateResponse response =
+   *       alloyDBAdminClient.generateClientCertificate(parent);
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. The required format is: * + * projects/{project}/locations/{location}/clusters/{cluster} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateClientCertificateResponse generateClientCertificate(ClusterName parent) { + GenerateClientCertificateRequest request = + GenerateClientCertificateRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return generateClientCertificate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to + * support the Auth Proxy client and the endpoint's behavior is subject to change without notice, + * so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy + * client. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   GenerateClientCertificateResponse response =
+   *       alloyDBAdminClient.generateClientCertificate(parent);
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. The required format is: * + * projects/{project}/locations/{location}/clusters/{cluster} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateClientCertificateResponse generateClientCertificate(String parent) { + GenerateClientCertificateRequest request = + GenerateClientCertificateRequest.newBuilder().setParent(parent).build(); + return generateClientCertificate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to + * support the Auth Proxy client and the endpoint's behavior is subject to change without notice, + * so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy + * client. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GenerateClientCertificateRequest request =
+   *       GenerateClientCertificateRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setPemCsr("pemCsr-991911478")
+   *           .setCertDuration(Duration.newBuilder().build())
+   *           .build();
+   *   GenerateClientCertificateResponse response =
+   *       alloyDBAdminClient.generateClientCertificate(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 GenerateClientCertificateResponse generateClientCertificate( + GenerateClientCertificateRequest request) { + return generateClientCertificateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to + * support the Auth Proxy client and the endpoint's behavior is subject to change without notice, + * so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy + * client. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GenerateClientCertificateRequest request =
+   *       GenerateClientCertificateRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setPemCsr("pemCsr-991911478")
+   *           .setCertDuration(Duration.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.generateClientCertificateCallable().futureCall(request);
+   *   // Do something.
+   *   GenerateClientCertificateResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + generateClientCertificateCallable() { + return stub.generateClientCertificateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get instance metadata used for a connection. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   ConnectionInfo response = alloyDBAdminClient.getConnectionInfo(parent);
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ConnectionInfo getConnectionInfo(InstanceName parent) { + GetConnectionInfoRequest request = + GetConnectionInfoRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return getConnectionInfo(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get instance metadata used for a connection. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   ConnectionInfo response = alloyDBAdminClient.getConnectionInfo(parent);
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ConnectionInfo getConnectionInfo(String parent) { + GetConnectionInfoRequest request = + GetConnectionInfoRequest.newBuilder().setParent(parent).build(); + return getConnectionInfo(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get instance metadata used for a connection. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetConnectionInfoRequest request =
+   *       GetConnectionInfoRequest.newBuilder()
+   *           .setParent(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ConnectionInfo response = alloyDBAdminClient.getConnectionInfo(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 ConnectionInfo getConnectionInfo(GetConnectionInfoRequest request) { + return getConnectionInfoCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get instance metadata used for a connection. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetConnectionInfoRequest request =
+   *       GetConnectionInfoRequest.newBuilder()
+   *           .setParent(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.getConnectionInfoCallable().futureCall(request);
+   *   // Do something.
+   *   ConnectionInfo response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getConnectionInfoCallable() { + return stub.getConnectionInfoCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : alloyDBAdminClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = alloyDBAdminClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = alloyDBAdminClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = alloyDBAdminClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @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 ListClustersPagedResponse + extends AbstractPagedListResponse< + ListClustersRequest, + ListClustersResponse, + Cluster, + ListClustersPage, + ListClustersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListClustersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListClustersPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListClustersPagedResponse(ListClustersPage page) { + super(page, ListClustersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListClustersPage + extends AbstractPage { + + private ListClustersPage( + PageContext context, + ListClustersResponse response) { + super(context, response); + } + + private static ListClustersPage createEmptyPage() { + return new ListClustersPage(null, null); + } + + @Override + protected ListClustersPage createPage( + PageContext context, + ListClustersResponse response) { + return new ListClustersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListClustersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListClustersRequest, + ListClustersResponse, + Cluster, + ListClustersPage, + ListClustersFixedSizeCollection> { + + private ListClustersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListClustersFixedSizeCollection createEmptyCollection() { + return new ListClustersFixedSizeCollection(null, 0); + } + + @Override + protected ListClustersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListClustersFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListInstancesPagedResponse + extends AbstractPagedListResponse< + ListInstancesRequest, + ListInstancesResponse, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListInstancesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListInstancesPagedResponse(ListInstancesPage page) { + super(page, ListInstancesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListInstancesPage + extends AbstractPage< + ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage> { + + private ListInstancesPage( + PageContext context, + ListInstancesResponse response) { + super(context, response); + } + + private static ListInstancesPage createEmptyPage() { + return new ListInstancesPage(null, null); + } + + @Override + protected ListInstancesPage createPage( + PageContext context, + ListInstancesResponse response) { + return new ListInstancesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListInstancesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstancesRequest, + ListInstancesResponse, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + private ListInstancesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInstancesFixedSizeCollection createEmptyCollection() { + return new ListInstancesFixedSizeCollection(null, 0); + } + + @Override + protected ListInstancesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInstancesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListBackupsPagedResponse + extends AbstractPagedListResponse< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBackupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListBackupsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListBackupsPagedResponse(ListBackupsPage page) { + super(page, ListBackupsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBackupsPage + extends AbstractPage { + + private ListBackupsPage( + PageContext context, + ListBackupsResponse response) { + super(context, response); + } + + private static ListBackupsPage createEmptyPage() { + return new ListBackupsPage(null, null); + } + + @Override + protected ListBackupsPage createPage( + PageContext context, + ListBackupsResponse response) { + return new ListBackupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBackupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + private ListBackupsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBackupsFixedSizeCollection createEmptyCollection() { + return new ListBackupsFixedSizeCollection(null, 0); + } + + @Override + protected ListBackupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBackupsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListSupportedDatabaseFlagsPagedResponse + extends AbstractPagedListResponse< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag, + ListSupportedDatabaseFlagsPage, + ListSupportedDatabaseFlagsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSupportedDatabaseFlagsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSupportedDatabaseFlagsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSupportedDatabaseFlagsPagedResponse(ListSupportedDatabaseFlagsPage page) { + super(page, ListSupportedDatabaseFlagsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSupportedDatabaseFlagsPage + extends AbstractPage< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag, + ListSupportedDatabaseFlagsPage> { + + private ListSupportedDatabaseFlagsPage( + PageContext< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + context, + ListSupportedDatabaseFlagsResponse response) { + super(context, response); + } + + private static ListSupportedDatabaseFlagsPage createEmptyPage() { + return new ListSupportedDatabaseFlagsPage(null, null); + } + + @Override + protected ListSupportedDatabaseFlagsPage createPage( + PageContext< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + context, + ListSupportedDatabaseFlagsResponse response) { + return new ListSupportedDatabaseFlagsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSupportedDatabaseFlagsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag, + ListSupportedDatabaseFlagsPage, + ListSupportedDatabaseFlagsFixedSizeCollection> { + + private ListSupportedDatabaseFlagsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSupportedDatabaseFlagsFixedSizeCollection createEmptyCollection() { + return new ListSupportedDatabaseFlagsFixedSizeCollection(null, 0); + } + + @Override + protected ListSupportedDatabaseFlagsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSupportedDatabaseFlagsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminSettings.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminSettings.java new file mode 100644 index 000000000000..cf3e6767d07b --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminSettings.java @@ -0,0 +1,705 @@ +/* + * 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.alloydb.v1alpha; + +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +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.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.alloydb.v1alpha.stub.AlloyDBAdminStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.Operation; +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 AlloyDBAdminClient}. + * + *

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

    + *
  • The default service address (alloydb.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 getCluster 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
+ * AlloyDBAdminSettings.Builder alloyDBAdminSettingsBuilder = AlloyDBAdminSettings.newBuilder();
+ * alloyDBAdminSettingsBuilder
+ *     .getClusterSettings()
+ *     .setRetrySettings(
+ *         alloyDBAdminSettingsBuilder
+ *             .getClusterSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AlloyDBAdminSettings alloyDBAdminSettings = alloyDBAdminSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class AlloyDBAdminSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listClusters. */ + public PagedCallSettings + listClustersSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listClustersSettings(); + } + + /** Returns the object with the settings used for calls to getCluster. */ + public UnaryCallSettings getClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getClusterSettings(); + } + + /** Returns the object with the settings used for calls to createCluster. */ + public UnaryCallSettings createClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createClusterSettings(); + } + + /** Returns the object with the settings used for calls to createCluster. */ + public OperationCallSettings + createClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public UnaryCallSettings updateClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateClusterSettings(); + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public OperationCallSettings + updateClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public UnaryCallSettings deleteClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteClusterSettings(); + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public OperationCallSettings + deleteClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to promoteCluster. */ + public UnaryCallSettings promoteClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).promoteClusterSettings(); + } + + /** Returns the object with the settings used for calls to promoteCluster. */ + public OperationCallSettings + promoteClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).promoteClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to restoreCluster. */ + public UnaryCallSettings restoreClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).restoreClusterSettings(); + } + + /** Returns the object with the settings used for calls to restoreCluster. */ + public OperationCallSettings + restoreClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).restoreClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to createSecondaryCluster. */ + public UnaryCallSettings + createSecondaryClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createSecondaryClusterSettings(); + } + + /** Returns the object with the settings used for calls to createSecondaryCluster. */ + public OperationCallSettings + createSecondaryClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createSecondaryClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listInstancesSettings(); + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to createSecondaryInstance. */ + public UnaryCallSettings + createSecondaryInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createSecondaryInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createSecondaryInstance. */ + public OperationCallSettings + createSecondaryInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()) + .createSecondaryInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to batchCreateInstances. */ + public UnaryCallSettings batchCreateInstancesSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).batchCreateInstancesSettings(); + } + + /** Returns the object with the settings used for calls to batchCreateInstances. */ + public OperationCallSettings< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).batchCreateInstancesOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateInstanceSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public OperationCallSettings + updateInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteInstanceSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public OperationCallSettings + deleteInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to failoverInstance. */ + public UnaryCallSettings failoverInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).failoverInstanceSettings(); + } + + /** Returns the object with the settings used for calls to failoverInstance. */ + public OperationCallSettings + failoverInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).failoverInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to restartInstance. */ + public UnaryCallSettings restartInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).restartInstanceSettings(); + } + + /** Returns the object with the settings used for calls to restartInstance. */ + public OperationCallSettings + restartInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).restartInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listBackupsSettings(); + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getBackupSettings(); + } + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createBackupSettings(); + } + + /** Returns the object with the settings used for calls to createBackup. */ + public OperationCallSettings + createBackupOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateBackupSettings(); + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public OperationCallSettings + updateBackupOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteBackupSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public OperationCallSettings + deleteBackupOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to listSupportedDatabaseFlags. */ + public PagedCallSettings< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listSupportedDatabaseFlagsSettings(); + } + + /** Returns the object with the settings used for calls to generateClientCertificate. */ + public UnaryCallSettings + generateClientCertificateSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).generateClientCertificateSettings(); + } + + /** Returns the object with the settings used for calls to getConnectionInfo. */ + public UnaryCallSettings getConnectionInfoSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getConnectionInfoSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final AlloyDBAdminSettings create(AlloyDBAdminStubSettings stub) + throws IOException { + return new AlloyDBAdminSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AlloyDBAdminStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AlloyDBAdminStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AlloyDBAdminStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AlloyDBAdminStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AlloyDBAdminStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return AlloyDBAdminStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AlloyDBAdminStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AlloyDBAdminStubSettings.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 AlloyDBAdminSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AlloyDBAdminSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(AlloyDBAdminStubSettings.newBuilder(clientContext)); + } + + protected Builder(AlloyDBAdminSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AlloyDBAdminStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(AlloyDBAdminStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(AlloyDBAdminStubSettings.newHttpJsonBuilder()); + } + + public AlloyDBAdminStubSettings.Builder getStubSettingsBuilder() { + return ((AlloyDBAdminStubSettings.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 listClusters. */ + public PagedCallSettings.Builder< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings() { + return getStubSettingsBuilder().listClustersSettings(); + } + + /** Returns the builder for the settings used for calls to getCluster. */ + public UnaryCallSettings.Builder getClusterSettings() { + return getStubSettingsBuilder().getClusterSettings(); + } + + /** Returns the builder for the settings used for calls to createCluster. */ + public UnaryCallSettings.Builder createClusterSettings() { + return getStubSettingsBuilder().createClusterSettings(); + } + + /** Returns the builder for the settings used for calls to createCluster. */ + public OperationCallSettings.Builder + createClusterOperationSettings() { + return getStubSettingsBuilder().createClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + public UnaryCallSettings.Builder updateClusterSettings() { + return getStubSettingsBuilder().updateClusterSettings(); + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + public OperationCallSettings.Builder + updateClusterOperationSettings() { + return getStubSettingsBuilder().updateClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteCluster. */ + public UnaryCallSettings.Builder deleteClusterSettings() { + return getStubSettingsBuilder().deleteClusterSettings(); + } + + /** Returns the builder for the settings used for calls to deleteCluster. */ + public OperationCallSettings.Builder + deleteClusterOperationSettings() { + return getStubSettingsBuilder().deleteClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to promoteCluster. */ + public UnaryCallSettings.Builder promoteClusterSettings() { + return getStubSettingsBuilder().promoteClusterSettings(); + } + + /** Returns the builder for the settings used for calls to promoteCluster. */ + public OperationCallSettings.Builder + promoteClusterOperationSettings() { + return getStubSettingsBuilder().promoteClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to restoreCluster. */ + public UnaryCallSettings.Builder restoreClusterSettings() { + return getStubSettingsBuilder().restoreClusterSettings(); + } + + /** Returns the builder for the settings used for calls to restoreCluster. */ + public OperationCallSettings.Builder + restoreClusterOperationSettings() { + return getStubSettingsBuilder().restoreClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to createSecondaryCluster. */ + public UnaryCallSettings.Builder + createSecondaryClusterSettings() { + return getStubSettingsBuilder().createSecondaryClusterSettings(); + } + + /** Returns the builder for the settings used for calls to createSecondaryCluster. */ + public OperationCallSettings.Builder + createSecondaryClusterOperationSettings() { + return getStubSettingsBuilder().createSecondaryClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return getStubSettingsBuilder().listInstancesSettings(); + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getStubSettingsBuilder().getInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return getStubSettingsBuilder().createInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return getStubSettingsBuilder().createInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to createSecondaryInstance. */ + public UnaryCallSettings.Builder + createSecondaryInstanceSettings() { + return getStubSettingsBuilder().createSecondaryInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createSecondaryInstance. */ + public OperationCallSettings.Builder< + CreateSecondaryInstanceRequest, Instance, OperationMetadata> + createSecondaryInstanceOperationSettings() { + return getStubSettingsBuilder().createSecondaryInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to batchCreateInstances. */ + public UnaryCallSettings.Builder + batchCreateInstancesSettings() { + return getStubSettingsBuilder().batchCreateInstancesSettings(); + } + + /** Returns the builder for the settings used for calls to batchCreateInstances. */ + public OperationCallSettings.Builder< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings() { + return getStubSettingsBuilder().batchCreateInstancesOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return getStubSettingsBuilder().updateInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return getStubSettingsBuilder().updateInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return getStubSettingsBuilder().deleteInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return getStubSettingsBuilder().deleteInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to failoverInstance. */ + public UnaryCallSettings.Builder + failoverInstanceSettings() { + return getStubSettingsBuilder().failoverInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to failoverInstance. */ + public OperationCallSettings.Builder + failoverInstanceOperationSettings() { + return getStubSettingsBuilder().failoverInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to restartInstance. */ + public UnaryCallSettings.Builder restartInstanceSettings() { + return getStubSettingsBuilder().restartInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to restartInstance. */ + public OperationCallSettings.Builder + restartInstanceOperationSettings() { + return getStubSettingsBuilder().restartInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return getStubSettingsBuilder().listBackupsSettings(); + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getStubSettingsBuilder().getBackupSettings(); + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return getStubSettingsBuilder().createBackupSettings(); + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public OperationCallSettings.Builder + createBackupOperationSettings() { + return getStubSettingsBuilder().createBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return getStubSettingsBuilder().updateBackupSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public OperationCallSettings.Builder + updateBackupOperationSettings() { + return getStubSettingsBuilder().updateBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return getStubSettingsBuilder().deleteBackupSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public OperationCallSettings.Builder + deleteBackupOperationSettings() { + return getStubSettingsBuilder().deleteBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listSupportedDatabaseFlags. */ + public PagedCallSettings.Builder< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings() { + return getStubSettingsBuilder().listSupportedDatabaseFlagsSettings(); + } + + /** Returns the builder for the settings used for calls to generateClientCertificate. */ + public UnaryCallSettings.Builder< + GenerateClientCertificateRequest, GenerateClientCertificateResponse> + generateClientCertificateSettings() { + return getStubSettingsBuilder().generateClientCertificateSettings(); + } + + /** Returns the builder for the settings used for calls to getConnectionInfo. */ + public UnaryCallSettings.Builder + getConnectionInfoSettings() { + return getStubSettingsBuilder().getConnectionInfoSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public AlloyDBAdminSettings build() throws IOException { + return new AlloyDBAdminSettings(this); + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/gapic_metadata.json b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/gapic_metadata.json new file mode 100644 index 000000000000..4754f2d844cc --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/gapic_metadata.json @@ -0,0 +1,99 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.alloydb.v1alpha", + "libraryPackage": "com.google.cloud.alloydb.v1alpha", + "services": { + "AlloyDBAdmin": { + "clients": { + "grpc": { + "libraryClient": "AlloyDBAdminClient", + "rpcs": { + "BatchCreateInstances": { + "methods": ["batchCreateInstancesAsync", "batchCreateInstancesOperationCallable", "batchCreateInstancesCallable"] + }, + "CreateBackup": { + "methods": ["createBackupAsync", "createBackupAsync", "createBackupAsync", "createBackupOperationCallable", "createBackupCallable"] + }, + "CreateCluster": { + "methods": ["createClusterAsync", "createClusterAsync", "createClusterAsync", "createClusterOperationCallable", "createClusterCallable"] + }, + "CreateInstance": { + "methods": ["createInstanceAsync", "createInstanceAsync", "createInstanceAsync", "createInstanceOperationCallable", "createInstanceCallable"] + }, + "CreateSecondaryCluster": { + "methods": ["createSecondaryClusterAsync", "createSecondaryClusterAsync", "createSecondaryClusterAsync", "createSecondaryClusterOperationCallable", "createSecondaryClusterCallable"] + }, + "CreateSecondaryInstance": { + "methods": ["createSecondaryInstanceAsync", "createSecondaryInstanceAsync", "createSecondaryInstanceAsync", "createSecondaryInstanceOperationCallable", "createSecondaryInstanceCallable"] + }, + "DeleteBackup": { + "methods": ["deleteBackupAsync", "deleteBackupAsync", "deleteBackupAsync", "deleteBackupOperationCallable", "deleteBackupCallable"] + }, + "DeleteCluster": { + "methods": ["deleteClusterAsync", "deleteClusterAsync", "deleteClusterAsync", "deleteClusterOperationCallable", "deleteClusterCallable"] + }, + "DeleteInstance": { + "methods": ["deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceOperationCallable", "deleteInstanceCallable"] + }, + "FailoverInstance": { + "methods": ["failoverInstanceAsync", "failoverInstanceAsync", "failoverInstanceAsync", "failoverInstanceOperationCallable", "failoverInstanceCallable"] + }, + "GenerateClientCertificate": { + "methods": ["generateClientCertificate", "generateClientCertificate", "generateClientCertificate", "generateClientCertificateCallable"] + }, + "GetBackup": { + "methods": ["getBackup", "getBackup", "getBackup", "getBackupCallable"] + }, + "GetCluster": { + "methods": ["getCluster", "getCluster", "getCluster", "getClusterCallable"] + }, + "GetConnectionInfo": { + "methods": ["getConnectionInfo", "getConnectionInfo", "getConnectionInfo", "getConnectionInfoCallable"] + }, + "GetInstance": { + "methods": ["getInstance", "getInstance", "getInstance", "getInstanceCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListBackups": { + "methods": ["listBackups", "listBackups", "listBackups", "listBackupsPagedCallable", "listBackupsCallable"] + }, + "ListClusters": { + "methods": ["listClusters", "listClusters", "listClusters", "listClustersPagedCallable", "listClustersCallable"] + }, + "ListInstances": { + "methods": ["listInstances", "listInstances", "listInstances", "listInstancesPagedCallable", "listInstancesCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListSupportedDatabaseFlags": { + "methods": ["listSupportedDatabaseFlags", "listSupportedDatabaseFlags", "listSupportedDatabaseFlags", "listSupportedDatabaseFlagsPagedCallable", "listSupportedDatabaseFlagsCallable"] + }, + "PromoteCluster": { + "methods": ["promoteClusterAsync", "promoteClusterAsync", "promoteClusterAsync", "promoteClusterOperationCallable", "promoteClusterCallable"] + }, + "RestartInstance": { + "methods": ["restartInstanceAsync", "restartInstanceAsync", "restartInstanceAsync", "restartInstanceOperationCallable", "restartInstanceCallable"] + }, + "RestoreCluster": { + "methods": ["restoreClusterAsync", "restoreClusterOperationCallable", "restoreClusterCallable"] + }, + "UpdateBackup": { + "methods": ["updateBackupAsync", "updateBackupAsync", "updateBackupOperationCallable", "updateBackupCallable"] + }, + "UpdateCluster": { + "methods": ["updateClusterAsync", "updateClusterAsync", "updateClusterOperationCallable", "updateClusterCallable"] + }, + "UpdateInstance": { + "methods": ["updateInstanceAsync", "updateInstanceAsync", "updateInstanceOperationCallable", "updateInstanceCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/package-info.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/package-info.java new file mode 100644 index 000000000000..922ae16603fb --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/package-info.java @@ -0,0 +1,43 @@ +/* + * 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 AlloyDB API + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================= AlloyDBAdminClient ======================= + * + *

Service Description: Service describing handlers for resources + * + *

Sample for AlloyDBAdminClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+ *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+ *   Cluster response = alloyDBAdminClient.getCluster(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.alloydb.v1alpha; + +import javax.annotation.Generated; diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/AlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/AlloyDBAdminStub.java new file mode 100644 index 000000000000..eb8dcd2395f2 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/AlloyDBAdminStub.java @@ -0,0 +1,314 @@ +/* + * 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.alloydb.v1alpha.stub; + +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.ConnectionInfo; +import com.google.cloud.alloydb.v1alpha.CreateBackupRequest; +import com.google.cloud.alloydb.v1alpha.CreateClusterRequest; +import com.google.cloud.alloydb.v1alpha.CreateInstanceRequest; +import com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1alpha.DeleteBackupRequest; +import com.google.cloud.alloydb.v1alpha.DeleteClusterRequest; +import com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; +import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; +import com.google.cloud.alloydb.v1alpha.GetBackupRequest; +import com.google.cloud.alloydb.v1alpha.GetClusterRequest; +import com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; +import com.google.cloud.alloydb.v1alpha.GetInstanceRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.ListBackupsRequest; +import com.google.cloud.alloydb.v1alpha.ListBackupsResponse; +import com.google.cloud.alloydb.v1alpha.ListClustersRequest; +import com.google.cloud.alloydb.v1alpha.ListClustersResponse; +import com.google.cloud.alloydb.v1alpha.ListInstancesRequest; +import com.google.cloud.alloydb.v1alpha.ListInstancesResponse; +import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; +import com.google.cloud.alloydb.v1alpha.PromoteClusterRequest; +import com.google.cloud.alloydb.v1alpha.RestartInstanceRequest; +import com.google.cloud.alloydb.v1alpha.RestoreClusterRequest; +import com.google.cloud.alloydb.v1alpha.UpdateBackupRequest; +import com.google.cloud.alloydb.v1alpha.UpdateClusterRequest; +import com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the AlloyDBAdmin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class AlloyDBAdminStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable listClustersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listClustersPagedCallable()"); + } + + public UnaryCallable listClustersCallable() { + throw new UnsupportedOperationException("Not implemented: listClustersCallable()"); + } + + public UnaryCallable getClusterCallable() { + throw new UnsupportedOperationException("Not implemented: getClusterCallable()"); + } + + public OperationCallable + createClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createClusterOperationCallable()"); + } + + public UnaryCallable createClusterCallable() { + throw new UnsupportedOperationException("Not implemented: createClusterCallable()"); + } + + public OperationCallable + updateClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateClusterOperationCallable()"); + } + + public UnaryCallable updateClusterCallable() { + throw new UnsupportedOperationException("Not implemented: updateClusterCallable()"); + } + + public OperationCallable + deleteClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteClusterOperationCallable()"); + } + + public UnaryCallable deleteClusterCallable() { + throw new UnsupportedOperationException("Not implemented: deleteClusterCallable()"); + } + + public OperationCallable + promoteClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: promoteClusterOperationCallable()"); + } + + public UnaryCallable promoteClusterCallable() { + throw new UnsupportedOperationException("Not implemented: promoteClusterCallable()"); + } + + public OperationCallable + restoreClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: restoreClusterOperationCallable()"); + } + + public UnaryCallable restoreClusterCallable() { + throw new UnsupportedOperationException("Not implemented: restoreClusterCallable()"); + } + + public OperationCallable + createSecondaryClusterOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createSecondaryClusterOperationCallable()"); + } + + public UnaryCallable createSecondaryClusterCallable() { + throw new UnsupportedOperationException("Not implemented: createSecondaryClusterCallable()"); + } + + public UnaryCallable + listInstancesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesPagedCallable()"); + } + + public UnaryCallable listInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesCallable()"); + } + + public UnaryCallable getInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: getInstanceCallable()"); + } + + public OperationCallable + createInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceOperationCallable()"); + } + + public UnaryCallable createInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceCallable()"); + } + + public OperationCallable + createSecondaryInstanceOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createSecondaryInstanceOperationCallable()"); + } + + public UnaryCallable + createSecondaryInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: createSecondaryInstanceCallable()"); + } + + public OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: batchCreateInstancesOperationCallable()"); + } + + public UnaryCallable batchCreateInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: batchCreateInstancesCallable()"); + } + + public OperationCallable + updateInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceOperationCallable()"); + } + + public UnaryCallable updateInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceCallable()"); + } + + public OperationCallable + deleteInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceOperationCallable()"); + } + + public UnaryCallable deleteInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceCallable()"); + } + + public OperationCallable + failoverInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: failoverInstanceOperationCallable()"); + } + + public UnaryCallable failoverInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: failoverInstanceCallable()"); + } + + public OperationCallable + restartInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: restartInstanceOperationCallable()"); + } + + public UnaryCallable restartInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: restartInstanceCallable()"); + } + + public UnaryCallable listBackupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsPagedCallable()"); + } + + public UnaryCallable listBackupsCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsCallable()"); + } + + public UnaryCallable getBackupCallable() { + throw new UnsupportedOperationException("Not implemented: getBackupCallable()"); + } + + public OperationCallable + createBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupOperationCallable()"); + } + + public UnaryCallable createBackupCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupCallable()"); + } + + public OperationCallable + updateBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupOperationCallable()"); + } + + public UnaryCallable updateBackupCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupCallable()"); + } + + public OperationCallable + deleteBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupOperationCallable()"); + } + + public UnaryCallable deleteBackupCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupCallable()"); + } + + public UnaryCallable + listSupportedDatabaseFlagsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listSupportedDatabaseFlagsPagedCallable()"); + } + + public UnaryCallable + listSupportedDatabaseFlagsCallable() { + throw new UnsupportedOperationException( + "Not implemented: listSupportedDatabaseFlagsCallable()"); + } + + public UnaryCallable + generateClientCertificateCallable() { + throw new UnsupportedOperationException("Not implemented: generateClientCertificateCallable()"); + } + + public UnaryCallable getConnectionInfoCallable() { + throw new UnsupportedOperationException("Not implemented: getConnectionInfoCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/AlloyDBAdminStubSettings.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/AlloyDBAdminStubSettings.java new file mode 100644 index 000000000000..46e59da115d8 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/AlloyDBAdminStubSettings.java @@ -0,0 +1,2066 @@ +/* + * 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.alloydb.v1alpha.stub; + +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +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.grpc.ProtoOperationTransformers; +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.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.ConnectionInfo; +import com.google.cloud.alloydb.v1alpha.CreateBackupRequest; +import com.google.cloud.alloydb.v1alpha.CreateClusterRequest; +import com.google.cloud.alloydb.v1alpha.CreateInstanceRequest; +import com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1alpha.DeleteBackupRequest; +import com.google.cloud.alloydb.v1alpha.DeleteClusterRequest; +import com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; +import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; +import com.google.cloud.alloydb.v1alpha.GetBackupRequest; +import com.google.cloud.alloydb.v1alpha.GetClusterRequest; +import com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; +import com.google.cloud.alloydb.v1alpha.GetInstanceRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.ListBackupsRequest; +import com.google.cloud.alloydb.v1alpha.ListBackupsResponse; +import com.google.cloud.alloydb.v1alpha.ListClustersRequest; +import com.google.cloud.alloydb.v1alpha.ListClustersResponse; +import com.google.cloud.alloydb.v1alpha.ListInstancesRequest; +import com.google.cloud.alloydb.v1alpha.ListInstancesResponse; +import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; +import com.google.cloud.alloydb.v1alpha.PromoteClusterRequest; +import com.google.cloud.alloydb.v1alpha.RestartInstanceRequest; +import com.google.cloud.alloydb.v1alpha.RestoreClusterRequest; +import com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; +import com.google.cloud.alloydb.v1alpha.UpdateBackupRequest; +import com.google.cloud.alloydb.v1alpha.UpdateClusterRequest; +import com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import 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 AlloyDBAdminStub}. + * + *

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

    + *
  • The default service address (alloydb.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 getCluster 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
+ * AlloyDBAdminStubSettings.Builder alloyDBAdminSettingsBuilder =
+ *     AlloyDBAdminStubSettings.newBuilder();
+ * alloyDBAdminSettingsBuilder
+ *     .getClusterSettings()
+ *     .setRetrySettings(
+ *         alloyDBAdminSettingsBuilder
+ *             .getClusterSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AlloyDBAdminStubSettings alloyDBAdminSettings = alloyDBAdminSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class AlloyDBAdminStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings; + private final UnaryCallSettings getClusterSettings; + private final UnaryCallSettings createClusterSettings; + private final OperationCallSettings + createClusterOperationSettings; + private final UnaryCallSettings updateClusterSettings; + private final OperationCallSettings + updateClusterOperationSettings; + private final UnaryCallSettings deleteClusterSettings; + private final OperationCallSettings + deleteClusterOperationSettings; + private final UnaryCallSettings promoteClusterSettings; + private final OperationCallSettings + promoteClusterOperationSettings; + private final UnaryCallSettings restoreClusterSettings; + private final OperationCallSettings + restoreClusterOperationSettings; + private final UnaryCallSettings + createSecondaryClusterSettings; + private final OperationCallSettings + createSecondaryClusterOperationSettings; + private final PagedCallSettings< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings getInstanceSettings; + private final UnaryCallSettings createInstanceSettings; + private final OperationCallSettings + createInstanceOperationSettings; + private final UnaryCallSettings + createSecondaryInstanceSettings; + private final OperationCallSettings + createSecondaryInstanceOperationSettings; + private final UnaryCallSettings + batchCreateInstancesSettings; + private final OperationCallSettings< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings; + private final UnaryCallSettings updateInstanceSettings; + private final OperationCallSettings + updateInstanceOperationSettings; + private final UnaryCallSettings deleteInstanceSettings; + private final OperationCallSettings + deleteInstanceOperationSettings; + private final UnaryCallSettings failoverInstanceSettings; + private final OperationCallSettings + failoverInstanceOperationSettings; + private final UnaryCallSettings restartInstanceSettings; + private final OperationCallSettings + restartInstanceOperationSettings; + private final PagedCallSettings + listBackupsSettings; + private final UnaryCallSettings getBackupSettings; + private final UnaryCallSettings createBackupSettings; + private final OperationCallSettings + createBackupOperationSettings; + private final UnaryCallSettings updateBackupSettings; + private final OperationCallSettings + updateBackupOperationSettings; + private final UnaryCallSettings deleteBackupSettings; + private final OperationCallSettings + deleteBackupOperationSettings; + private final PagedCallSettings< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings; + private final UnaryCallSettings< + GenerateClientCertificateRequest, GenerateClientCertificateResponse> + generateClientCertificateSettings; + private final UnaryCallSettings + getConnectionInfoSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor + LIST_CLUSTERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListClustersRequest injectToken(ListClustersRequest payload, String token) { + return ListClustersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListClustersRequest injectPageSize(ListClustersRequest payload, int pageSize) { + return ListClustersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListClustersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListClustersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListClustersResponse payload) { + return payload.getClustersList() == null + ? ImmutableList.of() + : payload.getClustersList(); + } + }; + + private static final PagedListDescriptor + LIST_INSTANCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListInstancesRequest injectToken(ListInstancesRequest payload, String token) { + return ListInstancesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListInstancesRequest injectPageSize(ListInstancesRequest payload, int pageSize) { + return ListInstancesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListInstancesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListInstancesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListInstancesResponse payload) { + return payload.getInstancesList() == null + ? ImmutableList.of() + : payload.getInstancesList(); + } + }; + + private static final PagedListDescriptor + LIST_BACKUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBackupsRequest injectToken(ListBackupsRequest payload, String token) { + return ListBackupsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBackupsRequest injectPageSize(ListBackupsRequest payload, int pageSize) { + return ListBackupsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBackupsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBackupsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBackupsResponse payload) { + return payload.getBackupsList() == null + ? ImmutableList.of() + : payload.getBackupsList(); + } + }; + + private static final PagedListDescriptor< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_DESC = + new PagedListDescriptor< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSupportedDatabaseFlagsRequest injectToken( + ListSupportedDatabaseFlagsRequest payload, String token) { + return ListSupportedDatabaseFlagsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListSupportedDatabaseFlagsRequest injectPageSize( + ListSupportedDatabaseFlagsRequest payload, int pageSize) { + return ListSupportedDatabaseFlagsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListSupportedDatabaseFlagsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSupportedDatabaseFlagsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListSupportedDatabaseFlagsResponse payload) { + return payload.getSupportedDatabaseFlagsList() == null + ? ImmutableList.of() + : payload.getSupportedDatabaseFlagsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + LIST_CLUSTERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListClustersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CLUSTERS_PAGE_STR_DESC, request, context); + return ListClustersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + LIST_INSTANCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInstancesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INSTANCES_PAGE_STR_DESC, request, context); + return ListInstancesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + LIST_BACKUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBackupsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BACKUPS_PAGE_STR_DESC, request, context); + return ListBackupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListSupportedDatabaseFlagsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + pageContext = + PageContext.create( + callable, LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_DESC, request, context); + return ListSupportedDatabaseFlagsPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listClusters. */ + public PagedCallSettings + listClustersSettings() { + return listClustersSettings; + } + + /** Returns the object with the settings used for calls to getCluster. */ + public UnaryCallSettings getClusterSettings() { + return getClusterSettings; + } + + /** Returns the object with the settings used for calls to createCluster. */ + public UnaryCallSettings createClusterSettings() { + return createClusterSettings; + } + + /** Returns the object with the settings used for calls to createCluster. */ + public OperationCallSettings + createClusterOperationSettings() { + return createClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public UnaryCallSettings updateClusterSettings() { + return updateClusterSettings; + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public OperationCallSettings + updateClusterOperationSettings() { + return updateClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public UnaryCallSettings deleteClusterSettings() { + return deleteClusterSettings; + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public OperationCallSettings + deleteClusterOperationSettings() { + return deleteClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to promoteCluster. */ + public UnaryCallSettings promoteClusterSettings() { + return promoteClusterSettings; + } + + /** Returns the object with the settings used for calls to promoteCluster. */ + public OperationCallSettings + promoteClusterOperationSettings() { + return promoteClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to restoreCluster. */ + public UnaryCallSettings restoreClusterSettings() { + return restoreClusterSettings; + } + + /** Returns the object with the settings used for calls to restoreCluster. */ + public OperationCallSettings + restoreClusterOperationSettings() { + return restoreClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to createSecondaryCluster. */ + public UnaryCallSettings + createSecondaryClusterSettings() { + return createSecondaryClusterSettings; + } + + /** Returns the object with the settings used for calls to createSecondaryCluster. */ + public OperationCallSettings + createSecondaryClusterOperationSettings() { + return createSecondaryClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to createSecondaryInstance. */ + public UnaryCallSettings + createSecondaryInstanceSettings() { + return createSecondaryInstanceSettings; + } + + /** Returns the object with the settings used for calls to createSecondaryInstance. */ + public OperationCallSettings + createSecondaryInstanceOperationSettings() { + return createSecondaryInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to batchCreateInstances. */ + public UnaryCallSettings batchCreateInstancesSettings() { + return batchCreateInstancesSettings; + } + + /** Returns the object with the settings used for calls to batchCreateInstances. */ + public OperationCallSettings< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings() { + return batchCreateInstancesOperationSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public OperationCallSettings + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public OperationCallSettings + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to failoverInstance. */ + public UnaryCallSettings failoverInstanceSettings() { + return failoverInstanceSettings; + } + + /** Returns the object with the settings used for calls to failoverInstance. */ + public OperationCallSettings + failoverInstanceOperationSettings() { + return failoverInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to restartInstance. */ + public UnaryCallSettings restartInstanceSettings() { + return restartInstanceSettings; + } + + /** Returns the object with the settings used for calls to restartInstance. */ + public OperationCallSettings + restartInstanceOperationSettings() { + return restartInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return getBackupSettings; + } + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return createBackupSettings; + } + + /** Returns the object with the settings used for calls to createBackup. */ + public OperationCallSettings + createBackupOperationSettings() { + return createBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public OperationCallSettings + updateBackupOperationSettings() { + return updateBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return deleteBackupSettings; + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public OperationCallSettings + deleteBackupOperationSettings() { + return deleteBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to listSupportedDatabaseFlags. */ + public PagedCallSettings< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings() { + return listSupportedDatabaseFlagsSettings; + } + + /** Returns the object with the settings used for calls to generateClientCertificate. */ + public UnaryCallSettings + generateClientCertificateSettings() { + return generateClientCertificateSettings; + } + + /** Returns the object with the settings used for calls to getConnectionInfo. */ + public UnaryCallSettings getConnectionInfoSettings() { + return getConnectionInfoSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public AlloyDBAdminStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAlloyDBAdminStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonAlloyDBAdminStub.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 "alloydb.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "alloydb.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(AlloyDBAdminStubSettings.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(AlloyDBAdminStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AlloyDBAdminStubSettings.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 AlloyDBAdminStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listClustersSettings = settingsBuilder.listClustersSettings().build(); + getClusterSettings = settingsBuilder.getClusterSettings().build(); + createClusterSettings = settingsBuilder.createClusterSettings().build(); + createClusterOperationSettings = settingsBuilder.createClusterOperationSettings().build(); + updateClusterSettings = settingsBuilder.updateClusterSettings().build(); + updateClusterOperationSettings = settingsBuilder.updateClusterOperationSettings().build(); + deleteClusterSettings = settingsBuilder.deleteClusterSettings().build(); + deleteClusterOperationSettings = settingsBuilder.deleteClusterOperationSettings().build(); + promoteClusterSettings = settingsBuilder.promoteClusterSettings().build(); + promoteClusterOperationSettings = settingsBuilder.promoteClusterOperationSettings().build(); + restoreClusterSettings = settingsBuilder.restoreClusterSettings().build(); + restoreClusterOperationSettings = settingsBuilder.restoreClusterOperationSettings().build(); + createSecondaryClusterSettings = settingsBuilder.createSecondaryClusterSettings().build(); + createSecondaryClusterOperationSettings = + settingsBuilder.createSecondaryClusterOperationSettings().build(); + listInstancesSettings = settingsBuilder.listInstancesSettings().build(); + getInstanceSettings = settingsBuilder.getInstanceSettings().build(); + createInstanceSettings = settingsBuilder.createInstanceSettings().build(); + createInstanceOperationSettings = settingsBuilder.createInstanceOperationSettings().build(); + createSecondaryInstanceSettings = settingsBuilder.createSecondaryInstanceSettings().build(); + createSecondaryInstanceOperationSettings = + settingsBuilder.createSecondaryInstanceOperationSettings().build(); + batchCreateInstancesSettings = settingsBuilder.batchCreateInstancesSettings().build(); + batchCreateInstancesOperationSettings = + settingsBuilder.batchCreateInstancesOperationSettings().build(); + updateInstanceSettings = settingsBuilder.updateInstanceSettings().build(); + updateInstanceOperationSettings = settingsBuilder.updateInstanceOperationSettings().build(); + deleteInstanceSettings = settingsBuilder.deleteInstanceSettings().build(); + deleteInstanceOperationSettings = settingsBuilder.deleteInstanceOperationSettings().build(); + failoverInstanceSettings = settingsBuilder.failoverInstanceSettings().build(); + failoverInstanceOperationSettings = settingsBuilder.failoverInstanceOperationSettings().build(); + restartInstanceSettings = settingsBuilder.restartInstanceSettings().build(); + restartInstanceOperationSettings = settingsBuilder.restartInstanceOperationSettings().build(); + listBackupsSettings = settingsBuilder.listBackupsSettings().build(); + getBackupSettings = settingsBuilder.getBackupSettings().build(); + createBackupSettings = settingsBuilder.createBackupSettings().build(); + createBackupOperationSettings = settingsBuilder.createBackupOperationSettings().build(); + updateBackupSettings = settingsBuilder.updateBackupSettings().build(); + updateBackupOperationSettings = settingsBuilder.updateBackupOperationSettings().build(); + deleteBackupSettings = settingsBuilder.deleteBackupSettings().build(); + deleteBackupOperationSettings = settingsBuilder.deleteBackupOperationSettings().build(); + listSupportedDatabaseFlagsSettings = + settingsBuilder.listSupportedDatabaseFlagsSettings().build(); + generateClientCertificateSettings = settingsBuilder.generateClientCertificateSettings().build(); + getConnectionInfoSettings = settingsBuilder.getConnectionInfoSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for AlloyDBAdminStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings; + private final UnaryCallSettings.Builder getClusterSettings; + private final UnaryCallSettings.Builder createClusterSettings; + private final OperationCallSettings.Builder + createClusterOperationSettings; + private final UnaryCallSettings.Builder updateClusterSettings; + private final OperationCallSettings.Builder + updateClusterOperationSettings; + private final UnaryCallSettings.Builder deleteClusterSettings; + private final OperationCallSettings.Builder + deleteClusterOperationSettings; + private final UnaryCallSettings.Builder + promoteClusterSettings; + private final OperationCallSettings.Builder + promoteClusterOperationSettings; + private final UnaryCallSettings.Builder + restoreClusterSettings; + private final OperationCallSettings.Builder + restoreClusterOperationSettings; + private final UnaryCallSettings.Builder + createSecondaryClusterSettings; + private final OperationCallSettings.Builder< + CreateSecondaryClusterRequest, Cluster, OperationMetadata> + createSecondaryClusterOperationSettings; + private final PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings.Builder getInstanceSettings; + private final UnaryCallSettings.Builder + createInstanceSettings; + private final OperationCallSettings.Builder + createInstanceOperationSettings; + private final UnaryCallSettings.Builder + createSecondaryInstanceSettings; + private final OperationCallSettings.Builder< + CreateSecondaryInstanceRequest, Instance, OperationMetadata> + createSecondaryInstanceOperationSettings; + private final UnaryCallSettings.Builder + batchCreateInstancesSettings; + private final OperationCallSettings.Builder< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings; + private final UnaryCallSettings.Builder + updateInstanceSettings; + private final OperationCallSettings.Builder + updateInstanceOperationSettings; + private final UnaryCallSettings.Builder + deleteInstanceSettings; + private final OperationCallSettings.Builder + deleteInstanceOperationSettings; + private final UnaryCallSettings.Builder + failoverInstanceSettings; + private final OperationCallSettings.Builder< + FailoverInstanceRequest, Instance, OperationMetadata> + failoverInstanceOperationSettings; + private final UnaryCallSettings.Builder + restartInstanceSettings; + private final OperationCallSettings.Builder + restartInstanceOperationSettings; + private final PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings; + private final UnaryCallSettings.Builder getBackupSettings; + private final UnaryCallSettings.Builder createBackupSettings; + private final OperationCallSettings.Builder + createBackupOperationSettings; + private final UnaryCallSettings.Builder updateBackupSettings; + private final OperationCallSettings.Builder + updateBackupOperationSettings; + private final UnaryCallSettings.Builder deleteBackupSettings; + private final OperationCallSettings.Builder + deleteBackupOperationSettings; + private final PagedCallSettings.Builder< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings; + private final UnaryCallSettings.Builder< + GenerateClientCertificateRequest, GenerateClientCertificateResponse> + generateClientCertificateSettings; + private final UnaryCallSettings.Builder + getConnectionInfoSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + 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() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + 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); + + listClustersSettings = PagedCallSettings.newBuilder(LIST_CLUSTERS_PAGE_STR_FACT); + getClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createClusterOperationSettings = OperationCallSettings.newBuilder(); + updateClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateClusterOperationSettings = OperationCallSettings.newBuilder(); + deleteClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteClusterOperationSettings = OperationCallSettings.newBuilder(); + promoteClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + promoteClusterOperationSettings = OperationCallSettings.newBuilder(); + restoreClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restoreClusterOperationSettings = OperationCallSettings.newBuilder(); + createSecondaryClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSecondaryClusterOperationSettings = OperationCallSettings.newBuilder(); + listInstancesSettings = PagedCallSettings.newBuilder(LIST_INSTANCES_PAGE_STR_FACT); + getInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createInstanceOperationSettings = OperationCallSettings.newBuilder(); + createSecondaryInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSecondaryInstanceOperationSettings = OperationCallSettings.newBuilder(); + batchCreateInstancesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + batchCreateInstancesOperationSettings = OperationCallSettings.newBuilder(); + updateInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateInstanceOperationSettings = OperationCallSettings.newBuilder(); + deleteInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteInstanceOperationSettings = OperationCallSettings.newBuilder(); + failoverInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + failoverInstanceOperationSettings = OperationCallSettings.newBuilder(); + restartInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restartInstanceOperationSettings = OperationCallSettings.newBuilder(); + listBackupsSettings = PagedCallSettings.newBuilder(LIST_BACKUPS_PAGE_STR_FACT); + getBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createBackupOperationSettings = OperationCallSettings.newBuilder(); + updateBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateBackupOperationSettings = OperationCallSettings.newBuilder(); + deleteBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBackupOperationSettings = OperationCallSettings.newBuilder(); + listSupportedDatabaseFlagsSettings = + PagedCallSettings.newBuilder(LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_FACT); + generateClientCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getConnectionInfoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listClustersSettings, + getClusterSettings, + createClusterSettings, + updateClusterSettings, + deleteClusterSettings, + promoteClusterSettings, + restoreClusterSettings, + createSecondaryClusterSettings, + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + createSecondaryInstanceSettings, + batchCreateInstancesSettings, + updateInstanceSettings, + deleteInstanceSettings, + failoverInstanceSettings, + restartInstanceSettings, + listBackupsSettings, + getBackupSettings, + createBackupSettings, + updateBackupSettings, + deleteBackupSettings, + listSupportedDatabaseFlagsSettings, + generateClientCertificateSettings, + getConnectionInfoSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(AlloyDBAdminStubSettings settings) { + super(settings); + + listClustersSettings = settings.listClustersSettings.toBuilder(); + getClusterSettings = settings.getClusterSettings.toBuilder(); + createClusterSettings = settings.createClusterSettings.toBuilder(); + createClusterOperationSettings = settings.createClusterOperationSettings.toBuilder(); + updateClusterSettings = settings.updateClusterSettings.toBuilder(); + updateClusterOperationSettings = settings.updateClusterOperationSettings.toBuilder(); + deleteClusterSettings = settings.deleteClusterSettings.toBuilder(); + deleteClusterOperationSettings = settings.deleteClusterOperationSettings.toBuilder(); + promoteClusterSettings = settings.promoteClusterSettings.toBuilder(); + promoteClusterOperationSettings = settings.promoteClusterOperationSettings.toBuilder(); + restoreClusterSettings = settings.restoreClusterSettings.toBuilder(); + restoreClusterOperationSettings = settings.restoreClusterOperationSettings.toBuilder(); + createSecondaryClusterSettings = settings.createSecondaryClusterSettings.toBuilder(); + createSecondaryClusterOperationSettings = + settings.createSecondaryClusterOperationSettings.toBuilder(); + listInstancesSettings = settings.listInstancesSettings.toBuilder(); + getInstanceSettings = settings.getInstanceSettings.toBuilder(); + createInstanceSettings = settings.createInstanceSettings.toBuilder(); + createInstanceOperationSettings = settings.createInstanceOperationSettings.toBuilder(); + createSecondaryInstanceSettings = settings.createSecondaryInstanceSettings.toBuilder(); + createSecondaryInstanceOperationSettings = + settings.createSecondaryInstanceOperationSettings.toBuilder(); + batchCreateInstancesSettings = settings.batchCreateInstancesSettings.toBuilder(); + batchCreateInstancesOperationSettings = + settings.batchCreateInstancesOperationSettings.toBuilder(); + updateInstanceSettings = settings.updateInstanceSettings.toBuilder(); + updateInstanceOperationSettings = settings.updateInstanceOperationSettings.toBuilder(); + deleteInstanceSettings = settings.deleteInstanceSettings.toBuilder(); + deleteInstanceOperationSettings = settings.deleteInstanceOperationSettings.toBuilder(); + failoverInstanceSettings = settings.failoverInstanceSettings.toBuilder(); + failoverInstanceOperationSettings = settings.failoverInstanceOperationSettings.toBuilder(); + restartInstanceSettings = settings.restartInstanceSettings.toBuilder(); + restartInstanceOperationSettings = settings.restartInstanceOperationSettings.toBuilder(); + listBackupsSettings = settings.listBackupsSettings.toBuilder(); + getBackupSettings = settings.getBackupSettings.toBuilder(); + createBackupSettings = settings.createBackupSettings.toBuilder(); + createBackupOperationSettings = settings.createBackupOperationSettings.toBuilder(); + updateBackupSettings = settings.updateBackupSettings.toBuilder(); + updateBackupOperationSettings = settings.updateBackupOperationSettings.toBuilder(); + deleteBackupSettings = settings.deleteBackupSettings.toBuilder(); + deleteBackupOperationSettings = settings.deleteBackupOperationSettings.toBuilder(); + listSupportedDatabaseFlagsSettings = settings.listSupportedDatabaseFlagsSettings.toBuilder(); + generateClientCertificateSettings = settings.generateClientCertificateSettings.toBuilder(); + getConnectionInfoSettings = settings.getConnectionInfoSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listClustersSettings, + getClusterSettings, + createClusterSettings, + updateClusterSettings, + deleteClusterSettings, + promoteClusterSettings, + restoreClusterSettings, + createSecondaryClusterSettings, + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + createSecondaryInstanceSettings, + batchCreateInstancesSettings, + updateInstanceSettings, + deleteInstanceSettings, + failoverInstanceSettings, + restartInstanceSettings, + listBackupsSettings, + getBackupSettings, + createBackupSettings, + updateBackupSettings, + deleteBackupSettings, + listSupportedDatabaseFlagsSettings, + generateClientCertificateSettings, + getConnectionInfoSettings, + listLocationsSettings, + getLocationSettings); + } + + 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 + .listClustersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .promoteClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .restoreClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createSecondaryClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createSecondaryInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .batchCreateInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .failoverInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .restartInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listBackupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listSupportedDatabaseFlagsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .generateClientCertificateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getConnectionInfoSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .promoteClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .restoreClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createSecondaryClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createSecondaryInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .batchCreateInstancesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + BatchCreateInstancesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .failoverInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .restartInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createBackupOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Backup.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateBackupOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Backup.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteBackupOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * 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 listClusters. */ + public PagedCallSettings.Builder< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings() { + return listClustersSettings; + } + + /** Returns the builder for the settings used for calls to getCluster. */ + public UnaryCallSettings.Builder getClusterSettings() { + return getClusterSettings; + } + + /** Returns the builder for the settings used for calls to createCluster. */ + public UnaryCallSettings.Builder createClusterSettings() { + return createClusterSettings; + } + + /** Returns the builder for the settings used for calls to createCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createClusterOperationSettings() { + return createClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + public UnaryCallSettings.Builder updateClusterSettings() { + return updateClusterSettings; + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateClusterOperationSettings() { + return updateClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteCluster. */ + public UnaryCallSettings.Builder deleteClusterSettings() { + return deleteClusterSettings; + } + + /** Returns the builder for the settings used for calls to deleteCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteClusterOperationSettings() { + return deleteClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to promoteCluster. */ + public UnaryCallSettings.Builder promoteClusterSettings() { + return promoteClusterSettings; + } + + /** Returns the builder for the settings used for calls to promoteCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + promoteClusterOperationSettings() { + return promoteClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to restoreCluster. */ + public UnaryCallSettings.Builder restoreClusterSettings() { + return restoreClusterSettings; + } + + /** Returns the builder for the settings used for calls to restoreCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + restoreClusterOperationSettings() { + return restoreClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to createSecondaryCluster. */ + public UnaryCallSettings.Builder + createSecondaryClusterSettings() { + return createSecondaryClusterSettings; + } + + /** Returns the builder for the settings used for calls to createSecondaryCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createSecondaryClusterOperationSettings() { + return createSecondaryClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to createSecondaryInstance. */ + public UnaryCallSettings.Builder + createSecondaryInstanceSettings() { + return createSecondaryInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createSecondaryInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateSecondaryInstanceRequest, Instance, OperationMetadata> + createSecondaryInstanceOperationSettings() { + return createSecondaryInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to batchCreateInstances. */ + public UnaryCallSettings.Builder + batchCreateInstancesSettings() { + return batchCreateInstancesSettings; + } + + /** Returns the builder for the settings used for calls to batchCreateInstances. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings() { + return batchCreateInstancesOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to failoverInstance. */ + public UnaryCallSettings.Builder + failoverInstanceSettings() { + return failoverInstanceSettings; + } + + /** Returns the builder for the settings used for calls to failoverInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + failoverInstanceOperationSettings() { + return failoverInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to restartInstance. */ + public UnaryCallSettings.Builder restartInstanceSettings() { + return restartInstanceSettings; + } + + /** Returns the builder for the settings used for calls to restartInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + restartInstanceOperationSettings() { + return restartInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getBackupSettings; + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return createBackupSettings; + } + + /** Returns the builder for the settings used for calls to createBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createBackupOperationSettings() { + return createBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateBackupOperationSettings() { + return updateBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return deleteBackupSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteBackupOperationSettings() { + return deleteBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to listSupportedDatabaseFlags. */ + public PagedCallSettings.Builder< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings() { + return listSupportedDatabaseFlagsSettings; + } + + /** Returns the builder for the settings used for calls to generateClientCertificate. */ + public UnaryCallSettings.Builder< + GenerateClientCertificateRequest, GenerateClientCertificateResponse> + generateClientCertificateSettings() { + return generateClientCertificateSettings; + } + + /** Returns the builder for the settings used for calls to getConnectionInfo. */ + public UnaryCallSettings.Builder + getConnectionInfoSettings() { + return getConnectionInfoSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + @Override + public AlloyDBAdminStubSettings build() throws IOException { + return new AlloyDBAdminStubSettings(this); + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/GrpcAlloyDBAdminCallableFactory.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/GrpcAlloyDBAdminCallableFactory.java new file mode 100644 index 000000000000..3ae48639d381 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/GrpcAlloyDBAdminCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.alloydb.v1alpha.stub; + +import com.google.api.core.BetaApi; +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 AlloyDBAdmin service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcAlloyDBAdminCallableFactory 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-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/GrpcAlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/GrpcAlloyDBAdminStub.java new file mode 100644 index 000000000000..da20e26d8fde --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/GrpcAlloyDBAdminStub.java @@ -0,0 +1,1270 @@ +/* + * 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.alloydb.v1alpha.stub; + +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.ConnectionInfo; +import com.google.cloud.alloydb.v1alpha.CreateBackupRequest; +import com.google.cloud.alloydb.v1alpha.CreateClusterRequest; +import com.google.cloud.alloydb.v1alpha.CreateInstanceRequest; +import com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1alpha.DeleteBackupRequest; +import com.google.cloud.alloydb.v1alpha.DeleteClusterRequest; +import com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; +import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; +import com.google.cloud.alloydb.v1alpha.GetBackupRequest; +import com.google.cloud.alloydb.v1alpha.GetClusterRequest; +import com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; +import com.google.cloud.alloydb.v1alpha.GetInstanceRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.ListBackupsRequest; +import com.google.cloud.alloydb.v1alpha.ListBackupsResponse; +import com.google.cloud.alloydb.v1alpha.ListClustersRequest; +import com.google.cloud.alloydb.v1alpha.ListClustersResponse; +import com.google.cloud.alloydb.v1alpha.ListInstancesRequest; +import com.google.cloud.alloydb.v1alpha.ListInstancesResponse; +import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; +import com.google.cloud.alloydb.v1alpha.PromoteClusterRequest; +import com.google.cloud.alloydb.v1alpha.RestartInstanceRequest; +import com.google.cloud.alloydb.v1alpha.RestoreClusterRequest; +import com.google.cloud.alloydb.v1alpha.UpdateBackupRequest; +import com.google.cloud.alloydb.v1alpha.UpdateClusterRequest; +import com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +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 AlloyDBAdmin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { + private static final MethodDescriptor + listClustersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListClusters") + .setRequestMarshaller(ProtoUtils.marshaller(ListClustersRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListClustersResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetCluster") + .setRequestMarshaller(ProtoUtils.marshaller(GetClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Cluster.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/CreateCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/UpdateCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/DeleteCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + promoteClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/PromoteCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(PromoteClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + restoreClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/RestoreCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(RestoreClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createSecondaryClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/CreateSecondaryCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSecondaryClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listInstancesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListInstances") + .setRequestMarshaller( + ProtoUtils.marshaller(ListInstancesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListInstancesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetInstance") + .setRequestMarshaller(ProtoUtils.marshaller(GetInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Instance.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/CreateInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createSecondaryInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.alloydb.v1alpha.AlloyDBAdmin/CreateSecondaryInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSecondaryInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + batchCreateInstancesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/BatchCreateInstances") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchCreateInstancesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/UpdateInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/DeleteInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + failoverInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/FailoverInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(FailoverInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + restartInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/RestartInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(RestartInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listBackupsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListBackups") + .setRequestMarshaller(ProtoUtils.marshaller(ListBackupsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListBackupsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetBackup") + .setRequestMarshaller(ProtoUtils.marshaller(GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Backup.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/CreateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/UpdateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/DeleteBackup") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsResponse> + listSupportedDatabaseFlagsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListSupportedDatabaseFlags") + .setRequestMarshaller( + ProtoUtils.marshaller(ListSupportedDatabaseFlagsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSupportedDatabaseFlagsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + GenerateClientCertificateRequest, GenerateClientCertificateResponse> + generateClientCertificateMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.alloydb.v1alpha.AlloyDBAdmin/GenerateClientCertificate") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateClientCertificateRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateClientCertificateResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getConnectionInfoMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetConnectionInfo") + .setRequestMarshaller( + ProtoUtils.marshaller(GetConnectionInfoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ConnectionInfo.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private final UnaryCallable listClustersCallable; + private final UnaryCallable + listClustersPagedCallable; + private final UnaryCallable getClusterCallable; + private final UnaryCallable createClusterCallable; + private final OperationCallable + createClusterOperationCallable; + private final UnaryCallable updateClusterCallable; + private final OperationCallable + updateClusterOperationCallable; + private final UnaryCallable deleteClusterCallable; + private final OperationCallable + deleteClusterOperationCallable; + private final UnaryCallable promoteClusterCallable; + private final OperationCallable + promoteClusterOperationCallable; + private final UnaryCallable restoreClusterCallable; + private final OperationCallable + restoreClusterOperationCallable; + private final UnaryCallable + createSecondaryClusterCallable; + private final OperationCallable + createSecondaryClusterOperationCallable; + private final UnaryCallable listInstancesCallable; + private final UnaryCallable + listInstancesPagedCallable; + private final UnaryCallable getInstanceCallable; + private final UnaryCallable createInstanceCallable; + private final OperationCallable + createInstanceOperationCallable; + private final UnaryCallable + createSecondaryInstanceCallable; + private final OperationCallable + createSecondaryInstanceOperationCallable; + private final UnaryCallable batchCreateInstancesCallable; + private final OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable; + private final UnaryCallable updateInstanceCallable; + private final OperationCallable + updateInstanceOperationCallable; + private final UnaryCallable deleteInstanceCallable; + private final OperationCallable + deleteInstanceOperationCallable; + private final UnaryCallable failoverInstanceCallable; + private final OperationCallable + failoverInstanceOperationCallable; + private final UnaryCallable restartInstanceCallable; + private final OperationCallable + restartInstanceOperationCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable + listBackupsPagedCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable createBackupCallable; + private final OperationCallable + createBackupOperationCallable; + private final UnaryCallable updateBackupCallable; + private final OperationCallable + updateBackupOperationCallable; + private final UnaryCallable deleteBackupCallable; + private final OperationCallable + deleteBackupOperationCallable; + private final UnaryCallable + listSupportedDatabaseFlagsCallable; + private final UnaryCallable< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsPagedCallable; + private final UnaryCallable + generateClientCertificateCallable; + private final UnaryCallable getConnectionInfoCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAlloyDBAdminStub create(AlloyDBAdminStubSettings settings) + throws IOException { + return new GrpcAlloyDBAdminStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAlloyDBAdminStub create(ClientContext clientContext) throws IOException { + return new GrpcAlloyDBAdminStub(AlloyDBAdminStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAlloyDBAdminStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAlloyDBAdminStub( + AlloyDBAdminStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAlloyDBAdminStub, 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 GrpcAlloyDBAdminStub(AlloyDBAdminStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcAlloyDBAdminCallableFactory()); + } + + /** + * Constructs an instance of GrpcAlloyDBAdminStub, 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 GrpcAlloyDBAdminStub( + AlloyDBAdminStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listClustersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listClustersMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("cluster.name", String.valueOf(request.getCluster().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings promoteClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(promoteClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings restoreClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restoreClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + createSecondaryClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSecondaryClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings listInstancesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listInstancesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + createSecondaryInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSecondaryInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings batchCreateInstancesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchCreateInstancesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("instance.name", String.valueOf(request.getInstance().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings failoverInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(failoverInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings restartInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restartInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listBackupsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBackupMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBackupMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("backup.name", String.valueOf(request.getBackup().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listSupportedDatabaseFlagsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listSupportedDatabaseFlagsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + generateClientCertificateTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(generateClientCertificateMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getConnectionInfoTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getConnectionInfoMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + + this.listClustersCallable = + callableFactory.createUnaryCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.listClustersPagedCallable = + callableFactory.createPagedCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.getClusterCallable = + callableFactory.createUnaryCallable( + getClusterTransportSettings, settings.getClusterSettings(), clientContext); + this.createClusterCallable = + callableFactory.createUnaryCallable( + createClusterTransportSettings, settings.createClusterSettings(), clientContext); + this.createClusterOperationCallable = + callableFactory.createOperationCallable( + createClusterTransportSettings, + settings.createClusterOperationSettings(), + clientContext, + operationsStub); + this.updateClusterCallable = + callableFactory.createUnaryCallable( + updateClusterTransportSettings, settings.updateClusterSettings(), clientContext); + this.updateClusterOperationCallable = + callableFactory.createOperationCallable( + updateClusterTransportSettings, + settings.updateClusterOperationSettings(), + clientContext, + operationsStub); + this.deleteClusterCallable = + callableFactory.createUnaryCallable( + deleteClusterTransportSettings, settings.deleteClusterSettings(), clientContext); + this.deleteClusterOperationCallable = + callableFactory.createOperationCallable( + deleteClusterTransportSettings, + settings.deleteClusterOperationSettings(), + clientContext, + operationsStub); + this.promoteClusterCallable = + callableFactory.createUnaryCallable( + promoteClusterTransportSettings, settings.promoteClusterSettings(), clientContext); + this.promoteClusterOperationCallable = + callableFactory.createOperationCallable( + promoteClusterTransportSettings, + settings.promoteClusterOperationSettings(), + clientContext, + operationsStub); + this.restoreClusterCallable = + callableFactory.createUnaryCallable( + restoreClusterTransportSettings, settings.restoreClusterSettings(), clientContext); + this.restoreClusterOperationCallable = + callableFactory.createOperationCallable( + restoreClusterTransportSettings, + settings.restoreClusterOperationSettings(), + clientContext, + operationsStub); + this.createSecondaryClusterCallable = + callableFactory.createUnaryCallable( + createSecondaryClusterTransportSettings, + settings.createSecondaryClusterSettings(), + clientContext); + this.createSecondaryClusterOperationCallable = + callableFactory.createOperationCallable( + createSecondaryClusterTransportSettings, + settings.createSecondaryClusterOperationSettings(), + clientContext, + operationsStub); + this.listInstancesCallable = + callableFactory.createUnaryCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.listInstancesPagedCallable = + callableFactory.createPagedCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.getInstanceCallable = + callableFactory.createUnaryCallable( + getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); + this.createInstanceCallable = + callableFactory.createUnaryCallable( + createInstanceTransportSettings, settings.createInstanceSettings(), clientContext); + this.createInstanceOperationCallable = + callableFactory.createOperationCallable( + createInstanceTransportSettings, + settings.createInstanceOperationSettings(), + clientContext, + operationsStub); + this.createSecondaryInstanceCallable = + callableFactory.createUnaryCallable( + createSecondaryInstanceTransportSettings, + settings.createSecondaryInstanceSettings(), + clientContext); + this.createSecondaryInstanceOperationCallable = + callableFactory.createOperationCallable( + createSecondaryInstanceTransportSettings, + settings.createSecondaryInstanceOperationSettings(), + clientContext, + operationsStub); + this.batchCreateInstancesCallable = + callableFactory.createUnaryCallable( + batchCreateInstancesTransportSettings, + settings.batchCreateInstancesSettings(), + clientContext); + this.batchCreateInstancesOperationCallable = + callableFactory.createOperationCallable( + batchCreateInstancesTransportSettings, + settings.batchCreateInstancesOperationSettings(), + clientContext, + operationsStub); + this.updateInstanceCallable = + callableFactory.createUnaryCallable( + updateInstanceTransportSettings, settings.updateInstanceSettings(), clientContext); + this.updateInstanceOperationCallable = + callableFactory.createOperationCallable( + updateInstanceTransportSettings, + settings.updateInstanceOperationSettings(), + clientContext, + operationsStub); + this.deleteInstanceCallable = + callableFactory.createUnaryCallable( + deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); + this.deleteInstanceOperationCallable = + callableFactory.createOperationCallable( + deleteInstanceTransportSettings, + settings.deleteInstanceOperationSettings(), + clientContext, + operationsStub); + this.failoverInstanceCallable = + callableFactory.createUnaryCallable( + failoverInstanceTransportSettings, settings.failoverInstanceSettings(), clientContext); + this.failoverInstanceOperationCallable = + callableFactory.createOperationCallable( + failoverInstanceTransportSettings, + settings.failoverInstanceOperationSettings(), + clientContext, + operationsStub); + this.restartInstanceCallable = + callableFactory.createUnaryCallable( + restartInstanceTransportSettings, settings.restartInstanceSettings(), clientContext); + this.restartInstanceOperationCallable = + callableFactory.createOperationCallable( + restartInstanceTransportSettings, + settings.restartInstanceOperationSettings(), + clientContext, + operationsStub); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.listBackupsPagedCallable = + callableFactory.createPagedCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.createBackupCallable = + callableFactory.createUnaryCallable( + createBackupTransportSettings, settings.createBackupSettings(), clientContext); + this.createBackupOperationCallable = + callableFactory.createOperationCallable( + createBackupTransportSettings, + settings.createBackupOperationSettings(), + clientContext, + operationsStub); + this.updateBackupCallable = + callableFactory.createUnaryCallable( + updateBackupTransportSettings, settings.updateBackupSettings(), clientContext); + this.updateBackupOperationCallable = + callableFactory.createOperationCallable( + updateBackupTransportSettings, + settings.updateBackupOperationSettings(), + clientContext, + operationsStub); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + this.deleteBackupOperationCallable = + callableFactory.createOperationCallable( + deleteBackupTransportSettings, + settings.deleteBackupOperationSettings(), + clientContext, + operationsStub); + this.listSupportedDatabaseFlagsCallable = + callableFactory.createUnaryCallable( + listSupportedDatabaseFlagsTransportSettings, + settings.listSupportedDatabaseFlagsSettings(), + clientContext); + this.listSupportedDatabaseFlagsPagedCallable = + callableFactory.createPagedCallable( + listSupportedDatabaseFlagsTransportSettings, + settings.listSupportedDatabaseFlagsSettings(), + clientContext); + this.generateClientCertificateCallable = + callableFactory.createUnaryCallable( + generateClientCertificateTransportSettings, + settings.generateClientCertificateSettings(), + clientContext); + this.getConnectionInfoCallable = + callableFactory.createUnaryCallable( + getConnectionInfoTransportSettings, + settings.getConnectionInfoSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listClustersCallable() { + return listClustersCallable; + } + + @Override + public UnaryCallable listClustersPagedCallable() { + return listClustersPagedCallable; + } + + @Override + public UnaryCallable getClusterCallable() { + return getClusterCallable; + } + + @Override + public UnaryCallable createClusterCallable() { + return createClusterCallable; + } + + @Override + public OperationCallable + createClusterOperationCallable() { + return createClusterOperationCallable; + } + + @Override + public UnaryCallable updateClusterCallable() { + return updateClusterCallable; + } + + @Override + public OperationCallable + updateClusterOperationCallable() { + return updateClusterOperationCallable; + } + + @Override + public UnaryCallable deleteClusterCallable() { + return deleteClusterCallable; + } + + @Override + public OperationCallable + deleteClusterOperationCallable() { + return deleteClusterOperationCallable; + } + + @Override + public UnaryCallable promoteClusterCallable() { + return promoteClusterCallable; + } + + @Override + public OperationCallable + promoteClusterOperationCallable() { + return promoteClusterOperationCallable; + } + + @Override + public UnaryCallable restoreClusterCallable() { + return restoreClusterCallable; + } + + @Override + public OperationCallable + restoreClusterOperationCallable() { + return restoreClusterOperationCallable; + } + + @Override + public UnaryCallable createSecondaryClusterCallable() { + return createSecondaryClusterCallable; + } + + @Override + public OperationCallable + createSecondaryClusterOperationCallable() { + return createSecondaryClusterOperationCallable; + } + + @Override + public UnaryCallable listInstancesCallable() { + return listInstancesCallable; + } + + @Override + public UnaryCallable + listInstancesPagedCallable() { + return listInstancesPagedCallable; + } + + @Override + public UnaryCallable getInstanceCallable() { + return getInstanceCallable; + } + + @Override + public UnaryCallable createInstanceCallable() { + return createInstanceCallable; + } + + @Override + public OperationCallable + createInstanceOperationCallable() { + return createInstanceOperationCallable; + } + + @Override + public UnaryCallable + createSecondaryInstanceCallable() { + return createSecondaryInstanceCallable; + } + + @Override + public OperationCallable + createSecondaryInstanceOperationCallable() { + return createSecondaryInstanceOperationCallable; + } + + @Override + public UnaryCallable batchCreateInstancesCallable() { + return batchCreateInstancesCallable; + } + + @Override + public OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable() { + return batchCreateInstancesOperationCallable; + } + + @Override + public UnaryCallable updateInstanceCallable() { + return updateInstanceCallable; + } + + @Override + public OperationCallable + updateInstanceOperationCallable() { + return updateInstanceOperationCallable; + } + + @Override + public UnaryCallable deleteInstanceCallable() { + return deleteInstanceCallable; + } + + @Override + public OperationCallable + deleteInstanceOperationCallable() { + return deleteInstanceOperationCallable; + } + + @Override + public UnaryCallable failoverInstanceCallable() { + return failoverInstanceCallable; + } + + @Override + public OperationCallable + failoverInstanceOperationCallable() { + return failoverInstanceOperationCallable; + } + + @Override + public UnaryCallable restartInstanceCallable() { + return restartInstanceCallable; + } + + @Override + public OperationCallable + restartInstanceOperationCallable() { + return restartInstanceOperationCallable; + } + + @Override + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @Override + public UnaryCallable listBackupsPagedCallable() { + return listBackupsPagedCallable; + } + + @Override + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + @Override + public UnaryCallable createBackupCallable() { + return createBackupCallable; + } + + @Override + public OperationCallable + createBackupOperationCallable() { + return createBackupOperationCallable; + } + + @Override + public UnaryCallable updateBackupCallable() { + return updateBackupCallable; + } + + @Override + public OperationCallable + updateBackupOperationCallable() { + return updateBackupOperationCallable; + } + + @Override + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + @Override + public OperationCallable + deleteBackupOperationCallable() { + return deleteBackupOperationCallable; + } + + @Override + public UnaryCallable + listSupportedDatabaseFlagsCallable() { + return listSupportedDatabaseFlagsCallable; + } + + @Override + public UnaryCallable + listSupportedDatabaseFlagsPagedCallable() { + return listSupportedDatabaseFlagsPagedCallable; + } + + @Override + public UnaryCallable + generateClientCertificateCallable() { + return generateClientCertificateCallable; + } + + @Override + public UnaryCallable getConnectionInfoCallable() { + return getConnectionInfoCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @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-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/HttpJsonAlloyDBAdminCallableFactory.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/HttpJsonAlloyDBAdminCallableFactory.java new file mode 100644 index 000000000000..2f0a6689b39b --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/HttpJsonAlloyDBAdminCallableFactory.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.alloydb.v1alpha.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 AlloyDBAdmin service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonAlloyDBAdminCallableFactory + 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-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/HttpJsonAlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/HttpJsonAlloyDBAdminStub.java new file mode 100644 index 000000000000..eaad98bf987c --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/HttpJsonAlloyDBAdminStub.java @@ -0,0 +1,2007 @@ +/* + * 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.alloydb.v1alpha.stub; + +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +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.HttpJsonOperationSnapshot; +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.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.ConnectionInfo; +import com.google.cloud.alloydb.v1alpha.CreateBackupRequest; +import com.google.cloud.alloydb.v1alpha.CreateClusterRequest; +import com.google.cloud.alloydb.v1alpha.CreateInstanceRequest; +import com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1alpha.DeleteBackupRequest; +import com.google.cloud.alloydb.v1alpha.DeleteClusterRequest; +import com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; +import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; +import com.google.cloud.alloydb.v1alpha.GetBackupRequest; +import com.google.cloud.alloydb.v1alpha.GetClusterRequest; +import com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; +import com.google.cloud.alloydb.v1alpha.GetInstanceRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.ListBackupsRequest; +import com.google.cloud.alloydb.v1alpha.ListBackupsResponse; +import com.google.cloud.alloydb.v1alpha.ListClustersRequest; +import com.google.cloud.alloydb.v1alpha.ListClustersResponse; +import com.google.cloud.alloydb.v1alpha.ListInstancesRequest; +import com.google.cloud.alloydb.v1alpha.ListInstancesResponse; +import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; +import com.google.cloud.alloydb.v1alpha.PromoteClusterRequest; +import com.google.cloud.alloydb.v1alpha.RestartInstanceRequest; +import com.google.cloud.alloydb.v1alpha.RestoreClusterRequest; +import com.google.cloud.alloydb.v1alpha.UpdateBackupRequest; +import com.google.cloud.alloydb.v1alpha.UpdateClusterRequest; +import com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.Operation; +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 AlloyDBAdmin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(BatchCreateInstancesResponse.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .add(Instance.getDescriptor()) + .add(Backup.getDescriptor()) + .add(Cluster.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listClustersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListClusters") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*}/clusters", + 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, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListClustersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetCluster") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/clusters/*}", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Cluster.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/CreateCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*}/clusters", + 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, "clusterId", request.getClusterId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("cluster", request.getCluster(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/UpdateCluster") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{cluster.name=projects/*/locations/*/clusters/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "cluster.name", request.getCluster().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("cluster", request.getCluster(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/DeleteCluster") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/clusters/*}", + 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(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam(fields, "force", request.getForce()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + promoteClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/PromoteCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/clusters/*}:promote", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (PromoteClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + restoreClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/RestoreCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*}/clusters:restore", + 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, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (RestoreClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + createSecondaryClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/CreateSecondaryCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*}/clusters:createsecondary", + 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, "clusterId", request.getClusterId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("cluster", request.getCluster(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateSecondaryClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListInstances") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances", + 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, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListInstancesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetInstance") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}", + 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(); + serializer.putQueryParam(fields, "view", request.getViewValue()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Instance.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/CreateInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances", + 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, "instanceId", request.getInstanceId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("instance", request.getInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + createSecondaryInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.alloydb.v1alpha.AlloyDBAdmin/CreateSecondaryInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", + 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, "instanceId", request.getInstanceId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("instance", request.getInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateSecondaryInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + batchCreateInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/BatchCreateInstances") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate", + 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, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("requests", request.getRequests(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (BatchCreateInstancesRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/UpdateInstance") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{instance.name=projects/*/locations/*/clusters/*/instances/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "instance.name", request.getInstance().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("instance", request.getInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/DeleteInstance") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}", + 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(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + failoverInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/FailoverInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:failover", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (FailoverInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + restartInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/RestartInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:restart", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (RestartInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listBackupsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListBackups") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*}/backups", + 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, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListBackupsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetBackup") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/backups/*}", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Backup.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/CreateBackup") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*}/backups", + 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, "backupId", request.getBackupId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("backup", request.getBackup(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateBackupRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/UpdateBackup") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{backup.name=projects/*/locations/*/backups/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "backup.name", request.getBackup().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("backup", request.getBackup(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateBackupRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/DeleteBackup") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/backups/*}", + 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(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteBackupRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsResponse> + listSupportedDatabaseFlagsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListSupportedDatabaseFlags") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*}/supportedDatabaseFlags", + 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()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSupportedDatabaseFlagsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + GenerateClientCertificateRequest, GenerateClientCertificateResponse> + generateClientCertificateMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.alloydb.v1alpha.AlloyDBAdmin/GenerateClientCertificate") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", + 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, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateClientCertificateResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getConnectionInfoMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetConnectionInfo") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo", + 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, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ConnectionInfo.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*}/locations", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*}", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listClustersCallable; + private final UnaryCallable + listClustersPagedCallable; + private final UnaryCallable getClusterCallable; + private final UnaryCallable createClusterCallable; + private final OperationCallable + createClusterOperationCallable; + private final UnaryCallable updateClusterCallable; + private final OperationCallable + updateClusterOperationCallable; + private final UnaryCallable deleteClusterCallable; + private final OperationCallable + deleteClusterOperationCallable; + private final UnaryCallable promoteClusterCallable; + private final OperationCallable + promoteClusterOperationCallable; + private final UnaryCallable restoreClusterCallable; + private final OperationCallable + restoreClusterOperationCallable; + private final UnaryCallable + createSecondaryClusterCallable; + private final OperationCallable + createSecondaryClusterOperationCallable; + private final UnaryCallable listInstancesCallable; + private final UnaryCallable + listInstancesPagedCallable; + private final UnaryCallable getInstanceCallable; + private final UnaryCallable createInstanceCallable; + private final OperationCallable + createInstanceOperationCallable; + private final UnaryCallable + createSecondaryInstanceCallable; + private final OperationCallable + createSecondaryInstanceOperationCallable; + private final UnaryCallable batchCreateInstancesCallable; + private final OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable; + private final UnaryCallable updateInstanceCallable; + private final OperationCallable + updateInstanceOperationCallable; + private final UnaryCallable deleteInstanceCallable; + private final OperationCallable + deleteInstanceOperationCallable; + private final UnaryCallable failoverInstanceCallable; + private final OperationCallable + failoverInstanceOperationCallable; + private final UnaryCallable restartInstanceCallable; + private final OperationCallable + restartInstanceOperationCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable + listBackupsPagedCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable createBackupCallable; + private final OperationCallable + createBackupOperationCallable; + private final UnaryCallable updateBackupCallable; + private final OperationCallable + updateBackupOperationCallable; + private final UnaryCallable deleteBackupCallable; + private final OperationCallable + deleteBackupOperationCallable; + private final UnaryCallable + listSupportedDatabaseFlagsCallable; + private final UnaryCallable< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsPagedCallable; + private final UnaryCallable + generateClientCertificateCallable; + private final UnaryCallable getConnectionInfoCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonAlloyDBAdminStub create(AlloyDBAdminStubSettings settings) + throws IOException { + return new HttpJsonAlloyDBAdminStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAlloyDBAdminStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonAlloyDBAdminStub( + AlloyDBAdminStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonAlloyDBAdminStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAlloyDBAdminStub( + AlloyDBAdminStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonAlloyDBAdminStub, 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 HttpJsonAlloyDBAdminStub(AlloyDBAdminStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonAlloyDBAdminCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAlloyDBAdminStub, 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 HttpJsonAlloyDBAdminStub( + AlloyDBAdminStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings listClustersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listClustersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings promoteClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(promoteClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings restoreClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(restoreClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createSecondaryClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSecondaryClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listInstancesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInstancesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createSecondaryInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSecondaryInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + batchCreateInstancesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(batchCreateInstancesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings failoverInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(failoverInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings restartInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(restartInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listBackupsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listSupportedDatabaseFlagsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listSupportedDatabaseFlagsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateClientCertificateTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(generateClientCertificateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getConnectionInfoTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getConnectionInfoMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listClustersCallable = + callableFactory.createUnaryCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.listClustersPagedCallable = + callableFactory.createPagedCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.getClusterCallable = + callableFactory.createUnaryCallable( + getClusterTransportSettings, settings.getClusterSettings(), clientContext); + this.createClusterCallable = + callableFactory.createUnaryCallable( + createClusterTransportSettings, settings.createClusterSettings(), clientContext); + this.createClusterOperationCallable = + callableFactory.createOperationCallable( + createClusterTransportSettings, + settings.createClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateClusterCallable = + callableFactory.createUnaryCallable( + updateClusterTransportSettings, settings.updateClusterSettings(), clientContext); + this.updateClusterOperationCallable = + callableFactory.createOperationCallable( + updateClusterTransportSettings, + settings.updateClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteClusterCallable = + callableFactory.createUnaryCallable( + deleteClusterTransportSettings, settings.deleteClusterSettings(), clientContext); + this.deleteClusterOperationCallable = + callableFactory.createOperationCallable( + deleteClusterTransportSettings, + settings.deleteClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.promoteClusterCallable = + callableFactory.createUnaryCallable( + promoteClusterTransportSettings, settings.promoteClusterSettings(), clientContext); + this.promoteClusterOperationCallable = + callableFactory.createOperationCallable( + promoteClusterTransportSettings, + settings.promoteClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.restoreClusterCallable = + callableFactory.createUnaryCallable( + restoreClusterTransportSettings, settings.restoreClusterSettings(), clientContext); + this.restoreClusterOperationCallable = + callableFactory.createOperationCallable( + restoreClusterTransportSettings, + settings.restoreClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.createSecondaryClusterCallable = + callableFactory.createUnaryCallable( + createSecondaryClusterTransportSettings, + settings.createSecondaryClusterSettings(), + clientContext); + this.createSecondaryClusterOperationCallable = + callableFactory.createOperationCallable( + createSecondaryClusterTransportSettings, + settings.createSecondaryClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listInstancesCallable = + callableFactory.createUnaryCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.listInstancesPagedCallable = + callableFactory.createPagedCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.getInstanceCallable = + callableFactory.createUnaryCallable( + getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); + this.createInstanceCallable = + callableFactory.createUnaryCallable( + createInstanceTransportSettings, settings.createInstanceSettings(), clientContext); + this.createInstanceOperationCallable = + callableFactory.createOperationCallable( + createInstanceTransportSettings, + settings.createInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.createSecondaryInstanceCallable = + callableFactory.createUnaryCallable( + createSecondaryInstanceTransportSettings, + settings.createSecondaryInstanceSettings(), + clientContext); + this.createSecondaryInstanceOperationCallable = + callableFactory.createOperationCallable( + createSecondaryInstanceTransportSettings, + settings.createSecondaryInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.batchCreateInstancesCallable = + callableFactory.createUnaryCallable( + batchCreateInstancesTransportSettings, + settings.batchCreateInstancesSettings(), + clientContext); + this.batchCreateInstancesOperationCallable = + callableFactory.createOperationCallable( + batchCreateInstancesTransportSettings, + settings.batchCreateInstancesOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateInstanceCallable = + callableFactory.createUnaryCallable( + updateInstanceTransportSettings, settings.updateInstanceSettings(), clientContext); + this.updateInstanceOperationCallable = + callableFactory.createOperationCallable( + updateInstanceTransportSettings, + settings.updateInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteInstanceCallable = + callableFactory.createUnaryCallable( + deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); + this.deleteInstanceOperationCallable = + callableFactory.createOperationCallable( + deleteInstanceTransportSettings, + settings.deleteInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.failoverInstanceCallable = + callableFactory.createUnaryCallable( + failoverInstanceTransportSettings, settings.failoverInstanceSettings(), clientContext); + this.failoverInstanceOperationCallable = + callableFactory.createOperationCallable( + failoverInstanceTransportSettings, + settings.failoverInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.restartInstanceCallable = + callableFactory.createUnaryCallable( + restartInstanceTransportSettings, settings.restartInstanceSettings(), clientContext); + this.restartInstanceOperationCallable = + callableFactory.createOperationCallable( + restartInstanceTransportSettings, + settings.restartInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.listBackupsPagedCallable = + callableFactory.createPagedCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.createBackupCallable = + callableFactory.createUnaryCallable( + createBackupTransportSettings, settings.createBackupSettings(), clientContext); + this.createBackupOperationCallable = + callableFactory.createOperationCallable( + createBackupTransportSettings, + settings.createBackupOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateBackupCallable = + callableFactory.createUnaryCallable( + updateBackupTransportSettings, settings.updateBackupSettings(), clientContext); + this.updateBackupOperationCallable = + callableFactory.createOperationCallable( + updateBackupTransportSettings, + settings.updateBackupOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + this.deleteBackupOperationCallable = + callableFactory.createOperationCallable( + deleteBackupTransportSettings, + settings.deleteBackupOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listSupportedDatabaseFlagsCallable = + callableFactory.createUnaryCallable( + listSupportedDatabaseFlagsTransportSettings, + settings.listSupportedDatabaseFlagsSettings(), + clientContext); + this.listSupportedDatabaseFlagsPagedCallable = + callableFactory.createPagedCallable( + listSupportedDatabaseFlagsTransportSettings, + settings.listSupportedDatabaseFlagsSettings(), + clientContext); + this.generateClientCertificateCallable = + callableFactory.createUnaryCallable( + generateClientCertificateTransportSettings, + settings.generateClientCertificateSettings(), + clientContext); + this.getConnectionInfoCallable = + callableFactory.createUnaryCallable( + getConnectionInfoTransportSettings, + settings.getConnectionInfoSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listClustersMethodDescriptor); + methodDescriptors.add(getClusterMethodDescriptor); + methodDescriptors.add(createClusterMethodDescriptor); + methodDescriptors.add(updateClusterMethodDescriptor); + methodDescriptors.add(deleteClusterMethodDescriptor); + methodDescriptors.add(promoteClusterMethodDescriptor); + methodDescriptors.add(restoreClusterMethodDescriptor); + methodDescriptors.add(createSecondaryClusterMethodDescriptor); + methodDescriptors.add(listInstancesMethodDescriptor); + methodDescriptors.add(getInstanceMethodDescriptor); + methodDescriptors.add(createInstanceMethodDescriptor); + methodDescriptors.add(createSecondaryInstanceMethodDescriptor); + methodDescriptors.add(batchCreateInstancesMethodDescriptor); + methodDescriptors.add(updateInstanceMethodDescriptor); + methodDescriptors.add(deleteInstanceMethodDescriptor); + methodDescriptors.add(failoverInstanceMethodDescriptor); + methodDescriptors.add(restartInstanceMethodDescriptor); + methodDescriptors.add(listBackupsMethodDescriptor); + methodDescriptors.add(getBackupMethodDescriptor); + methodDescriptors.add(createBackupMethodDescriptor); + methodDescriptors.add(updateBackupMethodDescriptor); + methodDescriptors.add(deleteBackupMethodDescriptor); + methodDescriptors.add(listSupportedDatabaseFlagsMethodDescriptor); + methodDescriptors.add(generateClientCertificateMethodDescriptor); + methodDescriptors.add(getConnectionInfoMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable listClustersCallable() { + return listClustersCallable; + } + + @Override + public UnaryCallable listClustersPagedCallable() { + return listClustersPagedCallable; + } + + @Override + public UnaryCallable getClusterCallable() { + return getClusterCallable; + } + + @Override + public UnaryCallable createClusterCallable() { + return createClusterCallable; + } + + @Override + public OperationCallable + createClusterOperationCallable() { + return createClusterOperationCallable; + } + + @Override + public UnaryCallable updateClusterCallable() { + return updateClusterCallable; + } + + @Override + public OperationCallable + updateClusterOperationCallable() { + return updateClusterOperationCallable; + } + + @Override + public UnaryCallable deleteClusterCallable() { + return deleteClusterCallable; + } + + @Override + public OperationCallable + deleteClusterOperationCallable() { + return deleteClusterOperationCallable; + } + + @Override + public UnaryCallable promoteClusterCallable() { + return promoteClusterCallable; + } + + @Override + public OperationCallable + promoteClusterOperationCallable() { + return promoteClusterOperationCallable; + } + + @Override + public UnaryCallable restoreClusterCallable() { + return restoreClusterCallable; + } + + @Override + public OperationCallable + restoreClusterOperationCallable() { + return restoreClusterOperationCallable; + } + + @Override + public UnaryCallable createSecondaryClusterCallable() { + return createSecondaryClusterCallable; + } + + @Override + public OperationCallable + createSecondaryClusterOperationCallable() { + return createSecondaryClusterOperationCallable; + } + + @Override + public UnaryCallable listInstancesCallable() { + return listInstancesCallable; + } + + @Override + public UnaryCallable + listInstancesPagedCallable() { + return listInstancesPagedCallable; + } + + @Override + public UnaryCallable getInstanceCallable() { + return getInstanceCallable; + } + + @Override + public UnaryCallable createInstanceCallable() { + return createInstanceCallable; + } + + @Override + public OperationCallable + createInstanceOperationCallable() { + return createInstanceOperationCallable; + } + + @Override + public UnaryCallable + createSecondaryInstanceCallable() { + return createSecondaryInstanceCallable; + } + + @Override + public OperationCallable + createSecondaryInstanceOperationCallable() { + return createSecondaryInstanceOperationCallable; + } + + @Override + public UnaryCallable batchCreateInstancesCallable() { + return batchCreateInstancesCallable; + } + + @Override + public OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable() { + return batchCreateInstancesOperationCallable; + } + + @Override + public UnaryCallable updateInstanceCallable() { + return updateInstanceCallable; + } + + @Override + public OperationCallable + updateInstanceOperationCallable() { + return updateInstanceOperationCallable; + } + + @Override + public UnaryCallable deleteInstanceCallable() { + return deleteInstanceCallable; + } + + @Override + public OperationCallable + deleteInstanceOperationCallable() { + return deleteInstanceOperationCallable; + } + + @Override + public UnaryCallable failoverInstanceCallable() { + return failoverInstanceCallable; + } + + @Override + public OperationCallable + failoverInstanceOperationCallable() { + return failoverInstanceOperationCallable; + } + + @Override + public UnaryCallable restartInstanceCallable() { + return restartInstanceCallable; + } + + @Override + public OperationCallable + restartInstanceOperationCallable() { + return restartInstanceOperationCallable; + } + + @Override + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @Override + public UnaryCallable listBackupsPagedCallable() { + return listBackupsPagedCallable; + } + + @Override + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + @Override + public UnaryCallable createBackupCallable() { + return createBackupCallable; + } + + @Override + public OperationCallable + createBackupOperationCallable() { + return createBackupOperationCallable; + } + + @Override + public UnaryCallable updateBackupCallable() { + return updateBackupCallable; + } + + @Override + public OperationCallable + updateBackupOperationCallable() { + return updateBackupOperationCallable; + } + + @Override + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + @Override + public OperationCallable + deleteBackupOperationCallable() { + return deleteBackupOperationCallable; + } + + @Override + public UnaryCallable + listSupportedDatabaseFlagsCallable() { + return listSupportedDatabaseFlagsCallable; + } + + @Override + public UnaryCallable + listSupportedDatabaseFlagsPagedCallable() { + return listSupportedDatabaseFlagsPagedCallable; + } + + @Override + public UnaryCallable + generateClientCertificateCallable() { + return generateClientCertificateCallable; + } + + @Override + public UnaryCallable getConnectionInfoCallable() { + return getConnectionInfoCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @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-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClient.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClient.java new file mode 100644 index 000000000000..142557f9ee07 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClient.java @@ -0,0 +1,4462 @@ +/* + * 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.alloydb.v1beta; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.alloydb.v1beta.stub.AlloyDBAdminStub; +import com.google.cloud.alloydb.v1beta.stub.AlloyDBAdminStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service describing handlers for resources + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+ *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+ *   Cluster response = alloyDBAdminClient.getCluster(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the AlloyDBAdminClient 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 AlloyDBAdminSettings 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
+ * AlloyDBAdminSettings alloyDBAdminSettings =
+ *     AlloyDBAdminSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings);
+ * }
+ * + *

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
+ * AlloyDBAdminSettings alloyDBAdminSettings =
+ *     AlloyDBAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings);
+ * }
+ * + *

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
+ * AlloyDBAdminSettings alloyDBAdminSettings = AlloyDBAdminSettings.newHttpJsonBuilder().build();
+ * AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class AlloyDBAdminClient implements BackgroundResource { + private final AlloyDBAdminSettings settings; + private final AlloyDBAdminStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of AlloyDBAdminClient with default settings. */ + public static final AlloyDBAdminClient create() throws IOException { + return create(AlloyDBAdminSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AlloyDBAdminClient, 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 AlloyDBAdminClient create(AlloyDBAdminSettings settings) throws IOException { + return new AlloyDBAdminClient(settings); + } + + /** + * Constructs an instance of AlloyDBAdminClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(AlloyDBAdminSettings). + */ + public static final AlloyDBAdminClient create(AlloyDBAdminStub stub) { + return new AlloyDBAdminClient(stub); + } + + /** + * Constructs an instance of AlloyDBAdminClient, 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 AlloyDBAdminClient(AlloyDBAdminSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AlloyDBAdminStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected AlloyDBAdminClient(AlloyDBAdminStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final AlloyDBAdminSettings getSettings() { + return settings; + } + + public AlloyDBAdminStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Clusters in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Cluster element : alloyDBAdminClient.listClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an aggregated list + * operation by specifying a value with the following format: * + * projects/{project}/locations/- + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListClustersPagedResponse listClusters(LocationName parent) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listClusters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Clusters in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Cluster element : alloyDBAdminClient.listClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an aggregated list + * operation by specifying a value with the following format: * + * projects/{project}/locations/- + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListClustersPagedResponse listClusters(String parent) { + ListClustersRequest request = ListClustersRequest.newBuilder().setParent(parent).build(); + return listClusters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Clusters in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Cluster element : alloyDBAdminClient.listClusters(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 ListClustersPagedResponse listClusters(ListClustersRequest request) { + return listClustersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Clusters in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.listClustersPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Cluster element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listClustersPagedCallable() { + return stub.listClustersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Clusters in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListClustersResponse response = alloyDBAdminClient.listClustersCallable().call(request);
+   *     for (Cluster element : response.getClustersList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listClustersCallable() { + return stub.listClustersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   Cluster response = alloyDBAdminClient.getCluster(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Cluster getCluster(ClusterName name) { + GetClusterRequest request = + GetClusterRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getCluster(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   Cluster response = alloyDBAdminClient.getCluster(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Cluster getCluster(String name) { + GetClusterRequest request = GetClusterRequest.newBuilder().setName(name).build(); + return getCluster(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetClusterRequest request =
+   *       GetClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.getCluster(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 Cluster getCluster(GetClusterRequest request) { + return getClusterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetClusterRequest request =
+   *       GetClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.getClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getClusterCallable() { + return stub.getClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response = alloyDBAdminClient.createClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * @param cluster Required. The resource being created + * @param clusterId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createClusterAsync( + LocationName parent, Cluster cluster, String clusterId) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setCluster(cluster) + .setClusterId(clusterId) + .build(); + return createClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response = alloyDBAdminClient.createClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * @param cluster Required. The resource being created + * @param clusterId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createClusterAsync( + String parent, Cluster cluster, String clusterId) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(parent) + .setCluster(cluster) + .setClusterId(clusterId) + .build(); + return createClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.createClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createClusterAsync( + CreateClusterRequest request) { + return createClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.createClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createClusterOperationCallable() { + return stub.createClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.createClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createClusterCallable() { + return stub.createClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Cluster response = alloyDBAdminClient.updateClusterAsync(cluster, updateMask).get();
+   * }
+   * }
+ * + * @param cluster Required. The resource being updated + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. The fields specified in the update_mask are relative to the + * resource, not the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateClusterAsync( + Cluster cluster, FieldMask updateMask) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder().setCluster(cluster).setUpdateMask(updateMask).build(); + return updateClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateClusterRequest request =
+   *       UpdateClusterRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.updateClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateClusterAsync( + UpdateClusterRequest request) { + return updateClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateClusterRequest request =
+   *       UpdateClusterRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.updateClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateClusterOperationCallable() { + return stub.updateClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateClusterRequest request =
+   *       UpdateClusterRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.updateClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateClusterCallable() { + return stub.updateClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   alloyDBAdminClient.deleteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteClusterAsync(ClusterName name) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   alloyDBAdminClient.deleteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteClusterAsync(String name) { + DeleteClusterRequest request = DeleteClusterRequest.newBuilder().setName(name).build(); + return deleteClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .setForce(true)
+   *           .build();
+   *   alloyDBAdminClient.deleteClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteClusterAsync( + DeleteClusterRequest request) { + return deleteClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .setForce(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.deleteClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteClusterOperationCallable() { + return stub.deleteClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.deleteClusterCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteClusterCallable() { + return stub.deleteClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes + * a secondary cluster into its own standalone cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   Cluster response = alloyDBAdminClient.promoteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture promoteClusterAsync(ClusterName name) { + PromoteClusterRequest request = + PromoteClusterRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return promoteClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes + * a secondary cluster into its own standalone cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   Cluster response = alloyDBAdminClient.promoteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture promoteClusterAsync(String name) { + PromoteClusterRequest request = PromoteClusterRequest.newBuilder().setName(name).build(); + return promoteClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes + * a secondary cluster into its own standalone cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   PromoteClusterRequest request =
+   *       PromoteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.promoteClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture promoteClusterAsync( + PromoteClusterRequest request) { + return promoteClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes + * a secondary cluster into its own standalone cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   PromoteClusterRequest request =
+   *       PromoteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.promoteClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + promoteClusterOperationCallable() { + return stub.promoteClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes + * a secondary cluster into its own standalone cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   PromoteClusterRequest request =
+   *       PromoteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.promoteClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable promoteClusterCallable() { + return stub.promoteClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and location, with a volume restored from the provided + * source, either a backup ID or a point-in-time and a source cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestoreClusterRequest request =
+   *       RestoreClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.restoreClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture restoreClusterAsync( + RestoreClusterRequest request) { + return restoreClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and location, with a volume restored from the provided + * source, either a backup ID or a point-in-time and a source cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestoreClusterRequest request =
+   *       RestoreClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.restoreClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + restoreClusterOperationCallable() { + return stub.restoreClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cluster in a given project and location, with a volume restored from the provided + * source, either a backup ID or a point-in-time and a source cluster. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestoreClusterRequest request =
+   *       RestoreClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.restoreClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable restoreClusterCallable() { + return stub.restoreClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster of type SECONDARY in the given location using the primary cluster as the + * source. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response =
+   *       alloyDBAdminClient.createSecondaryClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource (the primary cluster). For the required + * format, see the comment on the Cluster.name field. + * @param cluster Required. Configuration of the requesting object (the secondary cluster). + * @param clusterId Required. ID of the requesting object (the secondary cluster). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryClusterAsync( + LocationName parent, Cluster cluster, String clusterId) { + CreateSecondaryClusterRequest request = + CreateSecondaryClusterRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setCluster(cluster) + .setClusterId(clusterId) + .build(); + return createSecondaryClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster of type SECONDARY in the given location using the primary cluster as the + * source. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response =
+   *       alloyDBAdminClient.createSecondaryClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource (the primary cluster). For the required + * format, see the comment on the Cluster.name field. + * @param cluster Required. Configuration of the requesting object (the secondary cluster). + * @param clusterId Required. ID of the requesting object (the secondary cluster). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryClusterAsync( + String parent, Cluster cluster, String clusterId) { + CreateSecondaryClusterRequest request = + CreateSecondaryClusterRequest.newBuilder() + .setParent(parent) + .setCluster(cluster) + .setClusterId(clusterId) + .build(); + return createSecondaryClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster of type SECONDARY in the given location using the primary cluster as the + * source. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryClusterRequest request =
+   *       CreateSecondaryClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.createSecondaryClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryClusterAsync( + CreateSecondaryClusterRequest request) { + return createSecondaryClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster of type SECONDARY in the given location using the primary cluster as the + * source. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryClusterRequest request =
+   *       CreateSecondaryClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.createSecondaryClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createSecondaryClusterOperationCallable() { + return stub.createSecondaryClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster of type SECONDARY in the given location using the primary cluster as the + * source. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryClusterRequest request =
+   *       CreateSecondaryClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.createSecondaryClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createSecondaryClusterCallable() { + return stub.createSecondaryClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   for (Instance element : alloyDBAdminClient.listInstances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an aggregated list + * operation by specifying a value with one of the following formats: * + * projects/{project}/locations/-/clusters/- * + * projects/{project}/locations/{region}/clusters/- + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(ClusterName parent) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   for (Instance element : alloyDBAdminClient.listInstances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an aggregated list + * operation by specifying a value with one of the following formats: * + * projects/{project}/locations/-/clusters/- * + * projects/{project}/locations/{region}/clusters/- + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(String parent) { + ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Instance element : alloyDBAdminClient.listInstances(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 ListInstancesPagedResponse listInstances(ListInstancesRequest request) { + return listInstancesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.listInstancesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Instance element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listInstancesPagedCallable() { + return stub.listInstancesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListInstancesResponse response = alloyDBAdminClient.listInstancesCallable().call(request);
+   *     for (Instance element : response.getInstancesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listInstancesCallable() { + return stub.listInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   Instance response = alloyDBAdminClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(InstanceName name) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   Instance response = alloyDBAdminClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(String name) { + GetInstanceRequest request = GetInstanceRequest.newBuilder().setName(name).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setView(InstanceView.forNumber(0))
+   *           .build();
+   *   Instance response = alloyDBAdminClient.getInstance(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 Instance getInstance(GetInstanceRequest request) { + return getInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setView(InstanceView.forNumber(0))
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.getInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getInstanceCallable() { + return stub.getInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       alloyDBAdminClient.createInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param instance Required. The resource being created + * @param instanceId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + ClusterName parent, Instance instance, String instanceId) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       alloyDBAdminClient.createInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param instance Required. The resource being created + * @param instanceId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + String parent, Instance instance, String instanceId) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.createInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + CreateInstanceRequest request) { + return createInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.createInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createInstanceOperationCallable() { + return stub.createInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.createInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createInstanceCallable() { + return stub.createInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new SECONDARY Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       alloyDBAdminClient.createSecondaryInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param instance Required. The resource being created + * @param instanceId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryInstanceAsync( + ClusterName parent, Instance instance, String instanceId) { + CreateSecondaryInstanceRequest request = + CreateSecondaryInstanceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createSecondaryInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new SECONDARY Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       alloyDBAdminClient.createSecondaryInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param instance Required. The resource being created + * @param instanceId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryInstanceAsync( + String parent, Instance instance, String instanceId) { + CreateSecondaryInstanceRequest request = + CreateSecondaryInstanceRequest.newBuilder() + .setParent(parent) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createSecondaryInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new SECONDARY Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryInstanceRequest request =
+   *       CreateSecondaryInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.createSecondaryInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryInstanceAsync( + CreateSecondaryInstanceRequest request) { + return createSecondaryInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new SECONDARY Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryInstanceRequest request =
+   *       CreateSecondaryInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.createSecondaryInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createSecondaryInstanceOperationCallable() { + return stub.createSecondaryInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new SECONDARY Instance in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryInstanceRequest request =
+   *       CreateSecondaryInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.createSecondaryInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createSecondaryInstanceCallable() { + return stub.createSecondaryInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates new instances under the given project, location and cluster. There can be only one + * primary instance in a cluster. If the primary instance exists in the cluster as well as this + * request, then API will throw an error. The primary instance should exist before any read pool + * instance is created. If the primary instance is a part of the request payload, then the API + * will take care of creating instances in the correct order. This method is here to support + * Google-internal use cases, and is not meant for external customers to consume. Please do not + * start relying on it; its behavior is subject to change without notice. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BatchCreateInstancesRequest request =
+   *       BatchCreateInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequests(CreateInstanceRequests.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   BatchCreateInstancesResponse response =
+   *       alloyDBAdminClient.batchCreateInstancesAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + batchCreateInstancesAsync(BatchCreateInstancesRequest request) { + return batchCreateInstancesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates new instances under the given project, location and cluster. There can be only one + * primary instance in a cluster. If the primary instance exists in the cluster as well as this + * request, then API will throw an error. The primary instance should exist before any read pool + * instance is created. If the primary instance is a part of the request payload, then the API + * will take care of creating instances in the correct order. This method is here to support + * Google-internal use cases, and is not meant for external customers to consume. Please do not + * start relying on it; its behavior is subject to change without notice. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BatchCreateInstancesRequest request =
+   *       BatchCreateInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequests(CreateInstanceRequests.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.batchCreateInstancesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   BatchCreateInstancesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable() { + return stub.batchCreateInstancesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates new instances under the given project, location and cluster. There can be only one + * primary instance in a cluster. If the primary instance exists in the cluster as well as this + * request, then API will throw an error. The primary instance should exist before any read pool + * instance is created. If the primary instance is a part of the request payload, then the API + * will take care of creating instances in the correct order. This method is here to support + * Google-internal use cases, and is not meant for external customers to consume. Please do not + * start relying on it; its behavior is subject to change without notice. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BatchCreateInstancesRequest request =
+   *       BatchCreateInstancesRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequests(CreateInstanceRequests.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.batchCreateInstancesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + batchCreateInstancesCallable() { + return stub.batchCreateInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   Instance instance = Instance.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Instance response = alloyDBAdminClient.updateInstanceAsync(instance, updateMask).get();
+   * }
+   * }
+ * + * @param instance Required. The resource being updated + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. The fields specified in the update_mask are relative to + * the resource, not the full request. A field will be overwritten if it is in the mask. If + * the user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateInstanceAsync( + Instance instance, FieldMask updateMask) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder().setInstance(instance).setUpdateMask(updateMask).build(); + return updateInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.updateInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateInstanceAsync( + UpdateInstanceRequest request) { + return updateInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.updateInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateInstanceOperationCallable() { + return stub.updateInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.updateInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateInstanceCallable() { + return stub.updateInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   alloyDBAdminClient.deleteInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteInstanceAsync(InstanceName name) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   alloyDBAdminClient.deleteInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteInstanceAsync(String name) { + DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   alloyDBAdminClient.deleteInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteInstanceAsync( + DeleteInstanceRequest request) { + return deleteInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.deleteInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteInstanceOperationCallable() { + return stub.deleteInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.deleteInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteInstanceCallable() { + return stub.deleteInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Forces a Failover for a highly available instance. Failover promotes the HA standby instance as + * the new primary. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   Instance response = alloyDBAdminClient.failoverInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture failoverInstanceAsync( + InstanceName name) { + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return failoverInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Forces a Failover for a highly available instance. Failover promotes the HA standby instance as + * the new primary. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   Instance response = alloyDBAdminClient.failoverInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture failoverInstanceAsync(String name) { + FailoverInstanceRequest request = FailoverInstanceRequest.newBuilder().setName(name).build(); + return failoverInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Forces a Failover for a highly available instance. Failover promotes the HA standby instance as + * the new primary. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   FailoverInstanceRequest request =
+   *       FailoverInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.failoverInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture failoverInstanceAsync( + FailoverInstanceRequest request) { + return failoverInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Forces a Failover for a highly available instance. Failover promotes the HA standby instance as + * the new primary. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   FailoverInstanceRequest request =
+   *       FailoverInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.failoverInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + failoverInstanceOperationCallable() { + return stub.failoverInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Forces a Failover for a highly available instance. Failover promotes the HA standby instance as + * the new primary. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   FailoverInstanceRequest request =
+   *       FailoverInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.failoverInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable failoverInstanceCallable() { + return stub.failoverInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   Instance response = alloyDBAdminClient.restartInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture restartInstanceAsync( + InstanceName name) { + RestartInstanceRequest request = + RestartInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return restartInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   Instance response = alloyDBAdminClient.restartInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture restartInstanceAsync(String name) { + RestartInstanceRequest request = RestartInstanceRequest.newBuilder().setName(name).build(); + return restartInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestartInstanceRequest request =
+   *       RestartInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.restartInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture restartInstanceAsync( + RestartInstanceRequest request) { + return restartInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestartInstanceRequest request =
+   *       RestartInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.restartInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + restartInstanceOperationCallable() { + return stub.restartInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestartInstanceRequest request =
+   *       RestartInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.restartInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable restartInstanceCallable() { + return stub.restartInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListBackupsRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(LocationName parent) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListBackupsRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(String parent) { + ListBackupsRequest request = ListBackupsRequest.newBuilder().setParent(parent).build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Backup element : alloyDBAdminClient.listBackups(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 ListBackupsPagedResponse listBackups(ListBackupsRequest request) { + return listBackupsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.listBackupsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Backup element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listBackupsPagedCallable() { + return stub.listBackupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListBackupsResponse response = alloyDBAdminClient.listBackupsCallable().call(request);
+   *     for (Backup element : response.getBackupsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listBackupsCallable() { + return stub.listBackupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]");
+   *   Backup response = alloyDBAdminClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(BackupName name) { + GetBackupRequest request = + GetBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString();
+   *   Backup response = alloyDBAdminClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(String name) { + GetBackupRequest request = GetBackupRequest.newBuilder().setName(name).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   Backup response = alloyDBAdminClient.getBackup(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 Backup getBackup(GetBackupRequest request) { + return getBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.getBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getBackupCallable() { + return stub.getBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Backup in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Backup backup = Backup.newBuilder().build();
+   *   String backupId = "backupId2121930365";
+   *   Backup response = alloyDBAdminClient.createBackupAsync(parent, backup, backupId).get();
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param backup Required. The resource being created + * @param backupId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createBackupAsync( + LocationName parent, Backup backup, String backupId) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBackup(backup) + .setBackupId(backupId) + .build(); + return createBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Backup in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Backup backup = Backup.newBuilder().build();
+   *   String backupId = "backupId2121930365";
+   *   Backup response = alloyDBAdminClient.createBackupAsync(parent, backup, backupId).get();
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param backup Required. The resource being created + * @param backupId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createBackupAsync( + String parent, Backup backup, String backupId) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(parent) + .setBackup(backup) + .setBackupId(backupId) + .build(); + return createBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Backup in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBackupId("backupId2121930365")
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Backup response = alloyDBAdminClient.createBackupAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createBackupAsync( + CreateBackupRequest request) { + return createBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Backup in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBackupId("backupId2121930365")
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.createBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createBackupOperationCallable() { + return stub.createBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Backup in a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBackupId("backupId2121930365")
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.createBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createBackupCallable() { + return stub.createBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   Backup backup = Backup.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Backup response = alloyDBAdminClient.updateBackupAsync(backup, updateMask).get();
+   * }
+   * }
+ * + * @param backup Required. The resource being updated + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. The fields specified in the update_mask are relative to the + * resource, not the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateBackupAsync( + Backup backup, FieldMask updateMask) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder().setBackup(backup).setUpdateMask(updateMask).build(); + return updateBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   Backup response = alloyDBAdminClient.updateBackupAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateBackupAsync( + UpdateBackupRequest request) { + return updateBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.updateBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateBackupOperationCallable() { + return stub.updateBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.updateBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateBackupCallable() { + return stub.updateBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]");
+   *   alloyDBAdminClient.deleteBackupAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. For the required format, see the comment on the + * Backup.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteBackupAsync(BackupName name) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString();
+   *   alloyDBAdminClient.deleteBackupAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. For the required format, see the comment on the + * Backup.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteBackupAsync(String name) { + DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name).build(); + return deleteBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   alloyDBAdminClient.deleteBackupAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteBackupAsync( + DeleteBackupRequest request) { + return deleteBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.deleteBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteBackupOperationCallable() { + return stub.deleteBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.deleteBackupCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteBackupCallable() { + return stub.deleteBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (SupportedDatabaseFlag element :
+   *       alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. The required format is: * + * projects/{project}/locations/{location} + *

Regardless of the parent specified here, as long it is contains a valid project and + * location, the service will return a static list of supported flags resources. Note that we + * do not yet support region-specific flags. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags( + LocationName parent) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listSupportedDatabaseFlags(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (SupportedDatabaseFlag element :
+   *       alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. The required format is: * + * projects/{project}/locations/{location} + *

Regardless of the parent specified here, as long it is contains a valid project and + * location, the service will return a static list of supported flags resources. Note that we + * do not yet support region-specific flags. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags(String parent) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder().setParent(parent).build(); + return listSupportedDatabaseFlags(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListSupportedDatabaseFlagsRequest request =
+   *       ListSupportedDatabaseFlagsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (SupportedDatabaseFlag element :
+   *       alloyDBAdminClient.listSupportedDatabaseFlags(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 ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags( + ListSupportedDatabaseFlagsRequest request) { + return listSupportedDatabaseFlagsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListSupportedDatabaseFlagsRequest request =
+   *       ListSupportedDatabaseFlagsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.listSupportedDatabaseFlagsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (SupportedDatabaseFlag element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsPagedCallable() { + return stub.listSupportedDatabaseFlagsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListSupportedDatabaseFlagsRequest request =
+   *       ListSupportedDatabaseFlagsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListSupportedDatabaseFlagsResponse response =
+   *         alloyDBAdminClient.listSupportedDatabaseFlagsCallable().call(request);
+   *     for (SupportedDatabaseFlag element : response.getSupportedDatabaseFlagsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listSupportedDatabaseFlagsCallable() { + return stub.listSupportedDatabaseFlagsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to + * support the Auth Proxy client and the endpoint's behavior is subject to change without notice, + * so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy + * client. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   GenerateClientCertificateResponse response =
+   *       alloyDBAdminClient.generateClientCertificate(parent);
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. The required format is: * + * projects/{project}/locations/{location}/clusters/{cluster} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateClientCertificateResponse generateClientCertificate(ClusterName parent) { + GenerateClientCertificateRequest request = + GenerateClientCertificateRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return generateClientCertificate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to + * support the Auth Proxy client and the endpoint's behavior is subject to change without notice, + * so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy + * client. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   GenerateClientCertificateResponse response =
+   *       alloyDBAdminClient.generateClientCertificate(parent);
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. The required format is: * + * projects/{project}/locations/{location}/clusters/{cluster} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateClientCertificateResponse generateClientCertificate(String parent) { + GenerateClientCertificateRequest request = + GenerateClientCertificateRequest.newBuilder().setParent(parent).build(); + return generateClientCertificate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to + * support the Auth Proxy client and the endpoint's behavior is subject to change without notice, + * so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy + * client. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GenerateClientCertificateRequest request =
+   *       GenerateClientCertificateRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setPemCsr("pemCsr-991911478")
+   *           .setCertDuration(Duration.newBuilder().build())
+   *           .build();
+   *   GenerateClientCertificateResponse response =
+   *       alloyDBAdminClient.generateClientCertificate(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 GenerateClientCertificateResponse generateClientCertificate( + GenerateClientCertificateRequest request) { + return generateClientCertificateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to + * support the Auth Proxy client and the endpoint's behavior is subject to change without notice, + * so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy + * client. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GenerateClientCertificateRequest request =
+   *       GenerateClientCertificateRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setPemCsr("pemCsr-991911478")
+   *           .setCertDuration(Duration.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.generateClientCertificateCallable().futureCall(request);
+   *   // Do something.
+   *   GenerateClientCertificateResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + generateClientCertificateCallable() { + return stub.generateClientCertificateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get instance metadata used for a connection. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   ConnectionInfo response = alloyDBAdminClient.getConnectionInfo(parent);
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ConnectionInfo getConnectionInfo(InstanceName parent) { + GetConnectionInfoRequest request = + GetConnectionInfoRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return getConnectionInfo(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get instance metadata used for a connection. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   ConnectionInfo response = alloyDBAdminClient.getConnectionInfo(parent);
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ConnectionInfo getConnectionInfo(String parent) { + GetConnectionInfoRequest request = + GetConnectionInfoRequest.newBuilder().setParent(parent).build(); + return getConnectionInfo(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get instance metadata used for a connection. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetConnectionInfoRequest request =
+   *       GetConnectionInfoRequest.newBuilder()
+   *           .setParent(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ConnectionInfo response = alloyDBAdminClient.getConnectionInfo(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 ConnectionInfo getConnectionInfo(GetConnectionInfoRequest request) { + return getConnectionInfoCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get instance metadata used for a connection. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetConnectionInfoRequest request =
+   *       GetConnectionInfoRequest.newBuilder()
+   *           .setParent(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.getConnectionInfoCallable().futureCall(request);
+   *   // Do something.
+   *   ConnectionInfo response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getConnectionInfoCallable() { + return stub.getConnectionInfoCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : alloyDBAdminClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = alloyDBAdminClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = alloyDBAdminClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = alloyDBAdminClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @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 ListClustersPagedResponse + extends AbstractPagedListResponse< + ListClustersRequest, + ListClustersResponse, + Cluster, + ListClustersPage, + ListClustersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListClustersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListClustersPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListClustersPagedResponse(ListClustersPage page) { + super(page, ListClustersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListClustersPage + extends AbstractPage { + + private ListClustersPage( + PageContext context, + ListClustersResponse response) { + super(context, response); + } + + private static ListClustersPage createEmptyPage() { + return new ListClustersPage(null, null); + } + + @Override + protected ListClustersPage createPage( + PageContext context, + ListClustersResponse response) { + return new ListClustersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListClustersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListClustersRequest, + ListClustersResponse, + Cluster, + ListClustersPage, + ListClustersFixedSizeCollection> { + + private ListClustersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListClustersFixedSizeCollection createEmptyCollection() { + return new ListClustersFixedSizeCollection(null, 0); + } + + @Override + protected ListClustersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListClustersFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListInstancesPagedResponse + extends AbstractPagedListResponse< + ListInstancesRequest, + ListInstancesResponse, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListInstancesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListInstancesPagedResponse(ListInstancesPage page) { + super(page, ListInstancesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListInstancesPage + extends AbstractPage< + ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage> { + + private ListInstancesPage( + PageContext context, + ListInstancesResponse response) { + super(context, response); + } + + private static ListInstancesPage createEmptyPage() { + return new ListInstancesPage(null, null); + } + + @Override + protected ListInstancesPage createPage( + PageContext context, + ListInstancesResponse response) { + return new ListInstancesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListInstancesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstancesRequest, + ListInstancesResponse, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + private ListInstancesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInstancesFixedSizeCollection createEmptyCollection() { + return new ListInstancesFixedSizeCollection(null, 0); + } + + @Override + protected ListInstancesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInstancesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListBackupsPagedResponse + extends AbstractPagedListResponse< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBackupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListBackupsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListBackupsPagedResponse(ListBackupsPage page) { + super(page, ListBackupsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBackupsPage + extends AbstractPage { + + private ListBackupsPage( + PageContext context, + ListBackupsResponse response) { + super(context, response); + } + + private static ListBackupsPage createEmptyPage() { + return new ListBackupsPage(null, null); + } + + @Override + protected ListBackupsPage createPage( + PageContext context, + ListBackupsResponse response) { + return new ListBackupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBackupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + private ListBackupsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBackupsFixedSizeCollection createEmptyCollection() { + return new ListBackupsFixedSizeCollection(null, 0); + } + + @Override + protected ListBackupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBackupsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListSupportedDatabaseFlagsPagedResponse + extends AbstractPagedListResponse< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag, + ListSupportedDatabaseFlagsPage, + ListSupportedDatabaseFlagsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSupportedDatabaseFlagsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSupportedDatabaseFlagsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSupportedDatabaseFlagsPagedResponse(ListSupportedDatabaseFlagsPage page) { + super(page, ListSupportedDatabaseFlagsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSupportedDatabaseFlagsPage + extends AbstractPage< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag, + ListSupportedDatabaseFlagsPage> { + + private ListSupportedDatabaseFlagsPage( + PageContext< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + context, + ListSupportedDatabaseFlagsResponse response) { + super(context, response); + } + + private static ListSupportedDatabaseFlagsPage createEmptyPage() { + return new ListSupportedDatabaseFlagsPage(null, null); + } + + @Override + protected ListSupportedDatabaseFlagsPage createPage( + PageContext< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + context, + ListSupportedDatabaseFlagsResponse response) { + return new ListSupportedDatabaseFlagsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSupportedDatabaseFlagsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag, + ListSupportedDatabaseFlagsPage, + ListSupportedDatabaseFlagsFixedSizeCollection> { + + private ListSupportedDatabaseFlagsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSupportedDatabaseFlagsFixedSizeCollection createEmptyCollection() { + return new ListSupportedDatabaseFlagsFixedSizeCollection(null, 0); + } + + @Override + protected ListSupportedDatabaseFlagsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSupportedDatabaseFlagsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminSettings.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminSettings.java new file mode 100644 index 000000000000..fbaf7f64dd23 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminSettings.java @@ -0,0 +1,705 @@ +/* + * 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.alloydb.v1beta; + +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +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.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.alloydb.v1beta.stub.AlloyDBAdminStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.Operation; +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 AlloyDBAdminClient}. + * + *

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

    + *
  • The default service address (alloydb.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 getCluster 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
+ * AlloyDBAdminSettings.Builder alloyDBAdminSettingsBuilder = AlloyDBAdminSettings.newBuilder();
+ * alloyDBAdminSettingsBuilder
+ *     .getClusterSettings()
+ *     .setRetrySettings(
+ *         alloyDBAdminSettingsBuilder
+ *             .getClusterSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AlloyDBAdminSettings alloyDBAdminSettings = alloyDBAdminSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class AlloyDBAdminSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listClusters. */ + public PagedCallSettings + listClustersSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listClustersSettings(); + } + + /** Returns the object with the settings used for calls to getCluster. */ + public UnaryCallSettings getClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getClusterSettings(); + } + + /** Returns the object with the settings used for calls to createCluster. */ + public UnaryCallSettings createClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createClusterSettings(); + } + + /** Returns the object with the settings used for calls to createCluster. */ + public OperationCallSettings + createClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public UnaryCallSettings updateClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateClusterSettings(); + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public OperationCallSettings + updateClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public UnaryCallSettings deleteClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteClusterSettings(); + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public OperationCallSettings + deleteClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to promoteCluster. */ + public UnaryCallSettings promoteClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).promoteClusterSettings(); + } + + /** Returns the object with the settings used for calls to promoteCluster. */ + public OperationCallSettings + promoteClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).promoteClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to restoreCluster. */ + public UnaryCallSettings restoreClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).restoreClusterSettings(); + } + + /** Returns the object with the settings used for calls to restoreCluster. */ + public OperationCallSettings + restoreClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).restoreClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to createSecondaryCluster. */ + public UnaryCallSettings + createSecondaryClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createSecondaryClusterSettings(); + } + + /** Returns the object with the settings used for calls to createSecondaryCluster. */ + public OperationCallSettings + createSecondaryClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createSecondaryClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listInstancesSettings(); + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to createSecondaryInstance. */ + public UnaryCallSettings + createSecondaryInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createSecondaryInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createSecondaryInstance. */ + public OperationCallSettings + createSecondaryInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()) + .createSecondaryInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to batchCreateInstances. */ + public UnaryCallSettings batchCreateInstancesSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).batchCreateInstancesSettings(); + } + + /** Returns the object with the settings used for calls to batchCreateInstances. */ + public OperationCallSettings< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).batchCreateInstancesOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateInstanceSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public OperationCallSettings + updateInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteInstanceSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public OperationCallSettings + deleteInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to failoverInstance. */ + public UnaryCallSettings failoverInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).failoverInstanceSettings(); + } + + /** Returns the object with the settings used for calls to failoverInstance. */ + public OperationCallSettings + failoverInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).failoverInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to restartInstance. */ + public UnaryCallSettings restartInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).restartInstanceSettings(); + } + + /** Returns the object with the settings used for calls to restartInstance. */ + public OperationCallSettings + restartInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).restartInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listBackupsSettings(); + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getBackupSettings(); + } + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createBackupSettings(); + } + + /** Returns the object with the settings used for calls to createBackup. */ + public OperationCallSettings + createBackupOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateBackupSettings(); + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public OperationCallSettings + updateBackupOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteBackupSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public OperationCallSettings + deleteBackupOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to listSupportedDatabaseFlags. */ + public PagedCallSettings< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listSupportedDatabaseFlagsSettings(); + } + + /** Returns the object with the settings used for calls to generateClientCertificate. */ + public UnaryCallSettings + generateClientCertificateSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).generateClientCertificateSettings(); + } + + /** Returns the object with the settings used for calls to getConnectionInfo. */ + public UnaryCallSettings getConnectionInfoSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getConnectionInfoSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final AlloyDBAdminSettings create(AlloyDBAdminStubSettings stub) + throws IOException { + return new AlloyDBAdminSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AlloyDBAdminStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AlloyDBAdminStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AlloyDBAdminStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AlloyDBAdminStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AlloyDBAdminStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return AlloyDBAdminStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AlloyDBAdminStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AlloyDBAdminStubSettings.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 AlloyDBAdminSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AlloyDBAdminSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(AlloyDBAdminStubSettings.newBuilder(clientContext)); + } + + protected Builder(AlloyDBAdminSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AlloyDBAdminStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(AlloyDBAdminStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(AlloyDBAdminStubSettings.newHttpJsonBuilder()); + } + + public AlloyDBAdminStubSettings.Builder getStubSettingsBuilder() { + return ((AlloyDBAdminStubSettings.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 listClusters. */ + public PagedCallSettings.Builder< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings() { + return getStubSettingsBuilder().listClustersSettings(); + } + + /** Returns the builder for the settings used for calls to getCluster. */ + public UnaryCallSettings.Builder getClusterSettings() { + return getStubSettingsBuilder().getClusterSettings(); + } + + /** Returns the builder for the settings used for calls to createCluster. */ + public UnaryCallSettings.Builder createClusterSettings() { + return getStubSettingsBuilder().createClusterSettings(); + } + + /** Returns the builder for the settings used for calls to createCluster. */ + public OperationCallSettings.Builder + createClusterOperationSettings() { + return getStubSettingsBuilder().createClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + public UnaryCallSettings.Builder updateClusterSettings() { + return getStubSettingsBuilder().updateClusterSettings(); + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + public OperationCallSettings.Builder + updateClusterOperationSettings() { + return getStubSettingsBuilder().updateClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteCluster. */ + public UnaryCallSettings.Builder deleteClusterSettings() { + return getStubSettingsBuilder().deleteClusterSettings(); + } + + /** Returns the builder for the settings used for calls to deleteCluster. */ + public OperationCallSettings.Builder + deleteClusterOperationSettings() { + return getStubSettingsBuilder().deleteClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to promoteCluster. */ + public UnaryCallSettings.Builder promoteClusterSettings() { + return getStubSettingsBuilder().promoteClusterSettings(); + } + + /** Returns the builder for the settings used for calls to promoteCluster. */ + public OperationCallSettings.Builder + promoteClusterOperationSettings() { + return getStubSettingsBuilder().promoteClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to restoreCluster. */ + public UnaryCallSettings.Builder restoreClusterSettings() { + return getStubSettingsBuilder().restoreClusterSettings(); + } + + /** Returns the builder for the settings used for calls to restoreCluster. */ + public OperationCallSettings.Builder + restoreClusterOperationSettings() { + return getStubSettingsBuilder().restoreClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to createSecondaryCluster. */ + public UnaryCallSettings.Builder + createSecondaryClusterSettings() { + return getStubSettingsBuilder().createSecondaryClusterSettings(); + } + + /** Returns the builder for the settings used for calls to createSecondaryCluster. */ + public OperationCallSettings.Builder + createSecondaryClusterOperationSettings() { + return getStubSettingsBuilder().createSecondaryClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return getStubSettingsBuilder().listInstancesSettings(); + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getStubSettingsBuilder().getInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return getStubSettingsBuilder().createInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return getStubSettingsBuilder().createInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to createSecondaryInstance. */ + public UnaryCallSettings.Builder + createSecondaryInstanceSettings() { + return getStubSettingsBuilder().createSecondaryInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createSecondaryInstance. */ + public OperationCallSettings.Builder< + CreateSecondaryInstanceRequest, Instance, OperationMetadata> + createSecondaryInstanceOperationSettings() { + return getStubSettingsBuilder().createSecondaryInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to batchCreateInstances. */ + public UnaryCallSettings.Builder + batchCreateInstancesSettings() { + return getStubSettingsBuilder().batchCreateInstancesSettings(); + } + + /** Returns the builder for the settings used for calls to batchCreateInstances. */ + public OperationCallSettings.Builder< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings() { + return getStubSettingsBuilder().batchCreateInstancesOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return getStubSettingsBuilder().updateInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return getStubSettingsBuilder().updateInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return getStubSettingsBuilder().deleteInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return getStubSettingsBuilder().deleteInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to failoverInstance. */ + public UnaryCallSettings.Builder + failoverInstanceSettings() { + return getStubSettingsBuilder().failoverInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to failoverInstance. */ + public OperationCallSettings.Builder + failoverInstanceOperationSettings() { + return getStubSettingsBuilder().failoverInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to restartInstance. */ + public UnaryCallSettings.Builder restartInstanceSettings() { + return getStubSettingsBuilder().restartInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to restartInstance. */ + public OperationCallSettings.Builder + restartInstanceOperationSettings() { + return getStubSettingsBuilder().restartInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return getStubSettingsBuilder().listBackupsSettings(); + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getStubSettingsBuilder().getBackupSettings(); + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return getStubSettingsBuilder().createBackupSettings(); + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public OperationCallSettings.Builder + createBackupOperationSettings() { + return getStubSettingsBuilder().createBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return getStubSettingsBuilder().updateBackupSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public OperationCallSettings.Builder + updateBackupOperationSettings() { + return getStubSettingsBuilder().updateBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return getStubSettingsBuilder().deleteBackupSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public OperationCallSettings.Builder + deleteBackupOperationSettings() { + return getStubSettingsBuilder().deleteBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listSupportedDatabaseFlags. */ + public PagedCallSettings.Builder< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings() { + return getStubSettingsBuilder().listSupportedDatabaseFlagsSettings(); + } + + /** Returns the builder for the settings used for calls to generateClientCertificate. */ + public UnaryCallSettings.Builder< + GenerateClientCertificateRequest, GenerateClientCertificateResponse> + generateClientCertificateSettings() { + return getStubSettingsBuilder().generateClientCertificateSettings(); + } + + /** Returns the builder for the settings used for calls to getConnectionInfo. */ + public UnaryCallSettings.Builder + getConnectionInfoSettings() { + return getStubSettingsBuilder().getConnectionInfoSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public AlloyDBAdminSettings build() throws IOException { + return new AlloyDBAdminSettings(this); + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/gapic_metadata.json b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/gapic_metadata.json new file mode 100644 index 000000000000..9c382fa594ab --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/gapic_metadata.json @@ -0,0 +1,99 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.alloydb.v1beta", + "libraryPackage": "com.google.cloud.alloydb.v1beta", + "services": { + "AlloyDBAdmin": { + "clients": { + "grpc": { + "libraryClient": "AlloyDBAdminClient", + "rpcs": { + "BatchCreateInstances": { + "methods": ["batchCreateInstancesAsync", "batchCreateInstancesOperationCallable", "batchCreateInstancesCallable"] + }, + "CreateBackup": { + "methods": ["createBackupAsync", "createBackupAsync", "createBackupAsync", "createBackupOperationCallable", "createBackupCallable"] + }, + "CreateCluster": { + "methods": ["createClusterAsync", "createClusterAsync", "createClusterAsync", "createClusterOperationCallable", "createClusterCallable"] + }, + "CreateInstance": { + "methods": ["createInstanceAsync", "createInstanceAsync", "createInstanceAsync", "createInstanceOperationCallable", "createInstanceCallable"] + }, + "CreateSecondaryCluster": { + "methods": ["createSecondaryClusterAsync", "createSecondaryClusterAsync", "createSecondaryClusterAsync", "createSecondaryClusterOperationCallable", "createSecondaryClusterCallable"] + }, + "CreateSecondaryInstance": { + "methods": ["createSecondaryInstanceAsync", "createSecondaryInstanceAsync", "createSecondaryInstanceAsync", "createSecondaryInstanceOperationCallable", "createSecondaryInstanceCallable"] + }, + "DeleteBackup": { + "methods": ["deleteBackupAsync", "deleteBackupAsync", "deleteBackupAsync", "deleteBackupOperationCallable", "deleteBackupCallable"] + }, + "DeleteCluster": { + "methods": ["deleteClusterAsync", "deleteClusterAsync", "deleteClusterAsync", "deleteClusterOperationCallable", "deleteClusterCallable"] + }, + "DeleteInstance": { + "methods": ["deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceOperationCallable", "deleteInstanceCallable"] + }, + "FailoverInstance": { + "methods": ["failoverInstanceAsync", "failoverInstanceAsync", "failoverInstanceAsync", "failoverInstanceOperationCallable", "failoverInstanceCallable"] + }, + "GenerateClientCertificate": { + "methods": ["generateClientCertificate", "generateClientCertificate", "generateClientCertificate", "generateClientCertificateCallable"] + }, + "GetBackup": { + "methods": ["getBackup", "getBackup", "getBackup", "getBackupCallable"] + }, + "GetCluster": { + "methods": ["getCluster", "getCluster", "getCluster", "getClusterCallable"] + }, + "GetConnectionInfo": { + "methods": ["getConnectionInfo", "getConnectionInfo", "getConnectionInfo", "getConnectionInfoCallable"] + }, + "GetInstance": { + "methods": ["getInstance", "getInstance", "getInstance", "getInstanceCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListBackups": { + "methods": ["listBackups", "listBackups", "listBackups", "listBackupsPagedCallable", "listBackupsCallable"] + }, + "ListClusters": { + "methods": ["listClusters", "listClusters", "listClusters", "listClustersPagedCallable", "listClustersCallable"] + }, + "ListInstances": { + "methods": ["listInstances", "listInstances", "listInstances", "listInstancesPagedCallable", "listInstancesCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListSupportedDatabaseFlags": { + "methods": ["listSupportedDatabaseFlags", "listSupportedDatabaseFlags", "listSupportedDatabaseFlags", "listSupportedDatabaseFlagsPagedCallable", "listSupportedDatabaseFlagsCallable"] + }, + "PromoteCluster": { + "methods": ["promoteClusterAsync", "promoteClusterAsync", "promoteClusterAsync", "promoteClusterOperationCallable", "promoteClusterCallable"] + }, + "RestartInstance": { + "methods": ["restartInstanceAsync", "restartInstanceAsync", "restartInstanceAsync", "restartInstanceOperationCallable", "restartInstanceCallable"] + }, + "RestoreCluster": { + "methods": ["restoreClusterAsync", "restoreClusterOperationCallable", "restoreClusterCallable"] + }, + "UpdateBackup": { + "methods": ["updateBackupAsync", "updateBackupAsync", "updateBackupOperationCallable", "updateBackupCallable"] + }, + "UpdateCluster": { + "methods": ["updateClusterAsync", "updateClusterAsync", "updateClusterOperationCallable", "updateClusterCallable"] + }, + "UpdateInstance": { + "methods": ["updateInstanceAsync", "updateInstanceAsync", "updateInstanceOperationCallable", "updateInstanceCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/package-info.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/package-info.java new file mode 100644 index 000000000000..82f0bd8b3959 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/package-info.java @@ -0,0 +1,43 @@ +/* + * 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 AlloyDB API + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================= AlloyDBAdminClient ======================= + * + *

Service Description: Service describing handlers for resources + * + *

Sample for AlloyDBAdminClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+ *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+ *   Cluster response = alloyDBAdminClient.getCluster(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.alloydb.v1beta; + +import javax.annotation.Generated; diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/AlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/AlloyDBAdminStub.java new file mode 100644 index 000000000000..970c049bf0ce --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/AlloyDBAdminStub.java @@ -0,0 +1,314 @@ +/* + * 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.alloydb.v1beta.stub; + +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.ConnectionInfo; +import com.google.cloud.alloydb.v1beta.CreateBackupRequest; +import com.google.cloud.alloydb.v1beta.CreateClusterRequest; +import com.google.cloud.alloydb.v1beta.CreateInstanceRequest; +import com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1beta.DeleteBackupRequest; +import com.google.cloud.alloydb.v1beta.DeleteClusterRequest; +import com.google.cloud.alloydb.v1beta.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1beta.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; +import com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; +import com.google.cloud.alloydb.v1beta.GetBackupRequest; +import com.google.cloud.alloydb.v1beta.GetClusterRequest; +import com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest; +import com.google.cloud.alloydb.v1beta.GetInstanceRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.ListBackupsRequest; +import com.google.cloud.alloydb.v1beta.ListBackupsResponse; +import com.google.cloud.alloydb.v1beta.ListClustersRequest; +import com.google.cloud.alloydb.v1beta.ListClustersResponse; +import com.google.cloud.alloydb.v1beta.ListInstancesRequest; +import com.google.cloud.alloydb.v1beta.ListInstancesResponse; +import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1beta.OperationMetadata; +import com.google.cloud.alloydb.v1beta.PromoteClusterRequest; +import com.google.cloud.alloydb.v1beta.RestartInstanceRequest; +import com.google.cloud.alloydb.v1beta.RestoreClusterRequest; +import com.google.cloud.alloydb.v1beta.UpdateBackupRequest; +import com.google.cloud.alloydb.v1beta.UpdateClusterRequest; +import com.google.cloud.alloydb.v1beta.UpdateInstanceRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the AlloyDBAdmin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class AlloyDBAdminStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable listClustersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listClustersPagedCallable()"); + } + + public UnaryCallable listClustersCallable() { + throw new UnsupportedOperationException("Not implemented: listClustersCallable()"); + } + + public UnaryCallable getClusterCallable() { + throw new UnsupportedOperationException("Not implemented: getClusterCallable()"); + } + + public OperationCallable + createClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createClusterOperationCallable()"); + } + + public UnaryCallable createClusterCallable() { + throw new UnsupportedOperationException("Not implemented: createClusterCallable()"); + } + + public OperationCallable + updateClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateClusterOperationCallable()"); + } + + public UnaryCallable updateClusterCallable() { + throw new UnsupportedOperationException("Not implemented: updateClusterCallable()"); + } + + public OperationCallable + deleteClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteClusterOperationCallable()"); + } + + public UnaryCallable deleteClusterCallable() { + throw new UnsupportedOperationException("Not implemented: deleteClusterCallable()"); + } + + public OperationCallable + promoteClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: promoteClusterOperationCallable()"); + } + + public UnaryCallable promoteClusterCallable() { + throw new UnsupportedOperationException("Not implemented: promoteClusterCallable()"); + } + + public OperationCallable + restoreClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: restoreClusterOperationCallable()"); + } + + public UnaryCallable restoreClusterCallable() { + throw new UnsupportedOperationException("Not implemented: restoreClusterCallable()"); + } + + public OperationCallable + createSecondaryClusterOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createSecondaryClusterOperationCallable()"); + } + + public UnaryCallable createSecondaryClusterCallable() { + throw new UnsupportedOperationException("Not implemented: createSecondaryClusterCallable()"); + } + + public UnaryCallable + listInstancesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesPagedCallable()"); + } + + public UnaryCallable listInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesCallable()"); + } + + public UnaryCallable getInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: getInstanceCallable()"); + } + + public OperationCallable + createInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceOperationCallable()"); + } + + public UnaryCallable createInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceCallable()"); + } + + public OperationCallable + createSecondaryInstanceOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createSecondaryInstanceOperationCallable()"); + } + + public UnaryCallable + createSecondaryInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: createSecondaryInstanceCallable()"); + } + + public OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: batchCreateInstancesOperationCallable()"); + } + + public UnaryCallable batchCreateInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: batchCreateInstancesCallable()"); + } + + public OperationCallable + updateInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceOperationCallable()"); + } + + public UnaryCallable updateInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceCallable()"); + } + + public OperationCallable + deleteInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceOperationCallable()"); + } + + public UnaryCallable deleteInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceCallable()"); + } + + public OperationCallable + failoverInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: failoverInstanceOperationCallable()"); + } + + public UnaryCallable failoverInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: failoverInstanceCallable()"); + } + + public OperationCallable + restartInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: restartInstanceOperationCallable()"); + } + + public UnaryCallable restartInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: restartInstanceCallable()"); + } + + public UnaryCallable listBackupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsPagedCallable()"); + } + + public UnaryCallable listBackupsCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsCallable()"); + } + + public UnaryCallable getBackupCallable() { + throw new UnsupportedOperationException("Not implemented: getBackupCallable()"); + } + + public OperationCallable + createBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupOperationCallable()"); + } + + public UnaryCallable createBackupCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupCallable()"); + } + + public OperationCallable + updateBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupOperationCallable()"); + } + + public UnaryCallable updateBackupCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupCallable()"); + } + + public OperationCallable + deleteBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupOperationCallable()"); + } + + public UnaryCallable deleteBackupCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupCallable()"); + } + + public UnaryCallable + listSupportedDatabaseFlagsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listSupportedDatabaseFlagsPagedCallable()"); + } + + public UnaryCallable + listSupportedDatabaseFlagsCallable() { + throw new UnsupportedOperationException( + "Not implemented: listSupportedDatabaseFlagsCallable()"); + } + + public UnaryCallable + generateClientCertificateCallable() { + throw new UnsupportedOperationException("Not implemented: generateClientCertificateCallable()"); + } + + public UnaryCallable getConnectionInfoCallable() { + throw new UnsupportedOperationException("Not implemented: getConnectionInfoCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/AlloyDBAdminStubSettings.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/AlloyDBAdminStubSettings.java new file mode 100644 index 000000000000..697ca14c75fd --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/AlloyDBAdminStubSettings.java @@ -0,0 +1,2066 @@ +/* + * 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.alloydb.v1beta.stub; + +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +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.grpc.ProtoOperationTransformers; +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.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.ConnectionInfo; +import com.google.cloud.alloydb.v1beta.CreateBackupRequest; +import com.google.cloud.alloydb.v1beta.CreateClusterRequest; +import com.google.cloud.alloydb.v1beta.CreateInstanceRequest; +import com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1beta.DeleteBackupRequest; +import com.google.cloud.alloydb.v1beta.DeleteClusterRequest; +import com.google.cloud.alloydb.v1beta.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1beta.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; +import com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; +import com.google.cloud.alloydb.v1beta.GetBackupRequest; +import com.google.cloud.alloydb.v1beta.GetClusterRequest; +import com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest; +import com.google.cloud.alloydb.v1beta.GetInstanceRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.ListBackupsRequest; +import com.google.cloud.alloydb.v1beta.ListBackupsResponse; +import com.google.cloud.alloydb.v1beta.ListClustersRequest; +import com.google.cloud.alloydb.v1beta.ListClustersResponse; +import com.google.cloud.alloydb.v1beta.ListInstancesRequest; +import com.google.cloud.alloydb.v1beta.ListInstancesResponse; +import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1beta.OperationMetadata; +import com.google.cloud.alloydb.v1beta.PromoteClusterRequest; +import com.google.cloud.alloydb.v1beta.RestartInstanceRequest; +import com.google.cloud.alloydb.v1beta.RestoreClusterRequest; +import com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag; +import com.google.cloud.alloydb.v1beta.UpdateBackupRequest; +import com.google.cloud.alloydb.v1beta.UpdateClusterRequest; +import com.google.cloud.alloydb.v1beta.UpdateInstanceRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import 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 AlloyDBAdminStub}. + * + *

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

    + *
  • The default service address (alloydb.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 getCluster 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
+ * AlloyDBAdminStubSettings.Builder alloyDBAdminSettingsBuilder =
+ *     AlloyDBAdminStubSettings.newBuilder();
+ * alloyDBAdminSettingsBuilder
+ *     .getClusterSettings()
+ *     .setRetrySettings(
+ *         alloyDBAdminSettingsBuilder
+ *             .getClusterSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AlloyDBAdminStubSettings alloyDBAdminSettings = alloyDBAdminSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class AlloyDBAdminStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings; + private final UnaryCallSettings getClusterSettings; + private final UnaryCallSettings createClusterSettings; + private final OperationCallSettings + createClusterOperationSettings; + private final UnaryCallSettings updateClusterSettings; + private final OperationCallSettings + updateClusterOperationSettings; + private final UnaryCallSettings deleteClusterSettings; + private final OperationCallSettings + deleteClusterOperationSettings; + private final UnaryCallSettings promoteClusterSettings; + private final OperationCallSettings + promoteClusterOperationSettings; + private final UnaryCallSettings restoreClusterSettings; + private final OperationCallSettings + restoreClusterOperationSettings; + private final UnaryCallSettings + createSecondaryClusterSettings; + private final OperationCallSettings + createSecondaryClusterOperationSettings; + private final PagedCallSettings< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings getInstanceSettings; + private final UnaryCallSettings createInstanceSettings; + private final OperationCallSettings + createInstanceOperationSettings; + private final UnaryCallSettings + createSecondaryInstanceSettings; + private final OperationCallSettings + createSecondaryInstanceOperationSettings; + private final UnaryCallSettings + batchCreateInstancesSettings; + private final OperationCallSettings< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings; + private final UnaryCallSettings updateInstanceSettings; + private final OperationCallSettings + updateInstanceOperationSettings; + private final UnaryCallSettings deleteInstanceSettings; + private final OperationCallSettings + deleteInstanceOperationSettings; + private final UnaryCallSettings failoverInstanceSettings; + private final OperationCallSettings + failoverInstanceOperationSettings; + private final UnaryCallSettings restartInstanceSettings; + private final OperationCallSettings + restartInstanceOperationSettings; + private final PagedCallSettings + listBackupsSettings; + private final UnaryCallSettings getBackupSettings; + private final UnaryCallSettings createBackupSettings; + private final OperationCallSettings + createBackupOperationSettings; + private final UnaryCallSettings updateBackupSettings; + private final OperationCallSettings + updateBackupOperationSettings; + private final UnaryCallSettings deleteBackupSettings; + private final OperationCallSettings + deleteBackupOperationSettings; + private final PagedCallSettings< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings; + private final UnaryCallSettings< + GenerateClientCertificateRequest, GenerateClientCertificateResponse> + generateClientCertificateSettings; + private final UnaryCallSettings + getConnectionInfoSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor + LIST_CLUSTERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListClustersRequest injectToken(ListClustersRequest payload, String token) { + return ListClustersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListClustersRequest injectPageSize(ListClustersRequest payload, int pageSize) { + return ListClustersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListClustersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListClustersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListClustersResponse payload) { + return payload.getClustersList() == null + ? ImmutableList.of() + : payload.getClustersList(); + } + }; + + private static final PagedListDescriptor + LIST_INSTANCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListInstancesRequest injectToken(ListInstancesRequest payload, String token) { + return ListInstancesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListInstancesRequest injectPageSize(ListInstancesRequest payload, int pageSize) { + return ListInstancesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListInstancesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListInstancesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListInstancesResponse payload) { + return payload.getInstancesList() == null + ? ImmutableList.of() + : payload.getInstancesList(); + } + }; + + private static final PagedListDescriptor + LIST_BACKUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBackupsRequest injectToken(ListBackupsRequest payload, String token) { + return ListBackupsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBackupsRequest injectPageSize(ListBackupsRequest payload, int pageSize) { + return ListBackupsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBackupsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBackupsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBackupsResponse payload) { + return payload.getBackupsList() == null + ? ImmutableList.of() + : payload.getBackupsList(); + } + }; + + private static final PagedListDescriptor< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_DESC = + new PagedListDescriptor< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSupportedDatabaseFlagsRequest injectToken( + ListSupportedDatabaseFlagsRequest payload, String token) { + return ListSupportedDatabaseFlagsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListSupportedDatabaseFlagsRequest injectPageSize( + ListSupportedDatabaseFlagsRequest payload, int pageSize) { + return ListSupportedDatabaseFlagsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListSupportedDatabaseFlagsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSupportedDatabaseFlagsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListSupportedDatabaseFlagsResponse payload) { + return payload.getSupportedDatabaseFlagsList() == null + ? ImmutableList.of() + : payload.getSupportedDatabaseFlagsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + LIST_CLUSTERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListClustersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CLUSTERS_PAGE_STR_DESC, request, context); + return ListClustersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + LIST_INSTANCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInstancesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INSTANCES_PAGE_STR_DESC, request, context); + return ListInstancesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + LIST_BACKUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBackupsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BACKUPS_PAGE_STR_DESC, request, context); + return ListBackupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListSupportedDatabaseFlagsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + SupportedDatabaseFlag> + pageContext = + PageContext.create( + callable, LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_DESC, request, context); + return ListSupportedDatabaseFlagsPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listClusters. */ + public PagedCallSettings + listClustersSettings() { + return listClustersSettings; + } + + /** Returns the object with the settings used for calls to getCluster. */ + public UnaryCallSettings getClusterSettings() { + return getClusterSettings; + } + + /** Returns the object with the settings used for calls to createCluster. */ + public UnaryCallSettings createClusterSettings() { + return createClusterSettings; + } + + /** Returns the object with the settings used for calls to createCluster. */ + public OperationCallSettings + createClusterOperationSettings() { + return createClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public UnaryCallSettings updateClusterSettings() { + return updateClusterSettings; + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public OperationCallSettings + updateClusterOperationSettings() { + return updateClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public UnaryCallSettings deleteClusterSettings() { + return deleteClusterSettings; + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public OperationCallSettings + deleteClusterOperationSettings() { + return deleteClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to promoteCluster. */ + public UnaryCallSettings promoteClusterSettings() { + return promoteClusterSettings; + } + + /** Returns the object with the settings used for calls to promoteCluster. */ + public OperationCallSettings + promoteClusterOperationSettings() { + return promoteClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to restoreCluster. */ + public UnaryCallSettings restoreClusterSettings() { + return restoreClusterSettings; + } + + /** Returns the object with the settings used for calls to restoreCluster. */ + public OperationCallSettings + restoreClusterOperationSettings() { + return restoreClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to createSecondaryCluster. */ + public UnaryCallSettings + createSecondaryClusterSettings() { + return createSecondaryClusterSettings; + } + + /** Returns the object with the settings used for calls to createSecondaryCluster. */ + public OperationCallSettings + createSecondaryClusterOperationSettings() { + return createSecondaryClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to createSecondaryInstance. */ + public UnaryCallSettings + createSecondaryInstanceSettings() { + return createSecondaryInstanceSettings; + } + + /** Returns the object with the settings used for calls to createSecondaryInstance. */ + public OperationCallSettings + createSecondaryInstanceOperationSettings() { + return createSecondaryInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to batchCreateInstances. */ + public UnaryCallSettings batchCreateInstancesSettings() { + return batchCreateInstancesSettings; + } + + /** Returns the object with the settings used for calls to batchCreateInstances. */ + public OperationCallSettings< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings() { + return batchCreateInstancesOperationSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public OperationCallSettings + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public OperationCallSettings + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to failoverInstance. */ + public UnaryCallSettings failoverInstanceSettings() { + return failoverInstanceSettings; + } + + /** Returns the object with the settings used for calls to failoverInstance. */ + public OperationCallSettings + failoverInstanceOperationSettings() { + return failoverInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to restartInstance. */ + public UnaryCallSettings restartInstanceSettings() { + return restartInstanceSettings; + } + + /** Returns the object with the settings used for calls to restartInstance. */ + public OperationCallSettings + restartInstanceOperationSettings() { + return restartInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return getBackupSettings; + } + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return createBackupSettings; + } + + /** Returns the object with the settings used for calls to createBackup. */ + public OperationCallSettings + createBackupOperationSettings() { + return createBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public OperationCallSettings + updateBackupOperationSettings() { + return updateBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return deleteBackupSettings; + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public OperationCallSettings + deleteBackupOperationSettings() { + return deleteBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to listSupportedDatabaseFlags. */ + public PagedCallSettings< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings() { + return listSupportedDatabaseFlagsSettings; + } + + /** Returns the object with the settings used for calls to generateClientCertificate. */ + public UnaryCallSettings + generateClientCertificateSettings() { + return generateClientCertificateSettings; + } + + /** Returns the object with the settings used for calls to getConnectionInfo. */ + public UnaryCallSettings getConnectionInfoSettings() { + return getConnectionInfoSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public AlloyDBAdminStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAlloyDBAdminStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonAlloyDBAdminStub.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 "alloydb.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "alloydb.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(AlloyDBAdminStubSettings.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(AlloyDBAdminStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AlloyDBAdminStubSettings.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 AlloyDBAdminStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listClustersSettings = settingsBuilder.listClustersSettings().build(); + getClusterSettings = settingsBuilder.getClusterSettings().build(); + createClusterSettings = settingsBuilder.createClusterSettings().build(); + createClusterOperationSettings = settingsBuilder.createClusterOperationSettings().build(); + updateClusterSettings = settingsBuilder.updateClusterSettings().build(); + updateClusterOperationSettings = settingsBuilder.updateClusterOperationSettings().build(); + deleteClusterSettings = settingsBuilder.deleteClusterSettings().build(); + deleteClusterOperationSettings = settingsBuilder.deleteClusterOperationSettings().build(); + promoteClusterSettings = settingsBuilder.promoteClusterSettings().build(); + promoteClusterOperationSettings = settingsBuilder.promoteClusterOperationSettings().build(); + restoreClusterSettings = settingsBuilder.restoreClusterSettings().build(); + restoreClusterOperationSettings = settingsBuilder.restoreClusterOperationSettings().build(); + createSecondaryClusterSettings = settingsBuilder.createSecondaryClusterSettings().build(); + createSecondaryClusterOperationSettings = + settingsBuilder.createSecondaryClusterOperationSettings().build(); + listInstancesSettings = settingsBuilder.listInstancesSettings().build(); + getInstanceSettings = settingsBuilder.getInstanceSettings().build(); + createInstanceSettings = settingsBuilder.createInstanceSettings().build(); + createInstanceOperationSettings = settingsBuilder.createInstanceOperationSettings().build(); + createSecondaryInstanceSettings = settingsBuilder.createSecondaryInstanceSettings().build(); + createSecondaryInstanceOperationSettings = + settingsBuilder.createSecondaryInstanceOperationSettings().build(); + batchCreateInstancesSettings = settingsBuilder.batchCreateInstancesSettings().build(); + batchCreateInstancesOperationSettings = + settingsBuilder.batchCreateInstancesOperationSettings().build(); + updateInstanceSettings = settingsBuilder.updateInstanceSettings().build(); + updateInstanceOperationSettings = settingsBuilder.updateInstanceOperationSettings().build(); + deleteInstanceSettings = settingsBuilder.deleteInstanceSettings().build(); + deleteInstanceOperationSettings = settingsBuilder.deleteInstanceOperationSettings().build(); + failoverInstanceSettings = settingsBuilder.failoverInstanceSettings().build(); + failoverInstanceOperationSettings = settingsBuilder.failoverInstanceOperationSettings().build(); + restartInstanceSettings = settingsBuilder.restartInstanceSettings().build(); + restartInstanceOperationSettings = settingsBuilder.restartInstanceOperationSettings().build(); + listBackupsSettings = settingsBuilder.listBackupsSettings().build(); + getBackupSettings = settingsBuilder.getBackupSettings().build(); + createBackupSettings = settingsBuilder.createBackupSettings().build(); + createBackupOperationSettings = settingsBuilder.createBackupOperationSettings().build(); + updateBackupSettings = settingsBuilder.updateBackupSettings().build(); + updateBackupOperationSettings = settingsBuilder.updateBackupOperationSettings().build(); + deleteBackupSettings = settingsBuilder.deleteBackupSettings().build(); + deleteBackupOperationSettings = settingsBuilder.deleteBackupOperationSettings().build(); + listSupportedDatabaseFlagsSettings = + settingsBuilder.listSupportedDatabaseFlagsSettings().build(); + generateClientCertificateSettings = settingsBuilder.generateClientCertificateSettings().build(); + getConnectionInfoSettings = settingsBuilder.getConnectionInfoSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for AlloyDBAdminStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings; + private final UnaryCallSettings.Builder getClusterSettings; + private final UnaryCallSettings.Builder createClusterSettings; + private final OperationCallSettings.Builder + createClusterOperationSettings; + private final UnaryCallSettings.Builder updateClusterSettings; + private final OperationCallSettings.Builder + updateClusterOperationSettings; + private final UnaryCallSettings.Builder deleteClusterSettings; + private final OperationCallSettings.Builder + deleteClusterOperationSettings; + private final UnaryCallSettings.Builder + promoteClusterSettings; + private final OperationCallSettings.Builder + promoteClusterOperationSettings; + private final UnaryCallSettings.Builder + restoreClusterSettings; + private final OperationCallSettings.Builder + restoreClusterOperationSettings; + private final UnaryCallSettings.Builder + createSecondaryClusterSettings; + private final OperationCallSettings.Builder< + CreateSecondaryClusterRequest, Cluster, OperationMetadata> + createSecondaryClusterOperationSettings; + private final PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings.Builder getInstanceSettings; + private final UnaryCallSettings.Builder + createInstanceSettings; + private final OperationCallSettings.Builder + createInstanceOperationSettings; + private final UnaryCallSettings.Builder + createSecondaryInstanceSettings; + private final OperationCallSettings.Builder< + CreateSecondaryInstanceRequest, Instance, OperationMetadata> + createSecondaryInstanceOperationSettings; + private final UnaryCallSettings.Builder + batchCreateInstancesSettings; + private final OperationCallSettings.Builder< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings; + private final UnaryCallSettings.Builder + updateInstanceSettings; + private final OperationCallSettings.Builder + updateInstanceOperationSettings; + private final UnaryCallSettings.Builder + deleteInstanceSettings; + private final OperationCallSettings.Builder + deleteInstanceOperationSettings; + private final UnaryCallSettings.Builder + failoverInstanceSettings; + private final OperationCallSettings.Builder< + FailoverInstanceRequest, Instance, OperationMetadata> + failoverInstanceOperationSettings; + private final UnaryCallSettings.Builder + restartInstanceSettings; + private final OperationCallSettings.Builder + restartInstanceOperationSettings; + private final PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings; + private final UnaryCallSettings.Builder getBackupSettings; + private final UnaryCallSettings.Builder createBackupSettings; + private final OperationCallSettings.Builder + createBackupOperationSettings; + private final UnaryCallSettings.Builder updateBackupSettings; + private final OperationCallSettings.Builder + updateBackupOperationSettings; + private final UnaryCallSettings.Builder deleteBackupSettings; + private final OperationCallSettings.Builder + deleteBackupOperationSettings; + private final PagedCallSettings.Builder< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings; + private final UnaryCallSettings.Builder< + GenerateClientCertificateRequest, GenerateClientCertificateResponse> + generateClientCertificateSettings; + private final UnaryCallSettings.Builder + getConnectionInfoSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + 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() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + 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); + + listClustersSettings = PagedCallSettings.newBuilder(LIST_CLUSTERS_PAGE_STR_FACT); + getClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createClusterOperationSettings = OperationCallSettings.newBuilder(); + updateClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateClusterOperationSettings = OperationCallSettings.newBuilder(); + deleteClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteClusterOperationSettings = OperationCallSettings.newBuilder(); + promoteClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + promoteClusterOperationSettings = OperationCallSettings.newBuilder(); + restoreClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restoreClusterOperationSettings = OperationCallSettings.newBuilder(); + createSecondaryClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSecondaryClusterOperationSettings = OperationCallSettings.newBuilder(); + listInstancesSettings = PagedCallSettings.newBuilder(LIST_INSTANCES_PAGE_STR_FACT); + getInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createInstanceOperationSettings = OperationCallSettings.newBuilder(); + createSecondaryInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSecondaryInstanceOperationSettings = OperationCallSettings.newBuilder(); + batchCreateInstancesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + batchCreateInstancesOperationSettings = OperationCallSettings.newBuilder(); + updateInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateInstanceOperationSettings = OperationCallSettings.newBuilder(); + deleteInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteInstanceOperationSettings = OperationCallSettings.newBuilder(); + failoverInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + failoverInstanceOperationSettings = OperationCallSettings.newBuilder(); + restartInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restartInstanceOperationSettings = OperationCallSettings.newBuilder(); + listBackupsSettings = PagedCallSettings.newBuilder(LIST_BACKUPS_PAGE_STR_FACT); + getBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createBackupOperationSettings = OperationCallSettings.newBuilder(); + updateBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateBackupOperationSettings = OperationCallSettings.newBuilder(); + deleteBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBackupOperationSettings = OperationCallSettings.newBuilder(); + listSupportedDatabaseFlagsSettings = + PagedCallSettings.newBuilder(LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_FACT); + generateClientCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getConnectionInfoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listClustersSettings, + getClusterSettings, + createClusterSettings, + updateClusterSettings, + deleteClusterSettings, + promoteClusterSettings, + restoreClusterSettings, + createSecondaryClusterSettings, + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + createSecondaryInstanceSettings, + batchCreateInstancesSettings, + updateInstanceSettings, + deleteInstanceSettings, + failoverInstanceSettings, + restartInstanceSettings, + listBackupsSettings, + getBackupSettings, + createBackupSettings, + updateBackupSettings, + deleteBackupSettings, + listSupportedDatabaseFlagsSettings, + generateClientCertificateSettings, + getConnectionInfoSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(AlloyDBAdminStubSettings settings) { + super(settings); + + listClustersSettings = settings.listClustersSettings.toBuilder(); + getClusterSettings = settings.getClusterSettings.toBuilder(); + createClusterSettings = settings.createClusterSettings.toBuilder(); + createClusterOperationSettings = settings.createClusterOperationSettings.toBuilder(); + updateClusterSettings = settings.updateClusterSettings.toBuilder(); + updateClusterOperationSettings = settings.updateClusterOperationSettings.toBuilder(); + deleteClusterSettings = settings.deleteClusterSettings.toBuilder(); + deleteClusterOperationSettings = settings.deleteClusterOperationSettings.toBuilder(); + promoteClusterSettings = settings.promoteClusterSettings.toBuilder(); + promoteClusterOperationSettings = settings.promoteClusterOperationSettings.toBuilder(); + restoreClusterSettings = settings.restoreClusterSettings.toBuilder(); + restoreClusterOperationSettings = settings.restoreClusterOperationSettings.toBuilder(); + createSecondaryClusterSettings = settings.createSecondaryClusterSettings.toBuilder(); + createSecondaryClusterOperationSettings = + settings.createSecondaryClusterOperationSettings.toBuilder(); + listInstancesSettings = settings.listInstancesSettings.toBuilder(); + getInstanceSettings = settings.getInstanceSettings.toBuilder(); + createInstanceSettings = settings.createInstanceSettings.toBuilder(); + createInstanceOperationSettings = settings.createInstanceOperationSettings.toBuilder(); + createSecondaryInstanceSettings = settings.createSecondaryInstanceSettings.toBuilder(); + createSecondaryInstanceOperationSettings = + settings.createSecondaryInstanceOperationSettings.toBuilder(); + batchCreateInstancesSettings = settings.batchCreateInstancesSettings.toBuilder(); + batchCreateInstancesOperationSettings = + settings.batchCreateInstancesOperationSettings.toBuilder(); + updateInstanceSettings = settings.updateInstanceSettings.toBuilder(); + updateInstanceOperationSettings = settings.updateInstanceOperationSettings.toBuilder(); + deleteInstanceSettings = settings.deleteInstanceSettings.toBuilder(); + deleteInstanceOperationSettings = settings.deleteInstanceOperationSettings.toBuilder(); + failoverInstanceSettings = settings.failoverInstanceSettings.toBuilder(); + failoverInstanceOperationSettings = settings.failoverInstanceOperationSettings.toBuilder(); + restartInstanceSettings = settings.restartInstanceSettings.toBuilder(); + restartInstanceOperationSettings = settings.restartInstanceOperationSettings.toBuilder(); + listBackupsSettings = settings.listBackupsSettings.toBuilder(); + getBackupSettings = settings.getBackupSettings.toBuilder(); + createBackupSettings = settings.createBackupSettings.toBuilder(); + createBackupOperationSettings = settings.createBackupOperationSettings.toBuilder(); + updateBackupSettings = settings.updateBackupSettings.toBuilder(); + updateBackupOperationSettings = settings.updateBackupOperationSettings.toBuilder(); + deleteBackupSettings = settings.deleteBackupSettings.toBuilder(); + deleteBackupOperationSettings = settings.deleteBackupOperationSettings.toBuilder(); + listSupportedDatabaseFlagsSettings = settings.listSupportedDatabaseFlagsSettings.toBuilder(); + generateClientCertificateSettings = settings.generateClientCertificateSettings.toBuilder(); + getConnectionInfoSettings = settings.getConnectionInfoSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listClustersSettings, + getClusterSettings, + createClusterSettings, + updateClusterSettings, + deleteClusterSettings, + promoteClusterSettings, + restoreClusterSettings, + createSecondaryClusterSettings, + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + createSecondaryInstanceSettings, + batchCreateInstancesSettings, + updateInstanceSettings, + deleteInstanceSettings, + failoverInstanceSettings, + restartInstanceSettings, + listBackupsSettings, + getBackupSettings, + createBackupSettings, + updateBackupSettings, + deleteBackupSettings, + listSupportedDatabaseFlagsSettings, + generateClientCertificateSettings, + getConnectionInfoSettings, + listLocationsSettings, + getLocationSettings); + } + + 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 + .listClustersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .promoteClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .restoreClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createSecondaryClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createSecondaryInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .batchCreateInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .failoverInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .restartInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listBackupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listSupportedDatabaseFlagsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .generateClientCertificateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getConnectionInfoSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .promoteClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .restoreClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createSecondaryClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createSecondaryInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .batchCreateInstancesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + BatchCreateInstancesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .failoverInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .restartInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createBackupOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Backup.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateBackupOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Backup.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteBackupOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * 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 listClusters. */ + public PagedCallSettings.Builder< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings() { + return listClustersSettings; + } + + /** Returns the builder for the settings used for calls to getCluster. */ + public UnaryCallSettings.Builder getClusterSettings() { + return getClusterSettings; + } + + /** Returns the builder for the settings used for calls to createCluster. */ + public UnaryCallSettings.Builder createClusterSettings() { + return createClusterSettings; + } + + /** Returns the builder for the settings used for calls to createCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createClusterOperationSettings() { + return createClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + public UnaryCallSettings.Builder updateClusterSettings() { + return updateClusterSettings; + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateClusterOperationSettings() { + return updateClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteCluster. */ + public UnaryCallSettings.Builder deleteClusterSettings() { + return deleteClusterSettings; + } + + /** Returns the builder for the settings used for calls to deleteCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteClusterOperationSettings() { + return deleteClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to promoteCluster. */ + public UnaryCallSettings.Builder promoteClusterSettings() { + return promoteClusterSettings; + } + + /** Returns the builder for the settings used for calls to promoteCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + promoteClusterOperationSettings() { + return promoteClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to restoreCluster. */ + public UnaryCallSettings.Builder restoreClusterSettings() { + return restoreClusterSettings; + } + + /** Returns the builder for the settings used for calls to restoreCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + restoreClusterOperationSettings() { + return restoreClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to createSecondaryCluster. */ + public UnaryCallSettings.Builder + createSecondaryClusterSettings() { + return createSecondaryClusterSettings; + } + + /** Returns the builder for the settings used for calls to createSecondaryCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createSecondaryClusterOperationSettings() { + return createSecondaryClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to createSecondaryInstance. */ + public UnaryCallSettings.Builder + createSecondaryInstanceSettings() { + return createSecondaryInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createSecondaryInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateSecondaryInstanceRequest, Instance, OperationMetadata> + createSecondaryInstanceOperationSettings() { + return createSecondaryInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to batchCreateInstances. */ + public UnaryCallSettings.Builder + batchCreateInstancesSettings() { + return batchCreateInstancesSettings; + } + + /** Returns the builder for the settings used for calls to batchCreateInstances. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationSettings() { + return batchCreateInstancesOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to failoverInstance. */ + public UnaryCallSettings.Builder + failoverInstanceSettings() { + return failoverInstanceSettings; + } + + /** Returns the builder for the settings used for calls to failoverInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + failoverInstanceOperationSettings() { + return failoverInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to restartInstance. */ + public UnaryCallSettings.Builder restartInstanceSettings() { + return restartInstanceSettings; + } + + /** Returns the builder for the settings used for calls to restartInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + restartInstanceOperationSettings() { + return restartInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getBackupSettings; + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return createBackupSettings; + } + + /** Returns the builder for the settings used for calls to createBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createBackupOperationSettings() { + return createBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateBackupOperationSettings() { + return updateBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return deleteBackupSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteBackupOperationSettings() { + return deleteBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to listSupportedDatabaseFlags. */ + public PagedCallSettings.Builder< + ListSupportedDatabaseFlagsRequest, + ListSupportedDatabaseFlagsResponse, + ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsSettings() { + return listSupportedDatabaseFlagsSettings; + } + + /** Returns the builder for the settings used for calls to generateClientCertificate. */ + public UnaryCallSettings.Builder< + GenerateClientCertificateRequest, GenerateClientCertificateResponse> + generateClientCertificateSettings() { + return generateClientCertificateSettings; + } + + /** Returns the builder for the settings used for calls to getConnectionInfo. */ + public UnaryCallSettings.Builder + getConnectionInfoSettings() { + return getConnectionInfoSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + @Override + public AlloyDBAdminStubSettings build() throws IOException { + return new AlloyDBAdminStubSettings(this); + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/GrpcAlloyDBAdminCallableFactory.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/GrpcAlloyDBAdminCallableFactory.java new file mode 100644 index 000000000000..65a65ba8932b --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/GrpcAlloyDBAdminCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.alloydb.v1beta.stub; + +import com.google.api.core.BetaApi; +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 AlloyDBAdmin service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcAlloyDBAdminCallableFactory 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-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/GrpcAlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/GrpcAlloyDBAdminStub.java new file mode 100644 index 000000000000..a83adcbfdfb5 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/GrpcAlloyDBAdminStub.java @@ -0,0 +1,1269 @@ +/* + * 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.alloydb.v1beta.stub; + +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.ConnectionInfo; +import com.google.cloud.alloydb.v1beta.CreateBackupRequest; +import com.google.cloud.alloydb.v1beta.CreateClusterRequest; +import com.google.cloud.alloydb.v1beta.CreateInstanceRequest; +import com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1beta.DeleteBackupRequest; +import com.google.cloud.alloydb.v1beta.DeleteClusterRequest; +import com.google.cloud.alloydb.v1beta.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1beta.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; +import com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; +import com.google.cloud.alloydb.v1beta.GetBackupRequest; +import com.google.cloud.alloydb.v1beta.GetClusterRequest; +import com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest; +import com.google.cloud.alloydb.v1beta.GetInstanceRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.ListBackupsRequest; +import com.google.cloud.alloydb.v1beta.ListBackupsResponse; +import com.google.cloud.alloydb.v1beta.ListClustersRequest; +import com.google.cloud.alloydb.v1beta.ListClustersResponse; +import com.google.cloud.alloydb.v1beta.ListInstancesRequest; +import com.google.cloud.alloydb.v1beta.ListInstancesResponse; +import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1beta.OperationMetadata; +import com.google.cloud.alloydb.v1beta.PromoteClusterRequest; +import com.google.cloud.alloydb.v1beta.RestartInstanceRequest; +import com.google.cloud.alloydb.v1beta.RestoreClusterRequest; +import com.google.cloud.alloydb.v1beta.UpdateBackupRequest; +import com.google.cloud.alloydb.v1beta.UpdateClusterRequest; +import com.google.cloud.alloydb.v1beta.UpdateInstanceRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +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 AlloyDBAdmin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { + private static final MethodDescriptor + listClustersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/ListClusters") + .setRequestMarshaller(ProtoUtils.marshaller(ListClustersRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListClustersResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/GetCluster") + .setRequestMarshaller(ProtoUtils.marshaller(GetClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Cluster.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/CreateCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/UpdateCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/DeleteCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + promoteClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/PromoteCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(PromoteClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + restoreClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/RestoreCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(RestoreClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createSecondaryClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/CreateSecondaryCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSecondaryClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listInstancesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/ListInstances") + .setRequestMarshaller( + ProtoUtils.marshaller(ListInstancesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListInstancesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/GetInstance") + .setRequestMarshaller(ProtoUtils.marshaller(GetInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Instance.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/CreateInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createSecondaryInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/CreateSecondaryInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSecondaryInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + batchCreateInstancesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/BatchCreateInstances") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchCreateInstancesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/UpdateInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/DeleteInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + failoverInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/FailoverInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(FailoverInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + restartInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/RestartInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(RestartInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listBackupsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/ListBackups") + .setRequestMarshaller(ProtoUtils.marshaller(ListBackupsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListBackupsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/GetBackup") + .setRequestMarshaller(ProtoUtils.marshaller(GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Backup.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/CreateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/UpdateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/DeleteBackup") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsResponse> + listSupportedDatabaseFlagsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.alloydb.v1beta.AlloyDBAdmin/ListSupportedDatabaseFlags") + .setRequestMarshaller( + ProtoUtils.marshaller(ListSupportedDatabaseFlagsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSupportedDatabaseFlagsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + GenerateClientCertificateRequest, GenerateClientCertificateResponse> + generateClientCertificateMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.alloydb.v1beta.AlloyDBAdmin/GenerateClientCertificate") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateClientCertificateRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateClientCertificateResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getConnectionInfoMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/GetConnectionInfo") + .setRequestMarshaller( + ProtoUtils.marshaller(GetConnectionInfoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ConnectionInfo.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private final UnaryCallable listClustersCallable; + private final UnaryCallable + listClustersPagedCallable; + private final UnaryCallable getClusterCallable; + private final UnaryCallable createClusterCallable; + private final OperationCallable + createClusterOperationCallable; + private final UnaryCallable updateClusterCallable; + private final OperationCallable + updateClusterOperationCallable; + private final UnaryCallable deleteClusterCallable; + private final OperationCallable + deleteClusterOperationCallable; + private final UnaryCallable promoteClusterCallable; + private final OperationCallable + promoteClusterOperationCallable; + private final UnaryCallable restoreClusterCallable; + private final OperationCallable + restoreClusterOperationCallable; + private final UnaryCallable + createSecondaryClusterCallable; + private final OperationCallable + createSecondaryClusterOperationCallable; + private final UnaryCallable listInstancesCallable; + private final UnaryCallable + listInstancesPagedCallable; + private final UnaryCallable getInstanceCallable; + private final UnaryCallable createInstanceCallable; + private final OperationCallable + createInstanceOperationCallable; + private final UnaryCallable + createSecondaryInstanceCallable; + private final OperationCallable + createSecondaryInstanceOperationCallable; + private final UnaryCallable batchCreateInstancesCallable; + private final OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable; + private final UnaryCallable updateInstanceCallable; + private final OperationCallable + updateInstanceOperationCallable; + private final UnaryCallable deleteInstanceCallable; + private final OperationCallable + deleteInstanceOperationCallable; + private final UnaryCallable failoverInstanceCallable; + private final OperationCallable + failoverInstanceOperationCallable; + private final UnaryCallable restartInstanceCallable; + private final OperationCallable + restartInstanceOperationCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable + listBackupsPagedCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable createBackupCallable; + private final OperationCallable + createBackupOperationCallable; + private final UnaryCallable updateBackupCallable; + private final OperationCallable + updateBackupOperationCallable; + private final UnaryCallable deleteBackupCallable; + private final OperationCallable + deleteBackupOperationCallable; + private final UnaryCallable + listSupportedDatabaseFlagsCallable; + private final UnaryCallable< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsPagedCallable; + private final UnaryCallable + generateClientCertificateCallable; + private final UnaryCallable getConnectionInfoCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAlloyDBAdminStub create(AlloyDBAdminStubSettings settings) + throws IOException { + return new GrpcAlloyDBAdminStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAlloyDBAdminStub create(ClientContext clientContext) throws IOException { + return new GrpcAlloyDBAdminStub(AlloyDBAdminStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAlloyDBAdminStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAlloyDBAdminStub( + AlloyDBAdminStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAlloyDBAdminStub, 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 GrpcAlloyDBAdminStub(AlloyDBAdminStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcAlloyDBAdminCallableFactory()); + } + + /** + * Constructs an instance of GrpcAlloyDBAdminStub, 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 GrpcAlloyDBAdminStub( + AlloyDBAdminStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listClustersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listClustersMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("cluster.name", String.valueOf(request.getCluster().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings promoteClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(promoteClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings restoreClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restoreClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + createSecondaryClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSecondaryClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings listInstancesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listInstancesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + createSecondaryInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSecondaryInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings batchCreateInstancesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchCreateInstancesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("instance.name", String.valueOf(request.getInstance().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings failoverInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(failoverInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings restartInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restartInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listBackupsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBackupMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBackupMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("backup.name", String.valueOf(request.getBackup().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listSupportedDatabaseFlagsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listSupportedDatabaseFlagsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + generateClientCertificateTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(generateClientCertificateMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getConnectionInfoTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getConnectionInfoMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + + this.listClustersCallable = + callableFactory.createUnaryCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.listClustersPagedCallable = + callableFactory.createPagedCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.getClusterCallable = + callableFactory.createUnaryCallable( + getClusterTransportSettings, settings.getClusterSettings(), clientContext); + this.createClusterCallable = + callableFactory.createUnaryCallable( + createClusterTransportSettings, settings.createClusterSettings(), clientContext); + this.createClusterOperationCallable = + callableFactory.createOperationCallable( + createClusterTransportSettings, + settings.createClusterOperationSettings(), + clientContext, + operationsStub); + this.updateClusterCallable = + callableFactory.createUnaryCallable( + updateClusterTransportSettings, settings.updateClusterSettings(), clientContext); + this.updateClusterOperationCallable = + callableFactory.createOperationCallable( + updateClusterTransportSettings, + settings.updateClusterOperationSettings(), + clientContext, + operationsStub); + this.deleteClusterCallable = + callableFactory.createUnaryCallable( + deleteClusterTransportSettings, settings.deleteClusterSettings(), clientContext); + this.deleteClusterOperationCallable = + callableFactory.createOperationCallable( + deleteClusterTransportSettings, + settings.deleteClusterOperationSettings(), + clientContext, + operationsStub); + this.promoteClusterCallable = + callableFactory.createUnaryCallable( + promoteClusterTransportSettings, settings.promoteClusterSettings(), clientContext); + this.promoteClusterOperationCallable = + callableFactory.createOperationCallable( + promoteClusterTransportSettings, + settings.promoteClusterOperationSettings(), + clientContext, + operationsStub); + this.restoreClusterCallable = + callableFactory.createUnaryCallable( + restoreClusterTransportSettings, settings.restoreClusterSettings(), clientContext); + this.restoreClusterOperationCallable = + callableFactory.createOperationCallable( + restoreClusterTransportSettings, + settings.restoreClusterOperationSettings(), + clientContext, + operationsStub); + this.createSecondaryClusterCallable = + callableFactory.createUnaryCallable( + createSecondaryClusterTransportSettings, + settings.createSecondaryClusterSettings(), + clientContext); + this.createSecondaryClusterOperationCallable = + callableFactory.createOperationCallable( + createSecondaryClusterTransportSettings, + settings.createSecondaryClusterOperationSettings(), + clientContext, + operationsStub); + this.listInstancesCallable = + callableFactory.createUnaryCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.listInstancesPagedCallable = + callableFactory.createPagedCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.getInstanceCallable = + callableFactory.createUnaryCallable( + getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); + this.createInstanceCallable = + callableFactory.createUnaryCallable( + createInstanceTransportSettings, settings.createInstanceSettings(), clientContext); + this.createInstanceOperationCallable = + callableFactory.createOperationCallable( + createInstanceTransportSettings, + settings.createInstanceOperationSettings(), + clientContext, + operationsStub); + this.createSecondaryInstanceCallable = + callableFactory.createUnaryCallable( + createSecondaryInstanceTransportSettings, + settings.createSecondaryInstanceSettings(), + clientContext); + this.createSecondaryInstanceOperationCallable = + callableFactory.createOperationCallable( + createSecondaryInstanceTransportSettings, + settings.createSecondaryInstanceOperationSettings(), + clientContext, + operationsStub); + this.batchCreateInstancesCallable = + callableFactory.createUnaryCallable( + batchCreateInstancesTransportSettings, + settings.batchCreateInstancesSettings(), + clientContext); + this.batchCreateInstancesOperationCallable = + callableFactory.createOperationCallable( + batchCreateInstancesTransportSettings, + settings.batchCreateInstancesOperationSettings(), + clientContext, + operationsStub); + this.updateInstanceCallable = + callableFactory.createUnaryCallable( + updateInstanceTransportSettings, settings.updateInstanceSettings(), clientContext); + this.updateInstanceOperationCallable = + callableFactory.createOperationCallable( + updateInstanceTransportSettings, + settings.updateInstanceOperationSettings(), + clientContext, + operationsStub); + this.deleteInstanceCallable = + callableFactory.createUnaryCallable( + deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); + this.deleteInstanceOperationCallable = + callableFactory.createOperationCallable( + deleteInstanceTransportSettings, + settings.deleteInstanceOperationSettings(), + clientContext, + operationsStub); + this.failoverInstanceCallable = + callableFactory.createUnaryCallable( + failoverInstanceTransportSettings, settings.failoverInstanceSettings(), clientContext); + this.failoverInstanceOperationCallable = + callableFactory.createOperationCallable( + failoverInstanceTransportSettings, + settings.failoverInstanceOperationSettings(), + clientContext, + operationsStub); + this.restartInstanceCallable = + callableFactory.createUnaryCallable( + restartInstanceTransportSettings, settings.restartInstanceSettings(), clientContext); + this.restartInstanceOperationCallable = + callableFactory.createOperationCallable( + restartInstanceTransportSettings, + settings.restartInstanceOperationSettings(), + clientContext, + operationsStub); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.listBackupsPagedCallable = + callableFactory.createPagedCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.createBackupCallable = + callableFactory.createUnaryCallable( + createBackupTransportSettings, settings.createBackupSettings(), clientContext); + this.createBackupOperationCallable = + callableFactory.createOperationCallable( + createBackupTransportSettings, + settings.createBackupOperationSettings(), + clientContext, + operationsStub); + this.updateBackupCallable = + callableFactory.createUnaryCallable( + updateBackupTransportSettings, settings.updateBackupSettings(), clientContext); + this.updateBackupOperationCallable = + callableFactory.createOperationCallable( + updateBackupTransportSettings, + settings.updateBackupOperationSettings(), + clientContext, + operationsStub); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + this.deleteBackupOperationCallable = + callableFactory.createOperationCallable( + deleteBackupTransportSettings, + settings.deleteBackupOperationSettings(), + clientContext, + operationsStub); + this.listSupportedDatabaseFlagsCallable = + callableFactory.createUnaryCallable( + listSupportedDatabaseFlagsTransportSettings, + settings.listSupportedDatabaseFlagsSettings(), + clientContext); + this.listSupportedDatabaseFlagsPagedCallable = + callableFactory.createPagedCallable( + listSupportedDatabaseFlagsTransportSettings, + settings.listSupportedDatabaseFlagsSettings(), + clientContext); + this.generateClientCertificateCallable = + callableFactory.createUnaryCallable( + generateClientCertificateTransportSettings, + settings.generateClientCertificateSettings(), + clientContext); + this.getConnectionInfoCallable = + callableFactory.createUnaryCallable( + getConnectionInfoTransportSettings, + settings.getConnectionInfoSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listClustersCallable() { + return listClustersCallable; + } + + @Override + public UnaryCallable listClustersPagedCallable() { + return listClustersPagedCallable; + } + + @Override + public UnaryCallable getClusterCallable() { + return getClusterCallable; + } + + @Override + public UnaryCallable createClusterCallable() { + return createClusterCallable; + } + + @Override + public OperationCallable + createClusterOperationCallable() { + return createClusterOperationCallable; + } + + @Override + public UnaryCallable updateClusterCallable() { + return updateClusterCallable; + } + + @Override + public OperationCallable + updateClusterOperationCallable() { + return updateClusterOperationCallable; + } + + @Override + public UnaryCallable deleteClusterCallable() { + return deleteClusterCallable; + } + + @Override + public OperationCallable + deleteClusterOperationCallable() { + return deleteClusterOperationCallable; + } + + @Override + public UnaryCallable promoteClusterCallable() { + return promoteClusterCallable; + } + + @Override + public OperationCallable + promoteClusterOperationCallable() { + return promoteClusterOperationCallable; + } + + @Override + public UnaryCallable restoreClusterCallable() { + return restoreClusterCallable; + } + + @Override + public OperationCallable + restoreClusterOperationCallable() { + return restoreClusterOperationCallable; + } + + @Override + public UnaryCallable createSecondaryClusterCallable() { + return createSecondaryClusterCallable; + } + + @Override + public OperationCallable + createSecondaryClusterOperationCallable() { + return createSecondaryClusterOperationCallable; + } + + @Override + public UnaryCallable listInstancesCallable() { + return listInstancesCallable; + } + + @Override + public UnaryCallable + listInstancesPagedCallable() { + return listInstancesPagedCallable; + } + + @Override + public UnaryCallable getInstanceCallable() { + return getInstanceCallable; + } + + @Override + public UnaryCallable createInstanceCallable() { + return createInstanceCallable; + } + + @Override + public OperationCallable + createInstanceOperationCallable() { + return createInstanceOperationCallable; + } + + @Override + public UnaryCallable + createSecondaryInstanceCallable() { + return createSecondaryInstanceCallable; + } + + @Override + public OperationCallable + createSecondaryInstanceOperationCallable() { + return createSecondaryInstanceOperationCallable; + } + + @Override + public UnaryCallable batchCreateInstancesCallable() { + return batchCreateInstancesCallable; + } + + @Override + public OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable() { + return batchCreateInstancesOperationCallable; + } + + @Override + public UnaryCallable updateInstanceCallable() { + return updateInstanceCallable; + } + + @Override + public OperationCallable + updateInstanceOperationCallable() { + return updateInstanceOperationCallable; + } + + @Override + public UnaryCallable deleteInstanceCallable() { + return deleteInstanceCallable; + } + + @Override + public OperationCallable + deleteInstanceOperationCallable() { + return deleteInstanceOperationCallable; + } + + @Override + public UnaryCallable failoverInstanceCallable() { + return failoverInstanceCallable; + } + + @Override + public OperationCallable + failoverInstanceOperationCallable() { + return failoverInstanceOperationCallable; + } + + @Override + public UnaryCallable restartInstanceCallable() { + return restartInstanceCallable; + } + + @Override + public OperationCallable + restartInstanceOperationCallable() { + return restartInstanceOperationCallable; + } + + @Override + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @Override + public UnaryCallable listBackupsPagedCallable() { + return listBackupsPagedCallable; + } + + @Override + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + @Override + public UnaryCallable createBackupCallable() { + return createBackupCallable; + } + + @Override + public OperationCallable + createBackupOperationCallable() { + return createBackupOperationCallable; + } + + @Override + public UnaryCallable updateBackupCallable() { + return updateBackupCallable; + } + + @Override + public OperationCallable + updateBackupOperationCallable() { + return updateBackupOperationCallable; + } + + @Override + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + @Override + public OperationCallable + deleteBackupOperationCallable() { + return deleteBackupOperationCallable; + } + + @Override + public UnaryCallable + listSupportedDatabaseFlagsCallable() { + return listSupportedDatabaseFlagsCallable; + } + + @Override + public UnaryCallable + listSupportedDatabaseFlagsPagedCallable() { + return listSupportedDatabaseFlagsPagedCallable; + } + + @Override + public UnaryCallable + generateClientCertificateCallable() { + return generateClientCertificateCallable; + } + + @Override + public UnaryCallable getConnectionInfoCallable() { + return getConnectionInfoCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @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-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/HttpJsonAlloyDBAdminCallableFactory.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/HttpJsonAlloyDBAdminCallableFactory.java new file mode 100644 index 000000000000..b84acf185d76 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/HttpJsonAlloyDBAdminCallableFactory.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.alloydb.v1beta.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 AlloyDBAdmin service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonAlloyDBAdminCallableFactory + 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-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/HttpJsonAlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/HttpJsonAlloyDBAdminStub.java new file mode 100644 index 000000000000..51acba819c2e --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/HttpJsonAlloyDBAdminStub.java @@ -0,0 +1,2006 @@ +/* + * 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.alloydb.v1beta.stub; + +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +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.HttpJsonOperationSnapshot; +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.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.ConnectionInfo; +import com.google.cloud.alloydb.v1beta.CreateBackupRequest; +import com.google.cloud.alloydb.v1beta.CreateClusterRequest; +import com.google.cloud.alloydb.v1beta.CreateInstanceRequest; +import com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1beta.DeleteBackupRequest; +import com.google.cloud.alloydb.v1beta.DeleteClusterRequest; +import com.google.cloud.alloydb.v1beta.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1beta.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; +import com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; +import com.google.cloud.alloydb.v1beta.GetBackupRequest; +import com.google.cloud.alloydb.v1beta.GetClusterRequest; +import com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest; +import com.google.cloud.alloydb.v1beta.GetInstanceRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.ListBackupsRequest; +import com.google.cloud.alloydb.v1beta.ListBackupsResponse; +import com.google.cloud.alloydb.v1beta.ListClustersRequest; +import com.google.cloud.alloydb.v1beta.ListClustersResponse; +import com.google.cloud.alloydb.v1beta.ListInstancesRequest; +import com.google.cloud.alloydb.v1beta.ListInstancesResponse; +import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1beta.OperationMetadata; +import com.google.cloud.alloydb.v1beta.PromoteClusterRequest; +import com.google.cloud.alloydb.v1beta.RestartInstanceRequest; +import com.google.cloud.alloydb.v1beta.RestoreClusterRequest; +import com.google.cloud.alloydb.v1beta.UpdateBackupRequest; +import com.google.cloud.alloydb.v1beta.UpdateClusterRequest; +import com.google.cloud.alloydb.v1beta.UpdateInstanceRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.longrunning.Operation; +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 AlloyDBAdmin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Backup.getDescriptor()) + .add(Empty.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .add(Cluster.getDescriptor()) + .add(BatchCreateInstancesResponse.getDescriptor()) + .add(Instance.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listClustersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/ListClusters") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/clusters", + 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, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListClustersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/GetCluster") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/clusters/*}", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Cluster.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/CreateCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/clusters", + 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, "clusterId", request.getClusterId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("cluster", request.getCluster(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/UpdateCluster") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{cluster.name=projects/*/locations/*/clusters/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "cluster.name", request.getCluster().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("cluster", request.getCluster(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/DeleteCluster") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/clusters/*}", + 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(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam(fields, "force", request.getForce()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + promoteClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/PromoteCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/clusters/*}:promote", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (PromoteClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + restoreClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/RestoreCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/clusters:restore", + 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, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (RestoreClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + createSecondaryClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/CreateSecondaryCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/clusters:createsecondary", + 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, "clusterId", request.getClusterId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("cluster", request.getCluster(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateSecondaryClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/ListInstances") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances", + 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, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListInstancesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/GetInstance") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}", + 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(); + serializer.putQueryParam(fields, "view", request.getViewValue()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Instance.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/CreateInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances", + 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, "instanceId", request.getInstanceId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("instance", request.getInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + createSecondaryInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/CreateSecondaryInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", + 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, "instanceId", request.getInstanceId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("instance", request.getInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateSecondaryInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + batchCreateInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/BatchCreateInstances") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate", + 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, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("requests", request.getRequests(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (BatchCreateInstancesRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/UpdateInstance") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{instance.name=projects/*/locations/*/clusters/*/instances/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "instance.name", request.getInstance().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("instance", request.getInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/DeleteInstance") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}", + 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(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + failoverInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/FailoverInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:failover", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (FailoverInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + restartInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/RestartInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:restart", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (RestartInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listBackupsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/ListBackups") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/backups", + 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, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListBackupsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/GetBackup") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/backups/*}", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Backup.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/CreateBackup") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/backups", + 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, "backupId", request.getBackupId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("backup", request.getBackup(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateBackupRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/UpdateBackup") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{backup.name=projects/*/locations/*/backups/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "backup.name", request.getBackup().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("backup", request.getBackup(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateBackupRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/DeleteBackup") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/backups/*}", + 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(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteBackupRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsResponse> + listSupportedDatabaseFlagsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.alloydb.v1beta.AlloyDBAdmin/ListSupportedDatabaseFlags") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags", + 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()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSupportedDatabaseFlagsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + GenerateClientCertificateRequest, GenerateClientCertificateResponse> + generateClientCertificateMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.alloydb.v1beta.AlloyDBAdmin/GenerateClientCertificate") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", + 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, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateClientCertificateResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getConnectionInfoMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/GetConnectionInfo") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo", + 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, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ConnectionInfo.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*}/locations", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*}", + 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(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listClustersCallable; + private final UnaryCallable + listClustersPagedCallable; + private final UnaryCallable getClusterCallable; + private final UnaryCallable createClusterCallable; + private final OperationCallable + createClusterOperationCallable; + private final UnaryCallable updateClusterCallable; + private final OperationCallable + updateClusterOperationCallable; + private final UnaryCallable deleteClusterCallable; + private final OperationCallable + deleteClusterOperationCallable; + private final UnaryCallable promoteClusterCallable; + private final OperationCallable + promoteClusterOperationCallable; + private final UnaryCallable restoreClusterCallable; + private final OperationCallable + restoreClusterOperationCallable; + private final UnaryCallable + createSecondaryClusterCallable; + private final OperationCallable + createSecondaryClusterOperationCallable; + private final UnaryCallable listInstancesCallable; + private final UnaryCallable + listInstancesPagedCallable; + private final UnaryCallable getInstanceCallable; + private final UnaryCallable createInstanceCallable; + private final OperationCallable + createInstanceOperationCallable; + private final UnaryCallable + createSecondaryInstanceCallable; + private final OperationCallable + createSecondaryInstanceOperationCallable; + private final UnaryCallable batchCreateInstancesCallable; + private final OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable; + private final UnaryCallable updateInstanceCallable; + private final OperationCallable + updateInstanceOperationCallable; + private final UnaryCallable deleteInstanceCallable; + private final OperationCallable + deleteInstanceOperationCallable; + private final UnaryCallable failoverInstanceCallable; + private final OperationCallable + failoverInstanceOperationCallable; + private final UnaryCallable restartInstanceCallable; + private final OperationCallable + restartInstanceOperationCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable + listBackupsPagedCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable createBackupCallable; + private final OperationCallable + createBackupOperationCallable; + private final UnaryCallable updateBackupCallable; + private final OperationCallable + updateBackupOperationCallable; + private final UnaryCallable deleteBackupCallable; + private final OperationCallable + deleteBackupOperationCallable; + private final UnaryCallable + listSupportedDatabaseFlagsCallable; + private final UnaryCallable< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsPagedCallable; + private final UnaryCallable + generateClientCertificateCallable; + private final UnaryCallable getConnectionInfoCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonAlloyDBAdminStub create(AlloyDBAdminStubSettings settings) + throws IOException { + return new HttpJsonAlloyDBAdminStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAlloyDBAdminStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonAlloyDBAdminStub( + AlloyDBAdminStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonAlloyDBAdminStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAlloyDBAdminStub( + AlloyDBAdminStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonAlloyDBAdminStub, 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 HttpJsonAlloyDBAdminStub(AlloyDBAdminStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonAlloyDBAdminCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAlloyDBAdminStub, 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 HttpJsonAlloyDBAdminStub( + AlloyDBAdminStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings listClustersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listClustersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings promoteClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(promoteClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings restoreClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(restoreClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createSecondaryClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSecondaryClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listInstancesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInstancesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createSecondaryInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSecondaryInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + batchCreateInstancesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(batchCreateInstancesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings failoverInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(failoverInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings restartInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(restartInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listBackupsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listSupportedDatabaseFlagsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listSupportedDatabaseFlagsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateClientCertificateTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(generateClientCertificateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getConnectionInfoTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getConnectionInfoMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listClustersCallable = + callableFactory.createUnaryCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.listClustersPagedCallable = + callableFactory.createPagedCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.getClusterCallable = + callableFactory.createUnaryCallable( + getClusterTransportSettings, settings.getClusterSettings(), clientContext); + this.createClusterCallable = + callableFactory.createUnaryCallable( + createClusterTransportSettings, settings.createClusterSettings(), clientContext); + this.createClusterOperationCallable = + callableFactory.createOperationCallable( + createClusterTransportSettings, + settings.createClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateClusterCallable = + callableFactory.createUnaryCallable( + updateClusterTransportSettings, settings.updateClusterSettings(), clientContext); + this.updateClusterOperationCallable = + callableFactory.createOperationCallable( + updateClusterTransportSettings, + settings.updateClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteClusterCallable = + callableFactory.createUnaryCallable( + deleteClusterTransportSettings, settings.deleteClusterSettings(), clientContext); + this.deleteClusterOperationCallable = + callableFactory.createOperationCallable( + deleteClusterTransportSettings, + settings.deleteClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.promoteClusterCallable = + callableFactory.createUnaryCallable( + promoteClusterTransportSettings, settings.promoteClusterSettings(), clientContext); + this.promoteClusterOperationCallable = + callableFactory.createOperationCallable( + promoteClusterTransportSettings, + settings.promoteClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.restoreClusterCallable = + callableFactory.createUnaryCallable( + restoreClusterTransportSettings, settings.restoreClusterSettings(), clientContext); + this.restoreClusterOperationCallable = + callableFactory.createOperationCallable( + restoreClusterTransportSettings, + settings.restoreClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.createSecondaryClusterCallable = + callableFactory.createUnaryCallable( + createSecondaryClusterTransportSettings, + settings.createSecondaryClusterSettings(), + clientContext); + this.createSecondaryClusterOperationCallable = + callableFactory.createOperationCallable( + createSecondaryClusterTransportSettings, + settings.createSecondaryClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listInstancesCallable = + callableFactory.createUnaryCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.listInstancesPagedCallable = + callableFactory.createPagedCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.getInstanceCallable = + callableFactory.createUnaryCallable( + getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); + this.createInstanceCallable = + callableFactory.createUnaryCallable( + createInstanceTransportSettings, settings.createInstanceSettings(), clientContext); + this.createInstanceOperationCallable = + callableFactory.createOperationCallable( + createInstanceTransportSettings, + settings.createInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.createSecondaryInstanceCallable = + callableFactory.createUnaryCallable( + createSecondaryInstanceTransportSettings, + settings.createSecondaryInstanceSettings(), + clientContext); + this.createSecondaryInstanceOperationCallable = + callableFactory.createOperationCallable( + createSecondaryInstanceTransportSettings, + settings.createSecondaryInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.batchCreateInstancesCallable = + callableFactory.createUnaryCallable( + batchCreateInstancesTransportSettings, + settings.batchCreateInstancesSettings(), + clientContext); + this.batchCreateInstancesOperationCallable = + callableFactory.createOperationCallable( + batchCreateInstancesTransportSettings, + settings.batchCreateInstancesOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateInstanceCallable = + callableFactory.createUnaryCallable( + updateInstanceTransportSettings, settings.updateInstanceSettings(), clientContext); + this.updateInstanceOperationCallable = + callableFactory.createOperationCallable( + updateInstanceTransportSettings, + settings.updateInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteInstanceCallable = + callableFactory.createUnaryCallable( + deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); + this.deleteInstanceOperationCallable = + callableFactory.createOperationCallable( + deleteInstanceTransportSettings, + settings.deleteInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.failoverInstanceCallable = + callableFactory.createUnaryCallable( + failoverInstanceTransportSettings, settings.failoverInstanceSettings(), clientContext); + this.failoverInstanceOperationCallable = + callableFactory.createOperationCallable( + failoverInstanceTransportSettings, + settings.failoverInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.restartInstanceCallable = + callableFactory.createUnaryCallable( + restartInstanceTransportSettings, settings.restartInstanceSettings(), clientContext); + this.restartInstanceOperationCallable = + callableFactory.createOperationCallable( + restartInstanceTransportSettings, + settings.restartInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.listBackupsPagedCallable = + callableFactory.createPagedCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.createBackupCallable = + callableFactory.createUnaryCallable( + createBackupTransportSettings, settings.createBackupSettings(), clientContext); + this.createBackupOperationCallable = + callableFactory.createOperationCallable( + createBackupTransportSettings, + settings.createBackupOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateBackupCallable = + callableFactory.createUnaryCallable( + updateBackupTransportSettings, settings.updateBackupSettings(), clientContext); + this.updateBackupOperationCallable = + callableFactory.createOperationCallable( + updateBackupTransportSettings, + settings.updateBackupOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + this.deleteBackupOperationCallable = + callableFactory.createOperationCallable( + deleteBackupTransportSettings, + settings.deleteBackupOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listSupportedDatabaseFlagsCallable = + callableFactory.createUnaryCallable( + listSupportedDatabaseFlagsTransportSettings, + settings.listSupportedDatabaseFlagsSettings(), + clientContext); + this.listSupportedDatabaseFlagsPagedCallable = + callableFactory.createPagedCallable( + listSupportedDatabaseFlagsTransportSettings, + settings.listSupportedDatabaseFlagsSettings(), + clientContext); + this.generateClientCertificateCallable = + callableFactory.createUnaryCallable( + generateClientCertificateTransportSettings, + settings.generateClientCertificateSettings(), + clientContext); + this.getConnectionInfoCallable = + callableFactory.createUnaryCallable( + getConnectionInfoTransportSettings, + settings.getConnectionInfoSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listClustersMethodDescriptor); + methodDescriptors.add(getClusterMethodDescriptor); + methodDescriptors.add(createClusterMethodDescriptor); + methodDescriptors.add(updateClusterMethodDescriptor); + methodDescriptors.add(deleteClusterMethodDescriptor); + methodDescriptors.add(promoteClusterMethodDescriptor); + methodDescriptors.add(restoreClusterMethodDescriptor); + methodDescriptors.add(createSecondaryClusterMethodDescriptor); + methodDescriptors.add(listInstancesMethodDescriptor); + methodDescriptors.add(getInstanceMethodDescriptor); + methodDescriptors.add(createInstanceMethodDescriptor); + methodDescriptors.add(createSecondaryInstanceMethodDescriptor); + methodDescriptors.add(batchCreateInstancesMethodDescriptor); + methodDescriptors.add(updateInstanceMethodDescriptor); + methodDescriptors.add(deleteInstanceMethodDescriptor); + methodDescriptors.add(failoverInstanceMethodDescriptor); + methodDescriptors.add(restartInstanceMethodDescriptor); + methodDescriptors.add(listBackupsMethodDescriptor); + methodDescriptors.add(getBackupMethodDescriptor); + methodDescriptors.add(createBackupMethodDescriptor); + methodDescriptors.add(updateBackupMethodDescriptor); + methodDescriptors.add(deleteBackupMethodDescriptor); + methodDescriptors.add(listSupportedDatabaseFlagsMethodDescriptor); + methodDescriptors.add(generateClientCertificateMethodDescriptor); + methodDescriptors.add(getConnectionInfoMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable listClustersCallable() { + return listClustersCallable; + } + + @Override + public UnaryCallable listClustersPagedCallable() { + return listClustersPagedCallable; + } + + @Override + public UnaryCallable getClusterCallable() { + return getClusterCallable; + } + + @Override + public UnaryCallable createClusterCallable() { + return createClusterCallable; + } + + @Override + public OperationCallable + createClusterOperationCallable() { + return createClusterOperationCallable; + } + + @Override + public UnaryCallable updateClusterCallable() { + return updateClusterCallable; + } + + @Override + public OperationCallable + updateClusterOperationCallable() { + return updateClusterOperationCallable; + } + + @Override + public UnaryCallable deleteClusterCallable() { + return deleteClusterCallable; + } + + @Override + public OperationCallable + deleteClusterOperationCallable() { + return deleteClusterOperationCallable; + } + + @Override + public UnaryCallable promoteClusterCallable() { + return promoteClusterCallable; + } + + @Override + public OperationCallable + promoteClusterOperationCallable() { + return promoteClusterOperationCallable; + } + + @Override + public UnaryCallable restoreClusterCallable() { + return restoreClusterCallable; + } + + @Override + public OperationCallable + restoreClusterOperationCallable() { + return restoreClusterOperationCallable; + } + + @Override + public UnaryCallable createSecondaryClusterCallable() { + return createSecondaryClusterCallable; + } + + @Override + public OperationCallable + createSecondaryClusterOperationCallable() { + return createSecondaryClusterOperationCallable; + } + + @Override + public UnaryCallable listInstancesCallable() { + return listInstancesCallable; + } + + @Override + public UnaryCallable + listInstancesPagedCallable() { + return listInstancesPagedCallable; + } + + @Override + public UnaryCallable getInstanceCallable() { + return getInstanceCallable; + } + + @Override + public UnaryCallable createInstanceCallable() { + return createInstanceCallable; + } + + @Override + public OperationCallable + createInstanceOperationCallable() { + return createInstanceOperationCallable; + } + + @Override + public UnaryCallable + createSecondaryInstanceCallable() { + return createSecondaryInstanceCallable; + } + + @Override + public OperationCallable + createSecondaryInstanceOperationCallable() { + return createSecondaryInstanceOperationCallable; + } + + @Override + public UnaryCallable batchCreateInstancesCallable() { + return batchCreateInstancesCallable; + } + + @Override + public OperationCallable< + BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> + batchCreateInstancesOperationCallable() { + return batchCreateInstancesOperationCallable; + } + + @Override + public UnaryCallable updateInstanceCallable() { + return updateInstanceCallable; + } + + @Override + public OperationCallable + updateInstanceOperationCallable() { + return updateInstanceOperationCallable; + } + + @Override + public UnaryCallable deleteInstanceCallable() { + return deleteInstanceCallable; + } + + @Override + public OperationCallable + deleteInstanceOperationCallable() { + return deleteInstanceOperationCallable; + } + + @Override + public UnaryCallable failoverInstanceCallable() { + return failoverInstanceCallable; + } + + @Override + public OperationCallable + failoverInstanceOperationCallable() { + return failoverInstanceOperationCallable; + } + + @Override + public UnaryCallable restartInstanceCallable() { + return restartInstanceCallable; + } + + @Override + public OperationCallable + restartInstanceOperationCallable() { + return restartInstanceOperationCallable; + } + + @Override + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @Override + public UnaryCallable listBackupsPagedCallable() { + return listBackupsPagedCallable; + } + + @Override + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + @Override + public UnaryCallable createBackupCallable() { + return createBackupCallable; + } + + @Override + public OperationCallable + createBackupOperationCallable() { + return createBackupOperationCallable; + } + + @Override + public UnaryCallable updateBackupCallable() { + return updateBackupCallable; + } + + @Override + public OperationCallable + updateBackupOperationCallable() { + return updateBackupOperationCallable; + } + + @Override + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + @Override + public OperationCallable + deleteBackupOperationCallable() { + return deleteBackupOperationCallable; + } + + @Override + public UnaryCallable + listSupportedDatabaseFlagsCallable() { + return listSupportedDatabaseFlagsCallable; + } + + @Override + public UnaryCallable + listSupportedDatabaseFlagsPagedCallable() { + return listSupportedDatabaseFlagsPagedCallable; + } + + @Override + public UnaryCallable + generateClientCertificateCallable() { + return generateClientCertificateCallable; + } + + @Override + public UnaryCallable getConnectionInfoCallable() { + return getConnectionInfoCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @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-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/AlloyDBAdminClientHttpJsonTest.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/AlloyDBAdminClientHttpJsonTest.java new file mode 100644 index 000000000000..dcd5cc69705e --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/AlloyDBAdminClientHttpJsonTest.java @@ -0,0 +1,2414 @@ +/* + * 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.alloydb.v1; + +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +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.alloydb.v1.stub.HttpJsonAlloyDBAdminStub; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AlloyDBAdminClientHttpJsonTest { + private static MockHttpService mockService; + private static AlloyDBAdminClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonAlloyDBAdminStub.getMethodDescriptors(), + AlloyDBAdminSettings.getDefaultEndpoint()); + AlloyDBAdminSettings settings = + AlloyDBAdminSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + AlloyDBAdminSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AlloyDBAdminClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listClustersTest() throws Exception { + Cluster responsesElement = Cluster.newBuilder().build(); + ListClustersResponse expectedResponse = + ListClustersResponse.newBuilder() + .setNextPageToken("") + .addAllClusters(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListClustersPagedResponse pagedListResponse = client.listClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClustersList().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 listClustersExceptionTest() 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.listClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listClustersTest2() throws Exception { + Cluster responsesElement = Cluster.newBuilder().build(); + ListClustersResponse expectedResponse = + ListClustersResponse.newBuilder() + .setNextPageToken("") + .addAllClusters(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListClustersPagedResponse pagedListResponse = client.listClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClustersList().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 listClustersExceptionTest2() 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.listClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + Cluster actualResponse = client.getCluster(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 getClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + + Cluster actualResponse = client.getCluster(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 getClusterExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createClusterAsync(parent, cluster, clusterId).get(); + 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 createClusterExceptionTest() 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]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createClusterAsync(parent, cluster, clusterId).get(); + 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 createClusterExceptionTest2() 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"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Cluster cluster = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Cluster actualResponse = client.updateClusterAsync(cluster, updateMask).get(); + 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 updateClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Cluster cluster = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateClusterAsync(cluster, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteClusterTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + client.deleteClusterAsync(name).get(); + + 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 deleteClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.deleteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteClusterTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + + client.deleteClusterAsync(name).get(); + + 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 deleteClusterExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + client.deleteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void restoreClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restoreClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + + Cluster actualResponse = client.restoreClusterAsync(request).get(); + 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 restoreClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + client.restoreClusterAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listInstancesTest() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().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 listInstancesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listInstancesTest2() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().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 listInstancesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.getInstance(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 getInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + + Instance actualResponse = client.getInstance(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 getInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + 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 createInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + 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 createInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void batchCreateInstancesTest() throws Exception { + BatchCreateInstancesResponse expectedResponse = + BatchCreateInstancesResponse.newBuilder() + .addAllInstances(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchCreateInstancesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + + BatchCreateInstancesResponse actualResponse = client.batchCreateInstancesAsync(request).get(); + 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 batchCreateInstancesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + client.batchCreateInstancesAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Instance instance = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Instance actualResponse = client.updateInstanceAsync(instance, updateMask).get(); + 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 updateInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Instance instance = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateInstanceAsync(instance, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteInstanceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + client.deleteInstanceAsync(name).get(); + + 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 deleteInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteInstanceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + + client.deleteInstanceAsync(name).get(); + + 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 deleteInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void failoverInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("failoverInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.failoverInstanceAsync(name).get(); + 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 failoverInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.failoverInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void failoverInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("failoverInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + + Instance actualResponse = client.failoverInstanceAsync(name).get(); + 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 failoverInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + client.failoverInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void restartInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restartInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.restartInstanceAsync(name).get(); + 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 restartInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.restartInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void restartInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restartInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + + Instance actualResponse = client.restartInstanceAsync(name).get(); + 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 restartInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + client.restartInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listBackupsTest() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().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 listBackupsExceptionTest() 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.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().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 listBackupsExceptionTest2() 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.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(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 getBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + + Backup actualResponse = client.getBackup(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 getBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + 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 createBackupExceptionTest() 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]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + 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 createBackupExceptionTest2() 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"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Backup backup = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Backup actualResponse = client.updateBackupAsync(backup, updateMask).get(); + 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 updateBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Backup backup = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackupAsync(backup, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteBackupTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + client.deleteBackupAsync(name).get(); + + 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 deleteBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteBackupTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + + client.deleteBackupAsync(name).get(); + + 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 deleteBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listSupportedDatabaseFlagsTest() throws Exception { + SupportedDatabaseFlag responsesElement = SupportedDatabaseFlag.newBuilder().build(); + ListSupportedDatabaseFlagsResponse expectedResponse = + ListSupportedDatabaseFlagsResponse.newBuilder() + .setNextPageToken("") + .addAllSupportedDatabaseFlags(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListSupportedDatabaseFlagsPagedResponse pagedListResponse = + client.listSupportedDatabaseFlags(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSupportedDatabaseFlagsList().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 listSupportedDatabaseFlagsExceptionTest() 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.listSupportedDatabaseFlags(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSupportedDatabaseFlagsTest2() throws Exception { + SupportedDatabaseFlag responsesElement = SupportedDatabaseFlag.newBuilder().build(); + ListSupportedDatabaseFlagsResponse expectedResponse = + ListSupportedDatabaseFlagsResponse.newBuilder() + .setNextPageToken("") + .addAllSupportedDatabaseFlags(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListSupportedDatabaseFlagsPagedResponse pagedListResponse = + client.listSupportedDatabaseFlags(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSupportedDatabaseFlagsList().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 listSupportedDatabaseFlagsExceptionTest2() 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.listSupportedDatabaseFlags(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().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 listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + 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 getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/AlloyDBAdminClientTest.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/AlloyDBAdminClientTest.java new file mode 100644 index 000000000000..201b057a3622 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/AlloyDBAdminClientTest.java @@ -0,0 +1,2156 @@ +/* + * 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.alloydb.v1; + +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AlloyDBAdminClientTest { + private static MockAlloyDBAdmin mockAlloyDBAdmin; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private AlloyDBAdminClient client; + + @BeforeClass + public static void startStaticServer() { + mockAlloyDBAdmin = new MockAlloyDBAdmin(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockAlloyDBAdmin, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + AlloyDBAdminSettings settings = + AlloyDBAdminSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AlloyDBAdminClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listClustersTest() throws Exception { + Cluster responsesElement = Cluster.newBuilder().build(); + ListClustersResponse expectedResponse = + ListClustersResponse.newBuilder() + .setNextPageToken("") + .addAllClusters(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListClustersPagedResponse pagedListResponse = client.listClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClustersList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListClustersRequest actualRequest = ((ListClustersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listClustersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listClustersTest2() throws Exception { + Cluster responsesElement = Cluster.newBuilder().build(); + ListClustersResponse expectedResponse = + ListClustersResponse.newBuilder() + .setNextPageToken("") + .addAllClusters(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListClustersPagedResponse pagedListResponse = client.listClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClustersList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListClustersRequest actualRequest = ((ListClustersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listClustersExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + Cluster actualResponse = client.getCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetClusterRequest actualRequest = ((GetClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + Cluster actualResponse = client.getCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetClusterRequest actualRequest = ((GetClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateClusterRequest actualRequest = ((CreateClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(clusterId, actualRequest.getClusterId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateClusterRequest actualRequest = ((CreateClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(clusterId, actualRequest.getClusterId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + Cluster cluster = Cluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Cluster actualResponse = client.updateClusterAsync(cluster, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateClusterRequest actualRequest = ((UpdateClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + Cluster cluster = Cluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateClusterAsync(cluster, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteClusterTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + client.deleteClusterAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteClusterRequest actualRequest = ((DeleteClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.deleteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteClusterTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteClusterAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteClusterRequest actualRequest = ((DeleteClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void restoreClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restoreClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + + Cluster actualResponse = client.restoreClusterAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestoreClusterRequest actualRequest = ((RestoreClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getBackupSource(), actualRequest.getBackupSource()); + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getClusterId(), actualRequest.getClusterId()); + Assert.assertEquals(request.getCluster(), actualRequest.getCluster()); + Assert.assertEquals(request.getRequestId(), actualRequest.getRequestId()); + Assert.assertEquals(request.getValidateOnly(), actualRequest.getValidateOnly()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restoreClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + client.restoreClusterAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listInstancesTest() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListInstancesRequest actualRequest = ((ListInstancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listInstancesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listInstancesTest2() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListInstancesRequest actualRequest = ((ListInstancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listInstancesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetInstanceRequest actualRequest = ((GetInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetInstanceRequest actualRequest = ((GetInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateInstanceRequest actualRequest = ((CreateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateInstanceRequest actualRequest = ((CreateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void batchCreateInstancesTest() throws Exception { + BatchCreateInstancesResponse expectedResponse = + BatchCreateInstancesResponse.newBuilder() + .addAllInstances(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchCreateInstancesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + + BatchCreateInstancesResponse actualResponse = client.batchCreateInstancesAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchCreateInstancesRequest actualRequest = + ((BatchCreateInstancesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getRequests(), actualRequest.getRequests()); + Assert.assertEquals(request.getRequestId(), actualRequest.getRequestId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void batchCreateInstancesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + client.batchCreateInstancesAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Instance actualResponse = client.updateInstanceAsync(instance, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateInstanceRequest actualRequest = ((UpdateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateInstanceAsync(instance, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteInstanceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteInstanceRequest actualRequest = ((DeleteInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteInstanceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteInstanceRequest actualRequest = ((DeleteInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void failoverInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("failoverInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.failoverInstanceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FailoverInstanceRequest actualRequest = ((FailoverInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void failoverInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.failoverInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void failoverInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("failoverInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + Instance actualResponse = client.failoverInstanceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FailoverInstanceRequest actualRequest = ((FailoverInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void failoverInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.failoverInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void restartInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restartInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.restartInstanceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestartInstanceRequest actualRequest = ((RestartInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restartInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.restartInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void restartInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restartInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + Instance actualResponse = client.restartInstanceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestartInstanceRequest actualRequest = ((RestartInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restartInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.restartInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listBackupsTest() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Backup actualResponse = client.updateBackupAsync(backup, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBackupRequest actualRequest = ((UpdateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackupAsync(backup, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteBackupTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + client.deleteBackupAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteBackupTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteBackupAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listSupportedDatabaseFlagsTest() throws Exception { + SupportedDatabaseFlag responsesElement = SupportedDatabaseFlag.newBuilder().build(); + ListSupportedDatabaseFlagsResponse expectedResponse = + ListSupportedDatabaseFlagsResponse.newBuilder() + .setNextPageToken("") + .addAllSupportedDatabaseFlags(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListSupportedDatabaseFlagsPagedResponse pagedListResponse = + client.listSupportedDatabaseFlags(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSupportedDatabaseFlagsList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSupportedDatabaseFlagsRequest actualRequest = + ((ListSupportedDatabaseFlagsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSupportedDatabaseFlagsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listSupportedDatabaseFlags(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSupportedDatabaseFlagsTest2() throws Exception { + SupportedDatabaseFlag responsesElement = SupportedDatabaseFlag.newBuilder().build(); + ListSupportedDatabaseFlagsResponse expectedResponse = + ListSupportedDatabaseFlagsResponse.newBuilder() + .setNextPageToken("") + .addAllSupportedDatabaseFlags(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSupportedDatabaseFlagsPagedResponse pagedListResponse = + client.listSupportedDatabaseFlags(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSupportedDatabaseFlagsList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSupportedDatabaseFlagsRequest actualRequest = + ((ListSupportedDatabaseFlagsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSupportedDatabaseFlagsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listSupportedDatabaseFlags(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockAlloyDBAdmin.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockAlloyDBAdmin.java new file mode 100644 index 000000000000..42f4ca5d0346 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockAlloyDBAdmin.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.alloydb.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 MockAlloyDBAdmin implements MockGrpcService { + private final MockAlloyDBAdminImpl serviceImpl; + + public MockAlloyDBAdmin() { + serviceImpl = new MockAlloyDBAdminImpl(); + } + + @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-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockAlloyDBAdminImpl.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockAlloyDBAdminImpl.java new file mode 100644 index 000000000000..b757f8ec8dd4 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockAlloyDBAdminImpl.java @@ -0,0 +1,479 @@ +/* + * 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.alloydb.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.alloydb.v1.AlloyDBAdminGrpc.AlloyDBAdminImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAlloyDBAdminImpl extends AlloyDBAdminImplBase { + private List requests; + private Queue responses; + + public MockAlloyDBAdminImpl() { + 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 listClusters( + ListClustersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListClustersResponse) { + requests.add(request); + responseObserver.onNext(((ListClustersResponse) 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 ListClusters, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListClustersResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getCluster(GetClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Cluster) { + requests.add(request); + responseObserver.onNext(((Cluster) 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 GetCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Cluster.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createCluster( + CreateClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateCluster( + UpdateClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteCluster( + DeleteClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void restoreCluster( + RestoreClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RestoreCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listInstances( + ListInstancesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListInstancesResponse) { + requests.add(request); + responseObserver.onNext(((ListInstancesResponse) 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 ListInstances, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListInstancesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getInstance(GetInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Instance) { + requests.add(request); + responseObserver.onNext(((Instance) 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 GetInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Instance.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createInstance( + CreateInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void batchCreateInstances( + BatchCreateInstancesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method BatchCreateInstances, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateInstance( + UpdateInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteInstance( + DeleteInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void failoverInstance( + FailoverInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method FailoverInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void restartInstance( + RestartInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RestartInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listBackups( + ListBackupsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListBackupsResponse) { + requests.add(request); + responseObserver.onNext(((ListBackupsResponse) 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 ListBackups, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBackupsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getBackup(GetBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Backup) { + requests.add(request); + responseObserver.onNext(((Backup) 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 GetBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Backup.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createBackup( + CreateBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBackup( + UpdateBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBackup( + DeleteBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSupportedDatabaseFlags( + ListSupportedDatabaseFlagsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSupportedDatabaseFlagsResponse) { + requests.add(request); + responseObserver.onNext(((ListSupportedDatabaseFlagsResponse) 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 ListSupportedDatabaseFlags, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSupportedDatabaseFlagsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockIAMPolicy.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockIAMPolicy.java new file mode 100644 index 000000000000..6a82514c24d4 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockIAMPolicy.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.alloydb.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 MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @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-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockIAMPolicyImpl.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockIAMPolicyImpl.java new file mode 100644 index 000000000000..f93db0ad371a --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockIAMPolicyImpl.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.alloydb.v1; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.protobuf.AbstractMessage; +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 MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + 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<>(); + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockLocations.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockLocations.java new file mode 100644 index 000000000000..f7e4ad944fbb --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockLocations.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.alloydb.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 MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @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-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockLocationsImpl.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockLocationsImpl.java new file mode 100644 index 000000000000..54ae5c8b3f4c --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockLocationsImpl.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.alloydb.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + 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 listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) 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 ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) 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 GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClientHttpJsonTest.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClientHttpJsonTest.java new file mode 100644 index 000000000000..73a39035c860 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClientHttpJsonTest.java @@ -0,0 +1,3044 @@ +/* + * 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.alloydb.v1alpha; + +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +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.alloydb.v1alpha.stub.HttpJsonAlloyDBAdminStub; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AlloyDBAdminClientHttpJsonTest { + private static MockHttpService mockService; + private static AlloyDBAdminClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonAlloyDBAdminStub.getMethodDescriptors(), + AlloyDBAdminSettings.getDefaultEndpoint()); + AlloyDBAdminSettings settings = + AlloyDBAdminSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + AlloyDBAdminSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AlloyDBAdminClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listClustersTest() throws Exception { + Cluster responsesElement = Cluster.newBuilder().build(); + ListClustersResponse expectedResponse = + ListClustersResponse.newBuilder() + .setNextPageToken("") + .addAllClusters(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListClustersPagedResponse pagedListResponse = client.listClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClustersList().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 listClustersExceptionTest() 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.listClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listClustersTest2() throws Exception { + Cluster responsesElement = Cluster.newBuilder().build(); + ListClustersResponse expectedResponse = + ListClustersResponse.newBuilder() + .setNextPageToken("") + .addAllClusters(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListClustersPagedResponse pagedListResponse = client.listClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClustersList().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 listClustersExceptionTest2() 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.listClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + Cluster actualResponse = client.getCluster(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 getClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + + Cluster actualResponse = client.getCluster(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 getClusterExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createClusterAsync(parent, cluster, clusterId).get(); + 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 createClusterExceptionTest() 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]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createClusterAsync(parent, cluster, clusterId).get(); + 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 createClusterExceptionTest2() 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"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Cluster cluster = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Cluster actualResponse = client.updateClusterAsync(cluster, updateMask).get(); + 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 updateClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Cluster cluster = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateClusterAsync(cluster, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteClusterTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + client.deleteClusterAsync(name).get(); + + 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 deleteClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.deleteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteClusterTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + + client.deleteClusterAsync(name).get(); + + 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 deleteClusterExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + client.deleteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void promoteClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("promoteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + Cluster actualResponse = client.promoteClusterAsync(name).get(); + 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 promoteClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.promoteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void promoteClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("promoteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + + Cluster actualResponse = client.promoteClusterAsync(name).get(); + 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 promoteClusterExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + client.promoteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void restoreClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restoreClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + + Cluster actualResponse = client.restoreClusterAsync(request).get(); + 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 restoreClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + client.restoreClusterAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createSecondaryClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + 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 createSecondaryClusterExceptionTest() 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]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createSecondaryClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + 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 createSecondaryClusterExceptionTest2() 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"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listInstancesTest() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().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 listInstancesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listInstancesTest2() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().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 listInstancesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.getInstance(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 getInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + + Instance actualResponse = client.getInstance(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 getInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + 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 createInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + 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 createInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createSecondaryInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + 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 createSecondaryInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createSecondaryInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + 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 createSecondaryInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void batchCreateInstancesTest() throws Exception { + BatchCreateInstancesResponse expectedResponse = + BatchCreateInstancesResponse.newBuilder() + .addAllInstances(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchCreateInstancesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + + BatchCreateInstancesResponse actualResponse = client.batchCreateInstancesAsync(request).get(); + 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 batchCreateInstancesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + client.batchCreateInstancesAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Instance instance = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Instance actualResponse = client.updateInstanceAsync(instance, updateMask).get(); + 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 updateInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Instance instance = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateInstanceAsync(instance, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteInstanceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + client.deleteInstanceAsync(name).get(); + + 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 deleteInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteInstanceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + + client.deleteInstanceAsync(name).get(); + + 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 deleteInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void failoverInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("failoverInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.failoverInstanceAsync(name).get(); + 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 failoverInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.failoverInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void failoverInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("failoverInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + + Instance actualResponse = client.failoverInstanceAsync(name).get(); + 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 failoverInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + client.failoverInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void restartInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restartInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.restartInstanceAsync(name).get(); + 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 restartInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.restartInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void restartInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restartInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + + Instance actualResponse = client.restartInstanceAsync(name).get(); + 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 restartInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + client.restartInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listBackupsTest() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().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 listBackupsExceptionTest() 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.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().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 listBackupsExceptionTest2() 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.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(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 getBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + + Backup actualResponse = client.getBackup(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 getBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + 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 createBackupExceptionTest() 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]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + 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 createBackupExceptionTest2() 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"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Backup backup = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Backup actualResponse = client.updateBackupAsync(backup, updateMask).get(); + 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 updateBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Backup backup = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackupAsync(backup, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteBackupTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + client.deleteBackupAsync(name).get(); + + 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 deleteBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteBackupTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + + client.deleteBackupAsync(name).get(); + + 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 deleteBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listSupportedDatabaseFlagsTest() throws Exception { + SupportedDatabaseFlag responsesElement = SupportedDatabaseFlag.newBuilder().build(); + ListSupportedDatabaseFlagsResponse expectedResponse = + ListSupportedDatabaseFlagsResponse.newBuilder() + .setNextPageToken("") + .addAllSupportedDatabaseFlags(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListSupportedDatabaseFlagsPagedResponse pagedListResponse = + client.listSupportedDatabaseFlags(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSupportedDatabaseFlagsList().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 listSupportedDatabaseFlagsExceptionTest() 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.listSupportedDatabaseFlags(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSupportedDatabaseFlagsTest2() throws Exception { + SupportedDatabaseFlag responsesElement = SupportedDatabaseFlag.newBuilder().build(); + ListSupportedDatabaseFlagsResponse expectedResponse = + ListSupportedDatabaseFlagsResponse.newBuilder() + .setNextPageToken("") + .addAllSupportedDatabaseFlags(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListSupportedDatabaseFlagsPagedResponse pagedListResponse = + client.listSupportedDatabaseFlags(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSupportedDatabaseFlagsList().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 listSupportedDatabaseFlagsExceptionTest2() 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.listSupportedDatabaseFlags(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateClientCertificateTest() throws Exception { + GenerateClientCertificateResponse expectedResponse = + GenerateClientCertificateResponse.newBuilder() + .setPemCertificate("pemCertificate153491807") + .addAllPemCertificateChain(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + GenerateClientCertificateResponse actualResponse = client.generateClientCertificate(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 generateClientCertificateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.generateClientCertificate(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateClientCertificateTest2() throws Exception { + GenerateClientCertificateResponse expectedResponse = + GenerateClientCertificateResponse.newBuilder() + .setPemCertificate("pemCertificate153491807") + .addAllPemCertificateChain(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + + GenerateClientCertificateResponse actualResponse = client.generateClientCertificate(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 generateClientCertificateExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + client.generateClientCertificate(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConnectionInfoTest() throws Exception { + ConnectionInfo expectedResponse = + ConnectionInfo.newBuilder() + .setName("name3373707") + .setIpAddress("ipAddress1634032845") + .addAllPemCertificateChain(new ArrayList()) + .setInstanceUid("instanceUid-2102004869") + .build(); + mockService.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + ConnectionInfo actualResponse = client.getConnectionInfo(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 getConnectionInfoExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.getConnectionInfo(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConnectionInfoTest2() throws Exception { + ConnectionInfo expectedResponse = + ConnectionInfo.newBuilder() + .setName("name3373707") + .setIpAddress("ipAddress1634032845") + .addAllPemCertificateChain(new ArrayList()) + .setInstanceUid("instanceUid-2102004869") + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-9084/locations/location-9084/clusters/cluster-9084/instances/instance-9084"; + + ConnectionInfo actualResponse = client.getConnectionInfo(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 getConnectionInfoExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-9084/locations/location-9084/clusters/cluster-9084/instances/instance-9084"; + client.getConnectionInfo(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().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 listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + 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 getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClientTest.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClientTest.java new file mode 100644 index 000000000000..66578b33b33f --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClientTest.java @@ -0,0 +1,2754 @@ +/* + * 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.alloydb.v1alpha; + +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AlloyDBAdminClientTest { + private static MockAlloyDBAdmin mockAlloyDBAdmin; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private AlloyDBAdminClient client; + + @BeforeClass + public static void startStaticServer() { + mockAlloyDBAdmin = new MockAlloyDBAdmin(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockAlloyDBAdmin, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + AlloyDBAdminSettings settings = + AlloyDBAdminSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AlloyDBAdminClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listClustersTest() throws Exception { + Cluster responsesElement = Cluster.newBuilder().build(); + ListClustersResponse expectedResponse = + ListClustersResponse.newBuilder() + .setNextPageToken("") + .addAllClusters(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListClustersPagedResponse pagedListResponse = client.listClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClustersList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListClustersRequest actualRequest = ((ListClustersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listClustersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listClustersTest2() throws Exception { + Cluster responsesElement = Cluster.newBuilder().build(); + ListClustersResponse expectedResponse = + ListClustersResponse.newBuilder() + .setNextPageToken("") + .addAllClusters(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListClustersPagedResponse pagedListResponse = client.listClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClustersList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListClustersRequest actualRequest = ((ListClustersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listClustersExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + Cluster actualResponse = client.getCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetClusterRequest actualRequest = ((GetClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + Cluster actualResponse = client.getCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetClusterRequest actualRequest = ((GetClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateClusterRequest actualRequest = ((CreateClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(clusterId, actualRequest.getClusterId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateClusterRequest actualRequest = ((CreateClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(clusterId, actualRequest.getClusterId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + Cluster cluster = Cluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Cluster actualResponse = client.updateClusterAsync(cluster, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateClusterRequest actualRequest = ((UpdateClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + Cluster cluster = Cluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateClusterAsync(cluster, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteClusterTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + client.deleteClusterAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteClusterRequest actualRequest = ((DeleteClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.deleteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteClusterTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteClusterAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteClusterRequest actualRequest = ((DeleteClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void promoteClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("promoteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + Cluster actualResponse = client.promoteClusterAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PromoteClusterRequest actualRequest = ((PromoteClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void promoteClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.promoteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void promoteClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("promoteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + Cluster actualResponse = client.promoteClusterAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PromoteClusterRequest actualRequest = ((PromoteClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void promoteClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.promoteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void restoreClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restoreClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + + Cluster actualResponse = client.restoreClusterAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestoreClusterRequest actualRequest = ((RestoreClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getBackupSource(), actualRequest.getBackupSource()); + Assert.assertEquals( + request.getContinuousBackupSource(), actualRequest.getContinuousBackupSource()); + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getClusterId(), actualRequest.getClusterId()); + Assert.assertEquals(request.getCluster(), actualRequest.getCluster()); + Assert.assertEquals(request.getRequestId(), actualRequest.getRequestId()); + Assert.assertEquals(request.getValidateOnly(), actualRequest.getValidateOnly()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restoreClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + client.restoreClusterAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createSecondaryClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSecondaryClusterRequest actualRequest = + ((CreateSecondaryClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(clusterId, actualRequest.getClusterId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSecondaryClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createSecondaryClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSecondaryClusterRequest actualRequest = + ((CreateSecondaryClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(clusterId, actualRequest.getClusterId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSecondaryClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listInstancesTest() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListInstancesRequest actualRequest = ((ListInstancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listInstancesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listInstancesTest2() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListInstancesRequest actualRequest = ((ListInstancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listInstancesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetInstanceRequest actualRequest = ((GetInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetInstanceRequest actualRequest = ((GetInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateInstanceRequest actualRequest = ((CreateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateInstanceRequest actualRequest = ((CreateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createSecondaryInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSecondaryInstanceRequest actualRequest = + ((CreateSecondaryInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSecondaryInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createSecondaryInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSecondaryInstanceRequest actualRequest = + ((CreateSecondaryInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSecondaryInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void batchCreateInstancesTest() throws Exception { + BatchCreateInstancesResponse expectedResponse = + BatchCreateInstancesResponse.newBuilder() + .addAllInstances(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchCreateInstancesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + + BatchCreateInstancesResponse actualResponse = client.batchCreateInstancesAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchCreateInstancesRequest actualRequest = + ((BatchCreateInstancesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getRequests(), actualRequest.getRequests()); + Assert.assertEquals(request.getRequestId(), actualRequest.getRequestId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void batchCreateInstancesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + client.batchCreateInstancesAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Instance actualResponse = client.updateInstanceAsync(instance, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateInstanceRequest actualRequest = ((UpdateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateInstanceAsync(instance, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteInstanceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteInstanceRequest actualRequest = ((DeleteInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteInstanceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteInstanceRequest actualRequest = ((DeleteInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void failoverInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("failoverInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.failoverInstanceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FailoverInstanceRequest actualRequest = ((FailoverInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void failoverInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.failoverInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void failoverInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("failoverInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + Instance actualResponse = client.failoverInstanceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FailoverInstanceRequest actualRequest = ((FailoverInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void failoverInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.failoverInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void restartInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restartInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.restartInstanceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestartInstanceRequest actualRequest = ((RestartInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restartInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.restartInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void restartInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restartInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + Instance actualResponse = client.restartInstanceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestartInstanceRequest actualRequest = ((RestartInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restartInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.restartInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listBackupsTest() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Backup actualResponse = client.updateBackupAsync(backup, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBackupRequest actualRequest = ((UpdateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackupAsync(backup, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteBackupTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + client.deleteBackupAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteBackupTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteBackupAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listSupportedDatabaseFlagsTest() throws Exception { + SupportedDatabaseFlag responsesElement = SupportedDatabaseFlag.newBuilder().build(); + ListSupportedDatabaseFlagsResponse expectedResponse = + ListSupportedDatabaseFlagsResponse.newBuilder() + .setNextPageToken("") + .addAllSupportedDatabaseFlags(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListSupportedDatabaseFlagsPagedResponse pagedListResponse = + client.listSupportedDatabaseFlags(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSupportedDatabaseFlagsList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSupportedDatabaseFlagsRequest actualRequest = + ((ListSupportedDatabaseFlagsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSupportedDatabaseFlagsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listSupportedDatabaseFlags(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSupportedDatabaseFlagsTest2() throws Exception { + SupportedDatabaseFlag responsesElement = SupportedDatabaseFlag.newBuilder().build(); + ListSupportedDatabaseFlagsResponse expectedResponse = + ListSupportedDatabaseFlagsResponse.newBuilder() + .setNextPageToken("") + .addAllSupportedDatabaseFlags(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSupportedDatabaseFlagsPagedResponse pagedListResponse = + client.listSupportedDatabaseFlags(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSupportedDatabaseFlagsList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSupportedDatabaseFlagsRequest actualRequest = + ((ListSupportedDatabaseFlagsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSupportedDatabaseFlagsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listSupportedDatabaseFlags(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateClientCertificateTest() throws Exception { + GenerateClientCertificateResponse expectedResponse = + GenerateClientCertificateResponse.newBuilder() + .setPemCertificate("pemCertificate153491807") + .addAllPemCertificateChain(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + GenerateClientCertificateResponse actualResponse = client.generateClientCertificate(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateClientCertificateRequest actualRequest = + ((GenerateClientCertificateRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateClientCertificateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.generateClientCertificate(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateClientCertificateTest2() throws Exception { + GenerateClientCertificateResponse expectedResponse = + GenerateClientCertificateResponse.newBuilder() + .setPemCertificate("pemCertificate153491807") + .addAllPemCertificateChain(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + GenerateClientCertificateResponse actualResponse = client.generateClientCertificate(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateClientCertificateRequest actualRequest = + ((GenerateClientCertificateRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateClientCertificateExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.generateClientCertificate(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConnectionInfoTest() throws Exception { + ConnectionInfo expectedResponse = + ConnectionInfo.newBuilder() + .setName("name3373707") + .setIpAddress("ipAddress1634032845") + .addAllPemCertificateChain(new ArrayList()) + .setInstanceUid("instanceUid-2102004869") + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + ConnectionInfo actualResponse = client.getConnectionInfo(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConnectionInfoRequest actualRequest = ((GetConnectionInfoRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getConnectionInfoExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.getConnectionInfo(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConnectionInfoTest2() throws Exception { + ConnectionInfo expectedResponse = + ConnectionInfo.newBuilder() + .setName("name3373707") + .setIpAddress("ipAddress1634032845") + .addAllPemCertificateChain(new ArrayList()) + .setInstanceUid("instanceUid-2102004869") + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ConnectionInfo actualResponse = client.getConnectionInfo(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConnectionInfoRequest actualRequest = ((GetConnectionInfoRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getConnectionInfoExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.getConnectionInfo(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockAlloyDBAdmin.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockAlloyDBAdmin.java new file mode 100644 index 000000000000..d8257a24f3b5 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockAlloyDBAdmin.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.alloydb.v1alpha; + +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 MockAlloyDBAdmin implements MockGrpcService { + private final MockAlloyDBAdminImpl serviceImpl; + + public MockAlloyDBAdmin() { + serviceImpl = new MockAlloyDBAdminImpl(); + } + + @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-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockAlloyDBAdminImpl.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockAlloyDBAdminImpl.java new file mode 100644 index 000000000000..a317ddc163bc --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockAlloyDBAdminImpl.java @@ -0,0 +1,585 @@ +/* + * 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.alloydb.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminGrpc.AlloyDBAdminImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAlloyDBAdminImpl extends AlloyDBAdminImplBase { + private List requests; + private Queue responses; + + public MockAlloyDBAdminImpl() { + 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 listClusters( + ListClustersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListClustersResponse) { + requests.add(request); + responseObserver.onNext(((ListClustersResponse) 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 ListClusters, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListClustersResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getCluster(GetClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Cluster) { + requests.add(request); + responseObserver.onNext(((Cluster) 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 GetCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Cluster.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createCluster( + CreateClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateCluster( + UpdateClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteCluster( + DeleteClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void promoteCluster( + PromoteClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PromoteCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void restoreCluster( + RestoreClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RestoreCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createSecondaryCluster( + CreateSecondaryClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateSecondaryCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listInstances( + ListInstancesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListInstancesResponse) { + requests.add(request); + responseObserver.onNext(((ListInstancesResponse) 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 ListInstances, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListInstancesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getInstance(GetInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Instance) { + requests.add(request); + responseObserver.onNext(((Instance) 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 GetInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Instance.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createInstance( + CreateInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createSecondaryInstance( + CreateSecondaryInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateSecondaryInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void batchCreateInstances( + BatchCreateInstancesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method BatchCreateInstances, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateInstance( + UpdateInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteInstance( + DeleteInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void failoverInstance( + FailoverInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method FailoverInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void restartInstance( + RestartInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RestartInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listBackups( + ListBackupsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListBackupsResponse) { + requests.add(request); + responseObserver.onNext(((ListBackupsResponse) 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 ListBackups, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBackupsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getBackup(GetBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Backup) { + requests.add(request); + responseObserver.onNext(((Backup) 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 GetBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Backup.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createBackup( + CreateBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBackup( + UpdateBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBackup( + DeleteBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSupportedDatabaseFlags( + ListSupportedDatabaseFlagsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSupportedDatabaseFlagsResponse) { + requests.add(request); + responseObserver.onNext(((ListSupportedDatabaseFlagsResponse) 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 ListSupportedDatabaseFlags, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSupportedDatabaseFlagsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void generateClientCertificate( + GenerateClientCertificateRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GenerateClientCertificateResponse) { + requests.add(request); + responseObserver.onNext(((GenerateClientCertificateResponse) 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 GenerateClientCertificate, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GenerateClientCertificateResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getConnectionInfo( + GetConnectionInfoRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ConnectionInfo) { + requests.add(request); + responseObserver.onNext(((ConnectionInfo) 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 GetConnectionInfo, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ConnectionInfo.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockIAMPolicy.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockIAMPolicy.java new file mode 100644 index 000000000000..21ae7e4cefa3 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockIAMPolicy.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.alloydb.v1alpha; + +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 MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @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-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockIAMPolicyImpl.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockIAMPolicyImpl.java new file mode 100644 index 000000000000..7887a7c57baa --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockIAMPolicyImpl.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.alloydb.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.protobuf.AbstractMessage; +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 MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + 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<>(); + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockLocations.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockLocations.java new file mode 100644 index 000000000000..1c7300695dd6 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockLocations.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.alloydb.v1alpha; + +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 MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @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-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockLocationsImpl.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockLocationsImpl.java new file mode 100644 index 000000000000..e44178905e12 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockLocationsImpl.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.alloydb.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + 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 listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) 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 ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) 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 GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClientHttpJsonTest.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClientHttpJsonTest.java new file mode 100644 index 000000000000..18c69845d54d --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClientHttpJsonTest.java @@ -0,0 +1,3044 @@ +/* + * 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.alloydb.v1beta; + +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +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.alloydb.v1beta.stub.HttpJsonAlloyDBAdminStub; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AlloyDBAdminClientHttpJsonTest { + private static MockHttpService mockService; + private static AlloyDBAdminClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonAlloyDBAdminStub.getMethodDescriptors(), + AlloyDBAdminSettings.getDefaultEndpoint()); + AlloyDBAdminSettings settings = + AlloyDBAdminSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + AlloyDBAdminSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AlloyDBAdminClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listClustersTest() throws Exception { + Cluster responsesElement = Cluster.newBuilder().build(); + ListClustersResponse expectedResponse = + ListClustersResponse.newBuilder() + .setNextPageToken("") + .addAllClusters(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListClustersPagedResponse pagedListResponse = client.listClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClustersList().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 listClustersExceptionTest() 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.listClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listClustersTest2() throws Exception { + Cluster responsesElement = Cluster.newBuilder().build(); + ListClustersResponse expectedResponse = + ListClustersResponse.newBuilder() + .setNextPageToken("") + .addAllClusters(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListClustersPagedResponse pagedListResponse = client.listClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClustersList().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 listClustersExceptionTest2() 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.listClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + Cluster actualResponse = client.getCluster(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 getClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + + Cluster actualResponse = client.getCluster(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 getClusterExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createClusterAsync(parent, cluster, clusterId).get(); + 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 createClusterExceptionTest() 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]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createClusterAsync(parent, cluster, clusterId).get(); + 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 createClusterExceptionTest2() 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"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Cluster cluster = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Cluster actualResponse = client.updateClusterAsync(cluster, updateMask).get(); + 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 updateClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Cluster cluster = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateClusterAsync(cluster, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteClusterTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + client.deleteClusterAsync(name).get(); + + 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 deleteClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.deleteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteClusterTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + + client.deleteClusterAsync(name).get(); + + 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 deleteClusterExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + client.deleteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void promoteClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("promoteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + Cluster actualResponse = client.promoteClusterAsync(name).get(); + 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 promoteClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.promoteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void promoteClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("promoteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + + Cluster actualResponse = client.promoteClusterAsync(name).get(); + 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 promoteClusterExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + client.promoteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void restoreClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restoreClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + + Cluster actualResponse = client.restoreClusterAsync(request).get(); + 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 restoreClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + client.restoreClusterAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createSecondaryClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + 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 createSecondaryClusterExceptionTest() 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]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createSecondaryClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + 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 createSecondaryClusterExceptionTest2() 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"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listInstancesTest() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().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 listInstancesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listInstancesTest2() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().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 listInstancesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.getInstance(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 getInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + + Instance actualResponse = client.getInstance(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 getInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + 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 createInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + 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 createInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createSecondaryInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + 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 createSecondaryInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createSecondaryInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + 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 createSecondaryInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void batchCreateInstancesTest() throws Exception { + BatchCreateInstancesResponse expectedResponse = + BatchCreateInstancesResponse.newBuilder() + .addAllInstances(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchCreateInstancesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + + BatchCreateInstancesResponse actualResponse = client.batchCreateInstancesAsync(request).get(); + 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 batchCreateInstancesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + client.batchCreateInstancesAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Instance instance = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Instance actualResponse = client.updateInstanceAsync(instance, updateMask).get(); + 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 updateInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Instance instance = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateInstanceAsync(instance, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteInstanceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + client.deleteInstanceAsync(name).get(); + + 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 deleteInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteInstanceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + + client.deleteInstanceAsync(name).get(); + + 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 deleteInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void failoverInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("failoverInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.failoverInstanceAsync(name).get(); + 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 failoverInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.failoverInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void failoverInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("failoverInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + + Instance actualResponse = client.failoverInstanceAsync(name).get(); + 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 failoverInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + client.failoverInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void restartInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restartInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.restartInstanceAsync(name).get(); + 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 restartInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.restartInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void restartInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restartInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + + Instance actualResponse = client.restartInstanceAsync(name).get(); + 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 restartInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + client.restartInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listBackupsTest() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().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 listBackupsExceptionTest() 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.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().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 listBackupsExceptionTest2() 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.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(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 getBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + + Backup actualResponse = client.getBackup(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 getBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + 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 createBackupExceptionTest() 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]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + 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 createBackupExceptionTest2() 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"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Backup backup = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Backup actualResponse = client.updateBackupAsync(backup, updateMask).get(); + 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 updateBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Backup backup = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackupAsync(backup, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteBackupTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + client.deleteBackupAsync(name).get(); + + 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 deleteBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteBackupTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + + client.deleteBackupAsync(name).get(); + + 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 deleteBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listSupportedDatabaseFlagsTest() throws Exception { + SupportedDatabaseFlag responsesElement = SupportedDatabaseFlag.newBuilder().build(); + ListSupportedDatabaseFlagsResponse expectedResponse = + ListSupportedDatabaseFlagsResponse.newBuilder() + .setNextPageToken("") + .addAllSupportedDatabaseFlags(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListSupportedDatabaseFlagsPagedResponse pagedListResponse = + client.listSupportedDatabaseFlags(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSupportedDatabaseFlagsList().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 listSupportedDatabaseFlagsExceptionTest() 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.listSupportedDatabaseFlags(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSupportedDatabaseFlagsTest2() throws Exception { + SupportedDatabaseFlag responsesElement = SupportedDatabaseFlag.newBuilder().build(); + ListSupportedDatabaseFlagsResponse expectedResponse = + ListSupportedDatabaseFlagsResponse.newBuilder() + .setNextPageToken("") + .addAllSupportedDatabaseFlags(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListSupportedDatabaseFlagsPagedResponse pagedListResponse = + client.listSupportedDatabaseFlags(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSupportedDatabaseFlagsList().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 listSupportedDatabaseFlagsExceptionTest2() 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.listSupportedDatabaseFlags(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateClientCertificateTest() throws Exception { + GenerateClientCertificateResponse expectedResponse = + GenerateClientCertificateResponse.newBuilder() + .setPemCertificate("pemCertificate153491807") + .addAllPemCertificateChain(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + GenerateClientCertificateResponse actualResponse = client.generateClientCertificate(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 generateClientCertificateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.generateClientCertificate(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateClientCertificateTest2() throws Exception { + GenerateClientCertificateResponse expectedResponse = + GenerateClientCertificateResponse.newBuilder() + .setPemCertificate("pemCertificate153491807") + .addAllPemCertificateChain(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + + GenerateClientCertificateResponse actualResponse = client.generateClientCertificate(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 generateClientCertificateExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + client.generateClientCertificate(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConnectionInfoTest() throws Exception { + ConnectionInfo expectedResponse = + ConnectionInfo.newBuilder() + .setName("name3373707") + .setIpAddress("ipAddress1634032845") + .addAllPemCertificateChain(new ArrayList()) + .setInstanceUid("instanceUid-2102004869") + .build(); + mockService.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + ConnectionInfo actualResponse = client.getConnectionInfo(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 getConnectionInfoExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.getConnectionInfo(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConnectionInfoTest2() throws Exception { + ConnectionInfo expectedResponse = + ConnectionInfo.newBuilder() + .setName("name3373707") + .setIpAddress("ipAddress1634032845") + .addAllPemCertificateChain(new ArrayList()) + .setInstanceUid("instanceUid-2102004869") + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-9084/locations/location-9084/clusters/cluster-9084/instances/instance-9084"; + + ConnectionInfo actualResponse = client.getConnectionInfo(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 getConnectionInfoExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-9084/locations/location-9084/clusters/cluster-9084/instances/instance-9084"; + client.getConnectionInfo(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().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 listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + 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 getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClientTest.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClientTest.java new file mode 100644 index 000000000000..fca8be5891cc --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClientTest.java @@ -0,0 +1,2754 @@ +/* + * 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.alloydb.v1beta; + +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListClustersPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AlloyDBAdminClientTest { + private static MockAlloyDBAdmin mockAlloyDBAdmin; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private AlloyDBAdminClient client; + + @BeforeClass + public static void startStaticServer() { + mockAlloyDBAdmin = new MockAlloyDBAdmin(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockAlloyDBAdmin, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + AlloyDBAdminSettings settings = + AlloyDBAdminSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AlloyDBAdminClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listClustersTest() throws Exception { + Cluster responsesElement = Cluster.newBuilder().build(); + ListClustersResponse expectedResponse = + ListClustersResponse.newBuilder() + .setNextPageToken("") + .addAllClusters(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListClustersPagedResponse pagedListResponse = client.listClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClustersList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListClustersRequest actualRequest = ((ListClustersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listClustersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listClustersTest2() throws Exception { + Cluster responsesElement = Cluster.newBuilder().build(); + ListClustersResponse expectedResponse = + ListClustersResponse.newBuilder() + .setNextPageToken("") + .addAllClusters(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListClustersPagedResponse pagedListResponse = client.listClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClustersList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListClustersRequest actualRequest = ((ListClustersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listClustersExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + Cluster actualResponse = client.getCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetClusterRequest actualRequest = ((GetClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + Cluster actualResponse = client.getCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetClusterRequest actualRequest = ((GetClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateClusterRequest actualRequest = ((CreateClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(clusterId, actualRequest.getClusterId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateClusterRequest actualRequest = ((CreateClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(clusterId, actualRequest.getClusterId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + Cluster cluster = Cluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Cluster actualResponse = client.updateClusterAsync(cluster, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateClusterRequest actualRequest = ((UpdateClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + Cluster cluster = Cluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateClusterAsync(cluster, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteClusterTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + client.deleteClusterAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteClusterRequest actualRequest = ((DeleteClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.deleteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteClusterTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteClusterAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteClusterRequest actualRequest = ((DeleteClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void promoteClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("promoteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + Cluster actualResponse = client.promoteClusterAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PromoteClusterRequest actualRequest = ((PromoteClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void promoteClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.promoteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void promoteClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("promoteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + Cluster actualResponse = client.promoteClusterAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PromoteClusterRequest actualRequest = ((PromoteClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void promoteClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.promoteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void restoreClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restoreClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + + Cluster actualResponse = client.restoreClusterAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestoreClusterRequest actualRequest = ((RestoreClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getBackupSource(), actualRequest.getBackupSource()); + Assert.assertEquals( + request.getContinuousBackupSource(), actualRequest.getContinuousBackupSource()); + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getClusterId(), actualRequest.getClusterId()); + Assert.assertEquals(request.getCluster(), actualRequest.getCluster()); + Assert.assertEquals(request.getRequestId(), actualRequest.getRequestId()); + Assert.assertEquals(request.getValidateOnly(), actualRequest.getValidateOnly()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restoreClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + client.restoreClusterAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createSecondaryClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSecondaryClusterRequest actualRequest = + ((CreateSecondaryClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(clusterId, actualRequest.getClusterId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSecondaryClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createSecondaryClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSecondaryClusterRequest actualRequest = + ((CreateSecondaryClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(clusterId, actualRequest.getClusterId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSecondaryClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listInstancesTest() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListInstancesRequest actualRequest = ((ListInstancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listInstancesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listInstancesTest2() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListInstancesRequest actualRequest = ((ListInstancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listInstancesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetInstanceRequest actualRequest = ((GetInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetInstanceRequest actualRequest = ((GetInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateInstanceRequest actualRequest = ((CreateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateInstanceRequest actualRequest = ((CreateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createSecondaryInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSecondaryInstanceRequest actualRequest = + ((CreateSecondaryInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSecondaryInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createSecondaryInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSecondaryInstanceRequest actualRequest = + ((CreateSecondaryInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSecondaryInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void batchCreateInstancesTest() throws Exception { + BatchCreateInstancesResponse expectedResponse = + BatchCreateInstancesResponse.newBuilder() + .addAllInstances(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchCreateInstancesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + + BatchCreateInstancesResponse actualResponse = client.batchCreateInstancesAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchCreateInstancesRequest actualRequest = + ((BatchCreateInstancesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getRequests(), actualRequest.getRequests()); + Assert.assertEquals(request.getRequestId(), actualRequest.getRequestId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void batchCreateInstancesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + client.batchCreateInstancesAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Instance actualResponse = client.updateInstanceAsync(instance, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateInstanceRequest actualRequest = ((UpdateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateInstanceAsync(instance, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteInstanceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteInstanceRequest actualRequest = ((DeleteInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteInstanceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteInstanceRequest actualRequest = ((DeleteInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void failoverInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("failoverInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.failoverInstanceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FailoverInstanceRequest actualRequest = ((FailoverInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void failoverInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.failoverInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void failoverInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("failoverInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + Instance actualResponse = client.failoverInstanceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FailoverInstanceRequest actualRequest = ((FailoverInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void failoverInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.failoverInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void restartInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restartInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.restartInstanceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestartInstanceRequest actualRequest = ((RestartInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restartInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.restartInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void restartInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restartInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + Instance actualResponse = client.restartInstanceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestartInstanceRequest actualRequest = ((RestartInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restartInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.restartInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listBackupsTest() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setClusterUid("clusterUid240271350") + .setClusterName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setReconciling(true) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setSizeBytes(-1796325715) + .setExpiryTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Backup actualResponse = client.updateBackupAsync(backup, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBackupRequest actualRequest = ((UpdateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackupAsync(backup, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteBackupTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + client.deleteBackupAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteBackupTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteBackupAsync(name).get(); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listSupportedDatabaseFlagsTest() throws Exception { + SupportedDatabaseFlag responsesElement = SupportedDatabaseFlag.newBuilder().build(); + ListSupportedDatabaseFlagsResponse expectedResponse = + ListSupportedDatabaseFlagsResponse.newBuilder() + .setNextPageToken("") + .addAllSupportedDatabaseFlags(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListSupportedDatabaseFlagsPagedResponse pagedListResponse = + client.listSupportedDatabaseFlags(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSupportedDatabaseFlagsList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSupportedDatabaseFlagsRequest actualRequest = + ((ListSupportedDatabaseFlagsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSupportedDatabaseFlagsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listSupportedDatabaseFlags(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSupportedDatabaseFlagsTest2() throws Exception { + SupportedDatabaseFlag responsesElement = SupportedDatabaseFlag.newBuilder().build(); + ListSupportedDatabaseFlagsResponse expectedResponse = + ListSupportedDatabaseFlagsResponse.newBuilder() + .setNextPageToken("") + .addAllSupportedDatabaseFlags(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSupportedDatabaseFlagsPagedResponse pagedListResponse = + client.listSupportedDatabaseFlags(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSupportedDatabaseFlagsList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSupportedDatabaseFlagsRequest actualRequest = + ((ListSupportedDatabaseFlagsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSupportedDatabaseFlagsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listSupportedDatabaseFlags(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateClientCertificateTest() throws Exception { + GenerateClientCertificateResponse expectedResponse = + GenerateClientCertificateResponse.newBuilder() + .setPemCertificate("pemCertificate153491807") + .addAllPemCertificateChain(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + GenerateClientCertificateResponse actualResponse = client.generateClientCertificate(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateClientCertificateRequest actualRequest = + ((GenerateClientCertificateRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateClientCertificateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.generateClientCertificate(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateClientCertificateTest2() throws Exception { + GenerateClientCertificateResponse expectedResponse = + GenerateClientCertificateResponse.newBuilder() + .setPemCertificate("pemCertificate153491807") + .addAllPemCertificateChain(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + GenerateClientCertificateResponse actualResponse = client.generateClientCertificate(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateClientCertificateRequest actualRequest = + ((GenerateClientCertificateRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateClientCertificateExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.generateClientCertificate(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConnectionInfoTest() throws Exception { + ConnectionInfo expectedResponse = + ConnectionInfo.newBuilder() + .setName("name3373707") + .setIpAddress("ipAddress1634032845") + .addAllPemCertificateChain(new ArrayList()) + .setInstanceUid("instanceUid-2102004869") + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + ConnectionInfo actualResponse = client.getConnectionInfo(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConnectionInfoRequest actualRequest = ((GetConnectionInfoRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getConnectionInfoExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.getConnectionInfo(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConnectionInfoTest2() throws Exception { + ConnectionInfo expectedResponse = + ConnectionInfo.newBuilder() + .setName("name3373707") + .setIpAddress("ipAddress1634032845") + .addAllPemCertificateChain(new ArrayList()) + .setInstanceUid("instanceUid-2102004869") + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ConnectionInfo actualResponse = client.getConnectionInfo(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConnectionInfoRequest actualRequest = ((GetConnectionInfoRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getConnectionInfoExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.getConnectionInfo(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockAlloyDBAdmin.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockAlloyDBAdmin.java new file mode 100644 index 000000000000..e3740e6cd382 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockAlloyDBAdmin.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.alloydb.v1beta; + +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 MockAlloyDBAdmin implements MockGrpcService { + private final MockAlloyDBAdminImpl serviceImpl; + + public MockAlloyDBAdmin() { + serviceImpl = new MockAlloyDBAdminImpl(); + } + + @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-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockAlloyDBAdminImpl.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockAlloyDBAdminImpl.java new file mode 100644 index 000000000000..9110c9774736 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockAlloyDBAdminImpl.java @@ -0,0 +1,585 @@ +/* + * 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.alloydb.v1beta; + +import com.google.api.core.BetaApi; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminGrpc.AlloyDBAdminImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAlloyDBAdminImpl extends AlloyDBAdminImplBase { + private List requests; + private Queue responses; + + public MockAlloyDBAdminImpl() { + 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 listClusters( + ListClustersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListClustersResponse) { + requests.add(request); + responseObserver.onNext(((ListClustersResponse) 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 ListClusters, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListClustersResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getCluster(GetClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Cluster) { + requests.add(request); + responseObserver.onNext(((Cluster) 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 GetCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Cluster.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createCluster( + CreateClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateCluster( + UpdateClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteCluster( + DeleteClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void promoteCluster( + PromoteClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PromoteCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void restoreCluster( + RestoreClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RestoreCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createSecondaryCluster( + CreateSecondaryClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateSecondaryCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listInstances( + ListInstancesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListInstancesResponse) { + requests.add(request); + responseObserver.onNext(((ListInstancesResponse) 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 ListInstances, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListInstancesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getInstance(GetInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Instance) { + requests.add(request); + responseObserver.onNext(((Instance) 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 GetInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Instance.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createInstance( + CreateInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createSecondaryInstance( + CreateSecondaryInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateSecondaryInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void batchCreateInstances( + BatchCreateInstancesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method BatchCreateInstances, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateInstance( + UpdateInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteInstance( + DeleteInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void failoverInstance( + FailoverInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method FailoverInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void restartInstance( + RestartInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RestartInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listBackups( + ListBackupsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListBackupsResponse) { + requests.add(request); + responseObserver.onNext(((ListBackupsResponse) 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 ListBackups, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBackupsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getBackup(GetBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Backup) { + requests.add(request); + responseObserver.onNext(((Backup) 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 GetBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Backup.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createBackup( + CreateBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBackup( + UpdateBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBackup( + DeleteBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSupportedDatabaseFlags( + ListSupportedDatabaseFlagsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSupportedDatabaseFlagsResponse) { + requests.add(request); + responseObserver.onNext(((ListSupportedDatabaseFlagsResponse) 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 ListSupportedDatabaseFlags, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSupportedDatabaseFlagsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void generateClientCertificate( + GenerateClientCertificateRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GenerateClientCertificateResponse) { + requests.add(request); + responseObserver.onNext(((GenerateClientCertificateResponse) 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 GenerateClientCertificate, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GenerateClientCertificateResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getConnectionInfo( + GetConnectionInfoRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ConnectionInfo) { + requests.add(request); + responseObserver.onNext(((ConnectionInfo) 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 GetConnectionInfo, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ConnectionInfo.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockIAMPolicy.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockIAMPolicy.java new file mode 100644 index 000000000000..11f20859cd9d --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockIAMPolicy.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.alloydb.v1beta; + +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 MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @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-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockIAMPolicyImpl.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockIAMPolicyImpl.java new file mode 100644 index 000000000000..139f3ef1990a --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockIAMPolicyImpl.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.alloydb.v1beta; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.protobuf.AbstractMessage; +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 MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + 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<>(); + } +} diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockLocations.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockLocations.java new file mode 100644 index 000000000000..9217d2db0e37 --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockLocations.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.alloydb.v1beta; + +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 MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @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-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockLocationsImpl.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockLocationsImpl.java new file mode 100644 index 000000000000..deafbc77004a --- /dev/null +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockLocationsImpl.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.alloydb.v1beta; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + 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 listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) 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 ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) 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 GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-alloydb/grpc-google-cloud-alloydb-v1/pom.xml b/java-alloydb/grpc-google-cloud-alloydb-v1/pom.xml new file mode 100644 index 000000000000..a6973d1b49ee --- /dev/null +++ b/java-alloydb/grpc-google-cloud-alloydb-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-alloydb-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-alloydb-v1 + GRPC library for google-cloud-alloydb + + com.google.cloud + google-cloud-alloydb-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-alloydb-v1 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-alloydb/grpc-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminGrpc.java b/java-alloydb/grpc-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminGrpc.java new file mode 100644 index 000000000000..74faa0951b6d --- /dev/null +++ b/java-alloydb/grpc-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminGrpc.java @@ -0,0 +1,2561 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.alloydb.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service describing handlers for resources
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/alloydb/v1/service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class AlloyDBAdminGrpc { + + private AlloyDBAdminGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.alloydb.v1.AlloyDBAdmin"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.ListClustersRequest, + com.google.cloud.alloydb.v1.ListClustersResponse> + getListClustersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListClusters", + requestType = com.google.cloud.alloydb.v1.ListClustersRequest.class, + responseType = com.google.cloud.alloydb.v1.ListClustersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.ListClustersRequest, + com.google.cloud.alloydb.v1.ListClustersResponse> + getListClustersMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.ListClustersRequest, + com.google.cloud.alloydb.v1.ListClustersResponse> + getListClustersMethod; + if ((getListClustersMethod = AlloyDBAdminGrpc.getListClustersMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getListClustersMethod = AlloyDBAdminGrpc.getListClustersMethod) == null) { + AlloyDBAdminGrpc.getListClustersMethod = + getListClustersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListClusters")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.ListClustersRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.ListClustersResponse + .getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("ListClusters")) + .build(); + } + } + } + return getListClustersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.GetClusterRequest, com.google.cloud.alloydb.v1.Cluster> + getGetClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCluster", + requestType = com.google.cloud.alloydb.v1.GetClusterRequest.class, + responseType = com.google.cloud.alloydb.v1.Cluster.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.GetClusterRequest, com.google.cloud.alloydb.v1.Cluster> + getGetClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.GetClusterRequest, com.google.cloud.alloydb.v1.Cluster> + getGetClusterMethod; + if ((getGetClusterMethod = AlloyDBAdminGrpc.getGetClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGetClusterMethod = AlloyDBAdminGrpc.getGetClusterMethod) == null) { + AlloyDBAdminGrpc.getGetClusterMethod = + getGetClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.GetClusterRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.Cluster.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("GetCluster")) + .build(); + } + } + } + return getGetClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateClusterRequest, com.google.longrunning.Operation> + getCreateClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateCluster", + requestType = com.google.cloud.alloydb.v1.CreateClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateClusterRequest, com.google.longrunning.Operation> + getCreateClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateClusterRequest, com.google.longrunning.Operation> + getCreateClusterMethod; + if ((getCreateClusterMethod = AlloyDBAdminGrpc.getCreateClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateClusterMethod = AlloyDBAdminGrpc.getCreateClusterMethod) == null) { + AlloyDBAdminGrpc.getCreateClusterMethod = + getCreateClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.CreateClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("CreateCluster")) + .build(); + } + } + } + return getCreateClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.UpdateClusterRequest, com.google.longrunning.Operation> + getUpdateClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCluster", + requestType = com.google.cloud.alloydb.v1.UpdateClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.UpdateClusterRequest, com.google.longrunning.Operation> + getUpdateClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.UpdateClusterRequest, com.google.longrunning.Operation> + getUpdateClusterMethod; + if ((getUpdateClusterMethod = AlloyDBAdminGrpc.getUpdateClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getUpdateClusterMethod = AlloyDBAdminGrpc.getUpdateClusterMethod) == null) { + AlloyDBAdminGrpc.getUpdateClusterMethod = + getUpdateClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.UpdateClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("UpdateCluster")) + .build(); + } + } + } + return getUpdateClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.DeleteClusterRequest, com.google.longrunning.Operation> + getDeleteClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteCluster", + requestType = com.google.cloud.alloydb.v1.DeleteClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.DeleteClusterRequest, com.google.longrunning.Operation> + getDeleteClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.DeleteClusterRequest, com.google.longrunning.Operation> + getDeleteClusterMethod; + if ((getDeleteClusterMethod = AlloyDBAdminGrpc.getDeleteClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getDeleteClusterMethod = AlloyDBAdminGrpc.getDeleteClusterMethod) == null) { + AlloyDBAdminGrpc.getDeleteClusterMethod = + getDeleteClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.DeleteClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("DeleteCluster")) + .build(); + } + } + } + return getDeleteClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.RestoreClusterRequest, com.google.longrunning.Operation> + getRestoreClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RestoreCluster", + requestType = com.google.cloud.alloydb.v1.RestoreClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.RestoreClusterRequest, com.google.longrunning.Operation> + getRestoreClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.RestoreClusterRequest, com.google.longrunning.Operation> + getRestoreClusterMethod; + if ((getRestoreClusterMethod = AlloyDBAdminGrpc.getRestoreClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getRestoreClusterMethod = AlloyDBAdminGrpc.getRestoreClusterMethod) == null) { + AlloyDBAdminGrpc.getRestoreClusterMethod = + getRestoreClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RestoreCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.RestoreClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("RestoreCluster")) + .build(); + } + } + } + return getRestoreClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.ListInstancesRequest, + com.google.cloud.alloydb.v1.ListInstancesResponse> + getListInstancesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListInstances", + requestType = com.google.cloud.alloydb.v1.ListInstancesRequest.class, + responseType = com.google.cloud.alloydb.v1.ListInstancesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.ListInstancesRequest, + com.google.cloud.alloydb.v1.ListInstancesResponse> + getListInstancesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.ListInstancesRequest, + com.google.cloud.alloydb.v1.ListInstancesResponse> + getListInstancesMethod; + if ((getListInstancesMethod = AlloyDBAdminGrpc.getListInstancesMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getListInstancesMethod = AlloyDBAdminGrpc.getListInstancesMethod) == null) { + AlloyDBAdminGrpc.getListInstancesMethod = + getListInstancesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListInstances")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.ListInstancesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.ListInstancesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("ListInstances")) + .build(); + } + } + } + return getListInstancesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.GetInstanceRequest, com.google.cloud.alloydb.v1.Instance> + getGetInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetInstance", + requestType = com.google.cloud.alloydb.v1.GetInstanceRequest.class, + responseType = com.google.cloud.alloydb.v1.Instance.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.GetInstanceRequest, com.google.cloud.alloydb.v1.Instance> + getGetInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.GetInstanceRequest, com.google.cloud.alloydb.v1.Instance> + getGetInstanceMethod; + if ((getGetInstanceMethod = AlloyDBAdminGrpc.getGetInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGetInstanceMethod = AlloyDBAdminGrpc.getGetInstanceMethod) == null) { + AlloyDBAdminGrpc.getGetInstanceMethod = + getGetInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.GetInstanceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.Instance.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("GetInstance")) + .build(); + } + } + } + return getGetInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateInstanceRequest, com.google.longrunning.Operation> + getCreateInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateInstance", + requestType = com.google.cloud.alloydb.v1.CreateInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateInstanceRequest, com.google.longrunning.Operation> + getCreateInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateInstanceRequest, com.google.longrunning.Operation> + getCreateInstanceMethod; + if ((getCreateInstanceMethod = AlloyDBAdminGrpc.getCreateInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateInstanceMethod = AlloyDBAdminGrpc.getCreateInstanceMethod) == null) { + AlloyDBAdminGrpc.getCreateInstanceMethod = + getCreateInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.CreateInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("CreateInstance")) + .build(); + } + } + } + return getCreateInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.BatchCreateInstancesRequest, com.google.longrunning.Operation> + getBatchCreateInstancesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BatchCreateInstances", + requestType = com.google.cloud.alloydb.v1.BatchCreateInstancesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.BatchCreateInstancesRequest, com.google.longrunning.Operation> + getBatchCreateInstancesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.BatchCreateInstancesRequest, + com.google.longrunning.Operation> + getBatchCreateInstancesMethod; + if ((getBatchCreateInstancesMethod = AlloyDBAdminGrpc.getBatchCreateInstancesMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getBatchCreateInstancesMethod = AlloyDBAdminGrpc.getBatchCreateInstancesMethod) + == null) { + AlloyDBAdminGrpc.getBatchCreateInstancesMethod = + getBatchCreateInstancesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "BatchCreateInstances")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.BatchCreateInstancesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("BatchCreateInstances")) + .build(); + } + } + } + return getBatchCreateInstancesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.UpdateInstanceRequest, com.google.longrunning.Operation> + getUpdateInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateInstance", + requestType = com.google.cloud.alloydb.v1.UpdateInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.UpdateInstanceRequest, com.google.longrunning.Operation> + getUpdateInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.UpdateInstanceRequest, com.google.longrunning.Operation> + getUpdateInstanceMethod; + if ((getUpdateInstanceMethod = AlloyDBAdminGrpc.getUpdateInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getUpdateInstanceMethod = AlloyDBAdminGrpc.getUpdateInstanceMethod) == null) { + AlloyDBAdminGrpc.getUpdateInstanceMethod = + getUpdateInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.UpdateInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("UpdateInstance")) + .build(); + } + } + } + return getUpdateInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.DeleteInstanceRequest, com.google.longrunning.Operation> + getDeleteInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteInstance", + requestType = com.google.cloud.alloydb.v1.DeleteInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.DeleteInstanceRequest, com.google.longrunning.Operation> + getDeleteInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.DeleteInstanceRequest, com.google.longrunning.Operation> + getDeleteInstanceMethod; + if ((getDeleteInstanceMethod = AlloyDBAdminGrpc.getDeleteInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getDeleteInstanceMethod = AlloyDBAdminGrpc.getDeleteInstanceMethod) == null) { + AlloyDBAdminGrpc.getDeleteInstanceMethod = + getDeleteInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.DeleteInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("DeleteInstance")) + .build(); + } + } + } + return getDeleteInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.FailoverInstanceRequest, com.google.longrunning.Operation> + getFailoverInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FailoverInstance", + requestType = com.google.cloud.alloydb.v1.FailoverInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.FailoverInstanceRequest, com.google.longrunning.Operation> + getFailoverInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.FailoverInstanceRequest, com.google.longrunning.Operation> + getFailoverInstanceMethod; + if ((getFailoverInstanceMethod = AlloyDBAdminGrpc.getFailoverInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getFailoverInstanceMethod = AlloyDBAdminGrpc.getFailoverInstanceMethod) == null) { + AlloyDBAdminGrpc.getFailoverInstanceMethod = + getFailoverInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "FailoverInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.FailoverInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("FailoverInstance")) + .build(); + } + } + } + return getFailoverInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.RestartInstanceRequest, com.google.longrunning.Operation> + getRestartInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RestartInstance", + requestType = com.google.cloud.alloydb.v1.RestartInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.RestartInstanceRequest, com.google.longrunning.Operation> + getRestartInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.RestartInstanceRequest, com.google.longrunning.Operation> + getRestartInstanceMethod; + if ((getRestartInstanceMethod = AlloyDBAdminGrpc.getRestartInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getRestartInstanceMethod = AlloyDBAdminGrpc.getRestartInstanceMethod) == null) { + AlloyDBAdminGrpc.getRestartInstanceMethod = + getRestartInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RestartInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.RestartInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("RestartInstance")) + .build(); + } + } + } + return getRestartInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.ListBackupsRequest, + com.google.cloud.alloydb.v1.ListBackupsResponse> + getListBackupsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBackups", + requestType = com.google.cloud.alloydb.v1.ListBackupsRequest.class, + responseType = com.google.cloud.alloydb.v1.ListBackupsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.ListBackupsRequest, + com.google.cloud.alloydb.v1.ListBackupsResponse> + getListBackupsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.ListBackupsRequest, + com.google.cloud.alloydb.v1.ListBackupsResponse> + getListBackupsMethod; + if ((getListBackupsMethod = AlloyDBAdminGrpc.getListBackupsMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getListBackupsMethod = AlloyDBAdminGrpc.getListBackupsMethod) == null) { + AlloyDBAdminGrpc.getListBackupsMethod = + getListBackupsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBackups")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.ListBackupsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.ListBackupsResponse.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("ListBackups")) + .build(); + } + } + } + return getListBackupsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.GetBackupRequest, com.google.cloud.alloydb.v1.Backup> + getGetBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBackup", + requestType = com.google.cloud.alloydb.v1.GetBackupRequest.class, + responseType = com.google.cloud.alloydb.v1.Backup.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.GetBackupRequest, com.google.cloud.alloydb.v1.Backup> + getGetBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.GetBackupRequest, com.google.cloud.alloydb.v1.Backup> + getGetBackupMethod; + if ((getGetBackupMethod = AlloyDBAdminGrpc.getGetBackupMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGetBackupMethod = AlloyDBAdminGrpc.getGetBackupMethod) == null) { + AlloyDBAdminGrpc.getGetBackupMethod = + getGetBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.Backup.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("GetBackup")) + .build(); + } + } + } + return getGetBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBackup", + requestType = com.google.cloud.alloydb.v1.CreateBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod; + if ((getCreateBackupMethod = AlloyDBAdminGrpc.getCreateBackupMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateBackupMethod = AlloyDBAdminGrpc.getCreateBackupMethod) == null) { + AlloyDBAdminGrpc.getCreateBackupMethod = + getCreateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.CreateBackupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("CreateBackup")) + .build(); + } + } + } + return getCreateBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.UpdateBackupRequest, com.google.longrunning.Operation> + getUpdateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBackup", + requestType = com.google.cloud.alloydb.v1.UpdateBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.UpdateBackupRequest, com.google.longrunning.Operation> + getUpdateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.UpdateBackupRequest, com.google.longrunning.Operation> + getUpdateBackupMethod; + if ((getUpdateBackupMethod = AlloyDBAdminGrpc.getUpdateBackupMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getUpdateBackupMethod = AlloyDBAdminGrpc.getUpdateBackupMethod) == null) { + AlloyDBAdminGrpc.getUpdateBackupMethod = + getUpdateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.UpdateBackupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("UpdateBackup")) + .build(); + } + } + } + return getUpdateBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.DeleteBackupRequest, com.google.longrunning.Operation> + getDeleteBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBackup", + requestType = com.google.cloud.alloydb.v1.DeleteBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.DeleteBackupRequest, com.google.longrunning.Operation> + getDeleteBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.DeleteBackupRequest, com.google.longrunning.Operation> + getDeleteBackupMethod; + if ((getDeleteBackupMethod = AlloyDBAdminGrpc.getDeleteBackupMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getDeleteBackupMethod = AlloyDBAdminGrpc.getDeleteBackupMethod) == null) { + AlloyDBAdminGrpc.getDeleteBackupMethod = + getDeleteBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.DeleteBackupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("DeleteBackup")) + .build(); + } + } + } + return getDeleteBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest, + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse> + getListSupportedDatabaseFlagsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSupportedDatabaseFlags", + requestType = com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.class, + responseType = com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest, + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse> + getListSupportedDatabaseFlagsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest, + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse> + getListSupportedDatabaseFlagsMethod; + if ((getListSupportedDatabaseFlagsMethod = AlloyDBAdminGrpc.getListSupportedDatabaseFlagsMethod) + == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getListSupportedDatabaseFlagsMethod = + AlloyDBAdminGrpc.getListSupportedDatabaseFlagsMethod) + == null) { + AlloyDBAdminGrpc.getListSupportedDatabaseFlagsMethod = + getListSupportedDatabaseFlagsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListSupportedDatabaseFlags")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("ListSupportedDatabaseFlags")) + .build(); + } + } + } + return getListSupportedDatabaseFlagsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AlloyDBAdminStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AlloyDBAdminStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminStub(channel, callOptions); + } + }; + return AlloyDBAdminStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AlloyDBAdminBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AlloyDBAdminBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminBlockingStub(channel, callOptions); + } + }; + return AlloyDBAdminBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AlloyDBAdminFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AlloyDBAdminFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminFutureStub(channel, callOptions); + } + }; + return AlloyDBAdminFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public abstract static class AlloyDBAdminImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists Clusters in a given project and location.
+     * 
+ */ + public void listClusters( + com.google.cloud.alloydb.v1.ListClustersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListClustersMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Cluster.
+     * 
+ */ + public void getCluster( + com.google.cloud.alloydb.v1.GetClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location.
+     * 
+ */ + public void createCluster( + com.google.cloud.alloydb.v1.CreateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Cluster.
+     * 
+ */ + public void updateCluster( + com.google.cloud.alloydb.v1.UpdateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single Cluster.
+     * 
+ */ + public void deleteCluster( + com.google.cloud.alloydb.v1.DeleteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location, with a volume
+     * restored from the provided source, either a backup ID or a point-in-time
+     * and a source cluster.
+     * 
+ */ + public void restoreCluster( + com.google.cloud.alloydb.v1.RestoreClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRestoreClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists Instances in a given project and location.
+     * 
+ */ + public void listInstances( + com.google.cloud.alloydb.v1.ListInstancesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListInstancesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Instance.
+     * 
+ */ + public void getInstance( + com.google.cloud.alloydb.v1.GetInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Instance in a given project and location.
+     * 
+ */ + public void createInstance( + com.google.cloud.alloydb.v1.CreateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates new instances under the given project, location and cluster.
+     * There can be only one primary instance in a cluster. If the primary
+     * instance exists in the cluster as well as this request, then API will
+     * throw an error.
+     * The primary instance should exist before any read pool instance is
+     * created. If the primary instance is a part of the request payload, then
+     * the API will take care of creating instances in the correct order.
+     * This method is here to support Google-internal use cases, and is not meant
+     * for external customers to consume. Please do not start relying on it; its
+     * behavior is subject to change without notice.
+     * 
+ */ + public void batchCreateInstances( + com.google.cloud.alloydb.v1.BatchCreateInstancesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getBatchCreateInstancesMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Instance.
+     * 
+ */ + public void updateInstance( + com.google.cloud.alloydb.v1.UpdateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single Instance.
+     * 
+ */ + public void deleteInstance( + com.google.cloud.alloydb.v1.DeleteInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Forces a Failover for a highly available instance.
+     * Failover promotes the HA standby instance as the new primary.
+     * Imperative only.
+     * 
+ */ + public void failoverInstance( + com.google.cloud.alloydb.v1.FailoverInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFailoverInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Restart an Instance in a cluster.
+     * Imperative only.
+     * 
+ */ + public void restartInstance( + com.google.cloud.alloydb.v1.RestartInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRestartInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists Backups in a given project and location.
+     * 
+ */ + public void listBackups( + com.google.cloud.alloydb.v1.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListBackupsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Backup.
+     * 
+ */ + public void getBackup( + com.google.cloud.alloydb.v1.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Backup in a given project and location.
+     * 
+ */ + public void createBackup( + com.google.cloud.alloydb.v1.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Backup.
+     * 
+ */ + public void updateBackup( + com.google.cloud.alloydb.v1.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single Backup.
+     * 
+ */ + public void deleteBackup( + com.google.cloud.alloydb.v1.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists SupportedDatabaseFlags for a given project and location.
+     * 
+ */ + public void listSupportedDatabaseFlags( + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSupportedDatabaseFlagsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListClustersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.ListClustersRequest, + com.google.cloud.alloydb.v1.ListClustersResponse>( + this, METHODID_LIST_CLUSTERS))) + .addMethod( + getGetClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.GetClusterRequest, + com.google.cloud.alloydb.v1.Cluster>(this, METHODID_GET_CLUSTER))) + .addMethod( + getCreateClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.CreateClusterRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_CLUSTER))) + .addMethod( + getUpdateClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.UpdateClusterRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_CLUSTER))) + .addMethod( + getDeleteClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.DeleteClusterRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_CLUSTER))) + .addMethod( + getRestoreClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.RestoreClusterRequest, + com.google.longrunning.Operation>(this, METHODID_RESTORE_CLUSTER))) + .addMethod( + getListInstancesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.ListInstancesRequest, + com.google.cloud.alloydb.v1.ListInstancesResponse>( + this, METHODID_LIST_INSTANCES))) + .addMethod( + getGetInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.GetInstanceRequest, + com.google.cloud.alloydb.v1.Instance>(this, METHODID_GET_INSTANCE))) + .addMethod( + getCreateInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.CreateInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_INSTANCE))) + .addMethod( + getBatchCreateInstancesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.BatchCreateInstancesRequest, + com.google.longrunning.Operation>(this, METHODID_BATCH_CREATE_INSTANCES))) + .addMethod( + getUpdateInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.UpdateInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_INSTANCE))) + .addMethod( + getDeleteInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.DeleteInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_INSTANCE))) + .addMethod( + getFailoverInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.FailoverInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_FAILOVER_INSTANCE))) + .addMethod( + getRestartInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.RestartInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_RESTART_INSTANCE))) + .addMethod( + getListBackupsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.ListBackupsRequest, + com.google.cloud.alloydb.v1.ListBackupsResponse>( + this, METHODID_LIST_BACKUPS))) + .addMethod( + getGetBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.GetBackupRequest, + com.google.cloud.alloydb.v1.Backup>(this, METHODID_GET_BACKUP))) + .addMethod( + getCreateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.CreateBackupRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_BACKUP))) + .addMethod( + getUpdateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.UpdateBackupRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_BACKUP))) + .addMethod( + getDeleteBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.DeleteBackupRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_BACKUP))) + .addMethod( + getListSupportedDatabaseFlagsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest, + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse>( + this, METHODID_LIST_SUPPORTED_DATABASE_FLAGS))) + .build(); + } + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class AlloyDBAdminStub + extends io.grpc.stub.AbstractAsyncStub { + private AlloyDBAdminStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AlloyDBAdminStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Clusters in a given project and location.
+     * 
+ */ + public void listClusters( + com.google.cloud.alloydb.v1.ListClustersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListClustersMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Cluster.
+     * 
+ */ + public void getCluster( + com.google.cloud.alloydb.v1.GetClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetClusterMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location.
+     * 
+ */ + public void createCluster( + com.google.cloud.alloydb.v1.CreateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Cluster.
+     * 
+ */ + public void updateCluster( + com.google.cloud.alloydb.v1.UpdateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single Cluster.
+     * 
+ */ + public void deleteCluster( + com.google.cloud.alloydb.v1.DeleteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location, with a volume
+     * restored from the provided source, either a backup ID or a point-in-time
+     * and a source cluster.
+     * 
+ */ + public void restoreCluster( + com.google.cloud.alloydb.v1.RestoreClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRestoreClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists Instances in a given project and location.
+     * 
+ */ + public void listInstances( + com.google.cloud.alloydb.v1.ListInstancesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListInstancesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Instance.
+     * 
+ */ + public void getInstance( + com.google.cloud.alloydb.v1.GetInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new Instance in a given project and location.
+     * 
+ */ + public void createInstance( + com.google.cloud.alloydb.v1.CreateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates new instances under the given project, location and cluster.
+     * There can be only one primary instance in a cluster. If the primary
+     * instance exists in the cluster as well as this request, then API will
+     * throw an error.
+     * The primary instance should exist before any read pool instance is
+     * created. If the primary instance is a part of the request payload, then
+     * the API will take care of creating instances in the correct order.
+     * This method is here to support Google-internal use cases, and is not meant
+     * for external customers to consume. Please do not start relying on it; its
+     * behavior is subject to change without notice.
+     * 
+ */ + public void batchCreateInstances( + com.google.cloud.alloydb.v1.BatchCreateInstancesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBatchCreateInstancesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Instance.
+     * 
+ */ + public void updateInstance( + com.google.cloud.alloydb.v1.UpdateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single Instance.
+     * 
+ */ + public void deleteInstance( + com.google.cloud.alloydb.v1.DeleteInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Forces a Failover for a highly available instance.
+     * Failover promotes the HA standby instance as the new primary.
+     * Imperative only.
+     * 
+ */ + public void failoverInstance( + com.google.cloud.alloydb.v1.FailoverInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFailoverInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Restart an Instance in a cluster.
+     * Imperative only.
+     * 
+ */ + public void restartInstance( + com.google.cloud.alloydb.v1.RestartInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRestartInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists Backups in a given project and location.
+     * 
+ */ + public void listBackups( + com.google.cloud.alloydb.v1.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Backup.
+     * 
+ */ + public void getBackup( + com.google.cloud.alloydb.v1.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new Backup in a given project and location.
+     * 
+ */ + public void createBackup( + com.google.cloud.alloydb.v1.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Backup.
+     * 
+ */ + public void updateBackup( + com.google.cloud.alloydb.v1.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single Backup.
+     * 
+ */ + public void deleteBackup( + com.google.cloud.alloydb.v1.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists SupportedDatabaseFlags for a given project and location.
+     * 
+ */ + public void listSupportedDatabaseFlags( + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSupportedDatabaseFlagsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class AlloyDBAdminBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private AlloyDBAdminBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AlloyDBAdminBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Clusters in a given project and location.
+     * 
+ */ + public com.google.cloud.alloydb.v1.ListClustersResponse listClusters( + com.google.cloud.alloydb.v1.ListClustersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListClustersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Cluster.
+     * 
+ */ + public com.google.cloud.alloydb.v1.Cluster getCluster( + com.google.cloud.alloydb.v1.GetClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createCluster( + com.google.cloud.alloydb.v1.CreateClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Cluster.
+     * 
+ */ + public com.google.longrunning.Operation updateCluster( + com.google.cloud.alloydb.v1.UpdateClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single Cluster.
+     * 
+ */ + public com.google.longrunning.Operation deleteCluster( + com.google.cloud.alloydb.v1.DeleteClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location, with a volume
+     * restored from the provided source, either a backup ID or a point-in-time
+     * and a source cluster.
+     * 
+ */ + public com.google.longrunning.Operation restoreCluster( + com.google.cloud.alloydb.v1.RestoreClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRestoreClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists Instances in a given project and location.
+     * 
+ */ + public com.google.cloud.alloydb.v1.ListInstancesResponse listInstances( + com.google.cloud.alloydb.v1.ListInstancesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListInstancesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Instance.
+     * 
+ */ + public com.google.cloud.alloydb.v1.Instance getInstance( + com.google.cloud.alloydb.v1.GetInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Instance in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createInstance( + com.google.cloud.alloydb.v1.CreateInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates new instances under the given project, location and cluster.
+     * There can be only one primary instance in a cluster. If the primary
+     * instance exists in the cluster as well as this request, then API will
+     * throw an error.
+     * The primary instance should exist before any read pool instance is
+     * created. If the primary instance is a part of the request payload, then
+     * the API will take care of creating instances in the correct order.
+     * This method is here to support Google-internal use cases, and is not meant
+     * for external customers to consume. Please do not start relying on it; its
+     * behavior is subject to change without notice.
+     * 
+ */ + public com.google.longrunning.Operation batchCreateInstances( + com.google.cloud.alloydb.v1.BatchCreateInstancesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBatchCreateInstancesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Instance.
+     * 
+ */ + public com.google.longrunning.Operation updateInstance( + com.google.cloud.alloydb.v1.UpdateInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single Instance.
+     * 
+ */ + public com.google.longrunning.Operation deleteInstance( + com.google.cloud.alloydb.v1.DeleteInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Forces a Failover for a highly available instance.
+     * Failover promotes the HA standby instance as the new primary.
+     * Imperative only.
+     * 
+ */ + public com.google.longrunning.Operation failoverInstance( + com.google.cloud.alloydb.v1.FailoverInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFailoverInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Restart an Instance in a cluster.
+     * Imperative only.
+     * 
+ */ + public com.google.longrunning.Operation restartInstance( + com.google.cloud.alloydb.v1.RestartInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRestartInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists Backups in a given project and location.
+     * 
+ */ + public com.google.cloud.alloydb.v1.ListBackupsResponse listBackups( + com.google.cloud.alloydb.v1.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBackupsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Backup.
+     * 
+ */ + public com.google.cloud.alloydb.v1.Backup getBackup( + com.google.cloud.alloydb.v1.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Backup in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createBackup( + com.google.cloud.alloydb.v1.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Backup.
+     * 
+ */ + public com.google.longrunning.Operation updateBackup( + com.google.cloud.alloydb.v1.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single Backup.
+     * 
+ */ + public com.google.longrunning.Operation deleteBackup( + com.google.cloud.alloydb.v1.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists SupportedDatabaseFlags for a given project and location.
+     * 
+ */ + public com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + listSupportedDatabaseFlags( + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSupportedDatabaseFlagsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class AlloyDBAdminFutureStub + extends io.grpc.stub.AbstractFutureStub { + private AlloyDBAdminFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AlloyDBAdminFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Clusters in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1.ListClustersResponse> + listClusters(com.google.cloud.alloydb.v1.ListClustersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListClustersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getCluster(com.google.cloud.alloydb.v1.GetClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createCluster(com.google.cloud.alloydb.v1.CreateClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateCluster(com.google.cloud.alloydb.v1.UpdateClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single Cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteCluster(com.google.cloud.alloydb.v1.DeleteClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location, with a volume
+     * restored from the provided source, either a backup ID or a point-in-time
+     * and a source cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + restoreCluster(com.google.cloud.alloydb.v1.RestoreClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRestoreClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists Instances in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1.ListInstancesResponse> + listInstances(com.google.cloud.alloydb.v1.ListInstancesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListInstancesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getInstance(com.google.cloud.alloydb.v1.GetInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Instance in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createInstance(com.google.cloud.alloydb.v1.CreateInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates new instances under the given project, location and cluster.
+     * There can be only one primary instance in a cluster. If the primary
+     * instance exists in the cluster as well as this request, then API will
+     * throw an error.
+     * The primary instance should exist before any read pool instance is
+     * created. If the primary instance is a part of the request payload, then
+     * the API will take care of creating instances in the correct order.
+     * This method is here to support Google-internal use cases, and is not meant
+     * for external customers to consume. Please do not start relying on it; its
+     * behavior is subject to change without notice.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + batchCreateInstances(com.google.cloud.alloydb.v1.BatchCreateInstancesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBatchCreateInstancesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateInstance(com.google.cloud.alloydb.v1.UpdateInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single Instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteInstance(com.google.cloud.alloydb.v1.DeleteInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Forces a Failover for a highly available instance.
+     * Failover promotes the HA standby instance as the new primary.
+     * Imperative only.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + failoverInstance(com.google.cloud.alloydb.v1.FailoverInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFailoverInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Restart an Instance in a cluster.
+     * Imperative only.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + restartInstance(com.google.cloud.alloydb.v1.RestartInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRestartInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists Backups in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1.ListBackupsResponse> + listBackups(com.google.cloud.alloydb.v1.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getBackup(com.google.cloud.alloydb.v1.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Backup in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createBackup(com.google.cloud.alloydb.v1.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateBackup(com.google.cloud.alloydb.v1.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single Backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteBackup(com.google.cloud.alloydb.v1.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists SupportedDatabaseFlags for a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse> + listSupportedDatabaseFlags( + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSupportedDatabaseFlagsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_CLUSTERS = 0; + private static final int METHODID_GET_CLUSTER = 1; + private static final int METHODID_CREATE_CLUSTER = 2; + private static final int METHODID_UPDATE_CLUSTER = 3; + private static final int METHODID_DELETE_CLUSTER = 4; + private static final int METHODID_RESTORE_CLUSTER = 5; + private static final int METHODID_LIST_INSTANCES = 6; + private static final int METHODID_GET_INSTANCE = 7; + private static final int METHODID_CREATE_INSTANCE = 8; + private static final int METHODID_BATCH_CREATE_INSTANCES = 9; + private static final int METHODID_UPDATE_INSTANCE = 10; + private static final int METHODID_DELETE_INSTANCE = 11; + private static final int METHODID_FAILOVER_INSTANCE = 12; + private static final int METHODID_RESTART_INSTANCE = 13; + private static final int METHODID_LIST_BACKUPS = 14; + private static final int METHODID_GET_BACKUP = 15; + private static final int METHODID_CREATE_BACKUP = 16; + private static final int METHODID_UPDATE_BACKUP = 17; + private static final int METHODID_DELETE_BACKUP = 18; + private static final int METHODID_LIST_SUPPORTED_DATABASE_FLAGS = 19; + + 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 AlloyDBAdminImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AlloyDBAdminImplBase 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_CLUSTERS: + serviceImpl.listClusters( + (com.google.cloud.alloydb.v1.ListClustersRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_CLUSTER: + serviceImpl.getCluster( + (com.google.cloud.alloydb.v1.GetClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_CLUSTER: + serviceImpl.createCluster( + (com.google.cloud.alloydb.v1.CreateClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_CLUSTER: + serviceImpl.updateCluster( + (com.google.cloud.alloydb.v1.UpdateClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_CLUSTER: + serviceImpl.deleteCluster( + (com.google.cloud.alloydb.v1.DeleteClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESTORE_CLUSTER: + serviceImpl.restoreCluster( + (com.google.cloud.alloydb.v1.RestoreClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_INSTANCES: + serviceImpl.listInstances( + (com.google.cloud.alloydb.v1.ListInstancesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_INSTANCE: + serviceImpl.getInstance( + (com.google.cloud.alloydb.v1.GetInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_INSTANCE: + serviceImpl.createInstance( + (com.google.cloud.alloydb.v1.CreateInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_BATCH_CREATE_INSTANCES: + serviceImpl.batchCreateInstances( + (com.google.cloud.alloydb.v1.BatchCreateInstancesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_INSTANCE: + serviceImpl.updateInstance( + (com.google.cloud.alloydb.v1.UpdateInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_INSTANCE: + serviceImpl.deleteInstance( + (com.google.cloud.alloydb.v1.DeleteInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_FAILOVER_INSTANCE: + serviceImpl.failoverInstance( + (com.google.cloud.alloydb.v1.FailoverInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESTART_INSTANCE: + serviceImpl.restartInstance( + (com.google.cloud.alloydb.v1.RestartInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_BACKUPS: + serviceImpl.listBackups( + (com.google.cloud.alloydb.v1.ListBackupsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_BACKUP: + serviceImpl.getBackup( + (com.google.cloud.alloydb.v1.GetBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_BACKUP: + serviceImpl.createBackup( + (com.google.cloud.alloydb.v1.CreateBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_BACKUP: + serviceImpl.updateBackup( + (com.google.cloud.alloydb.v1.UpdateBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_BACKUP: + serviceImpl.deleteBackup( + (com.google.cloud.alloydb.v1.DeleteBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SUPPORTED_DATABASE_FLAGS: + serviceImpl.listSupportedDatabaseFlags( + (com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse>) + 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 AlloyDBAdminBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AlloyDBAdminBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AlloyDBAdmin"); + } + } + + private static final class AlloyDBAdminFileDescriptorSupplier + extends AlloyDBAdminBaseDescriptorSupplier { + AlloyDBAdminFileDescriptorSupplier() {} + } + + private static final class AlloyDBAdminMethodDescriptorSupplier + extends AlloyDBAdminBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AlloyDBAdminMethodDescriptorSupplier(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 (AlloyDBAdminGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AlloyDBAdminFileDescriptorSupplier()) + .addMethod(getListClustersMethod()) + .addMethod(getGetClusterMethod()) + .addMethod(getCreateClusterMethod()) + .addMethod(getUpdateClusterMethod()) + .addMethod(getDeleteClusterMethod()) + .addMethod(getRestoreClusterMethod()) + .addMethod(getListInstancesMethod()) + .addMethod(getGetInstanceMethod()) + .addMethod(getCreateInstanceMethod()) + .addMethod(getBatchCreateInstancesMethod()) + .addMethod(getUpdateInstanceMethod()) + .addMethod(getDeleteInstanceMethod()) + .addMethod(getFailoverInstanceMethod()) + .addMethod(getRestartInstanceMethod()) + .addMethod(getListBackupsMethod()) + .addMethod(getGetBackupMethod()) + .addMethod(getCreateBackupMethod()) + .addMethod(getUpdateBackupMethod()) + .addMethod(getDeleteBackupMethod()) + .addMethod(getListSupportedDatabaseFlagsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-alloydb/grpc-google-cloud-alloydb-v1alpha/pom.xml b/java-alloydb/grpc-google-cloud-alloydb-v1alpha/pom.xml new file mode 100644 index 000000000000..2d7915a7cc35 --- /dev/null +++ b/java-alloydb/grpc-google-cloud-alloydb-v1alpha/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-alloydb-v1alpha + 0.0.1-SNAPSHOT + grpc-google-cloud-alloydb-v1alpha + GRPC library for google-cloud-alloydb + + com.google.cloud + google-cloud-alloydb-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-alloydb-v1alpha + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-alloydb/grpc-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminGrpc.java b/java-alloydb/grpc-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminGrpc.java new file mode 100644 index 000000000000..8e0ec77b6801 --- /dev/null +++ b/java-alloydb/grpc-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminGrpc.java @@ -0,0 +1,3230 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.alloydb.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service describing handlers for resources
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/alloydb/v1alpha/service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class AlloyDBAdminGrpc { + + private AlloyDBAdminGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.alloydb.v1alpha.AlloyDBAdmin"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.ListClustersRequest, + com.google.cloud.alloydb.v1alpha.ListClustersResponse> + getListClustersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListClusters", + requestType = com.google.cloud.alloydb.v1alpha.ListClustersRequest.class, + responseType = com.google.cloud.alloydb.v1alpha.ListClustersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.ListClustersRequest, + com.google.cloud.alloydb.v1alpha.ListClustersResponse> + getListClustersMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.ListClustersRequest, + com.google.cloud.alloydb.v1alpha.ListClustersResponse> + getListClustersMethod; + if ((getListClustersMethod = AlloyDBAdminGrpc.getListClustersMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getListClustersMethod = AlloyDBAdminGrpc.getListClustersMethod) == null) { + AlloyDBAdminGrpc.getListClustersMethod = + getListClustersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListClusters")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.ListClustersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.ListClustersResponse + .getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("ListClusters")) + .build(); + } + } + } + return getListClustersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GetClusterRequest, + com.google.cloud.alloydb.v1alpha.Cluster> + getGetClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCluster", + requestType = com.google.cloud.alloydb.v1alpha.GetClusterRequest.class, + responseType = com.google.cloud.alloydb.v1alpha.Cluster.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GetClusterRequest, + com.google.cloud.alloydb.v1alpha.Cluster> + getGetClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GetClusterRequest, + com.google.cloud.alloydb.v1alpha.Cluster> + getGetClusterMethod; + if ((getGetClusterMethod = AlloyDBAdminGrpc.getGetClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGetClusterMethod = AlloyDBAdminGrpc.getGetClusterMethod) == null) { + AlloyDBAdminGrpc.getGetClusterMethod = + getGetClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.GetClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("GetCluster")) + .build(); + } + } + } + return getGetClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateClusterRequest, com.google.longrunning.Operation> + getCreateClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateCluster", + requestType = com.google.cloud.alloydb.v1alpha.CreateClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateClusterRequest, com.google.longrunning.Operation> + getCreateClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateClusterRequest, com.google.longrunning.Operation> + getCreateClusterMethod; + if ((getCreateClusterMethod = AlloyDBAdminGrpc.getCreateClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateClusterMethod = AlloyDBAdminGrpc.getCreateClusterMethod) == null) { + AlloyDBAdminGrpc.getCreateClusterMethod = + getCreateClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.CreateClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("CreateCluster")) + .build(); + } + } + } + return getCreateClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.UpdateClusterRequest, com.google.longrunning.Operation> + getUpdateClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCluster", + requestType = com.google.cloud.alloydb.v1alpha.UpdateClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.UpdateClusterRequest, com.google.longrunning.Operation> + getUpdateClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.UpdateClusterRequest, com.google.longrunning.Operation> + getUpdateClusterMethod; + if ((getUpdateClusterMethod = AlloyDBAdminGrpc.getUpdateClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getUpdateClusterMethod = AlloyDBAdminGrpc.getUpdateClusterMethod) == null) { + AlloyDBAdminGrpc.getUpdateClusterMethod = + getUpdateClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.UpdateClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("UpdateCluster")) + .build(); + } + } + } + return getUpdateClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.DeleteClusterRequest, com.google.longrunning.Operation> + getDeleteClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteCluster", + requestType = com.google.cloud.alloydb.v1alpha.DeleteClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.DeleteClusterRequest, com.google.longrunning.Operation> + getDeleteClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.DeleteClusterRequest, com.google.longrunning.Operation> + getDeleteClusterMethod; + if ((getDeleteClusterMethod = AlloyDBAdminGrpc.getDeleteClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getDeleteClusterMethod = AlloyDBAdminGrpc.getDeleteClusterMethod) == null) { + AlloyDBAdminGrpc.getDeleteClusterMethod = + getDeleteClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.DeleteClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("DeleteCluster")) + .build(); + } + } + } + return getDeleteClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.PromoteClusterRequest, com.google.longrunning.Operation> + getPromoteClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PromoteCluster", + requestType = com.google.cloud.alloydb.v1alpha.PromoteClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.PromoteClusterRequest, com.google.longrunning.Operation> + getPromoteClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.PromoteClusterRequest, + com.google.longrunning.Operation> + getPromoteClusterMethod; + if ((getPromoteClusterMethod = AlloyDBAdminGrpc.getPromoteClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getPromoteClusterMethod = AlloyDBAdminGrpc.getPromoteClusterMethod) == null) { + AlloyDBAdminGrpc.getPromoteClusterMethod = + getPromoteClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PromoteCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.PromoteClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("PromoteCluster")) + .build(); + } + } + } + return getPromoteClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.RestoreClusterRequest, com.google.longrunning.Operation> + getRestoreClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RestoreCluster", + requestType = com.google.cloud.alloydb.v1alpha.RestoreClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.RestoreClusterRequest, com.google.longrunning.Operation> + getRestoreClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.RestoreClusterRequest, + com.google.longrunning.Operation> + getRestoreClusterMethod; + if ((getRestoreClusterMethod = AlloyDBAdminGrpc.getRestoreClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getRestoreClusterMethod = AlloyDBAdminGrpc.getRestoreClusterMethod) == null) { + AlloyDBAdminGrpc.getRestoreClusterMethod = + getRestoreClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RestoreCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.RestoreClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("RestoreCluster")) + .build(); + } + } + } + return getRestoreClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest, + com.google.longrunning.Operation> + getCreateSecondaryClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSecondaryCluster", + requestType = com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest, + com.google.longrunning.Operation> + getCreateSecondaryClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest, + com.google.longrunning.Operation> + getCreateSecondaryClusterMethod; + if ((getCreateSecondaryClusterMethod = AlloyDBAdminGrpc.getCreateSecondaryClusterMethod) + == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateSecondaryClusterMethod = AlloyDBAdminGrpc.getCreateSecondaryClusterMethod) + == null) { + AlloyDBAdminGrpc.getCreateSecondaryClusterMethod = + getCreateSecondaryClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateSecondaryCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("CreateSecondaryCluster")) + .build(); + } + } + } + return getCreateSecondaryClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.ListInstancesRequest, + com.google.cloud.alloydb.v1alpha.ListInstancesResponse> + getListInstancesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListInstances", + requestType = com.google.cloud.alloydb.v1alpha.ListInstancesRequest.class, + responseType = com.google.cloud.alloydb.v1alpha.ListInstancesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.ListInstancesRequest, + com.google.cloud.alloydb.v1alpha.ListInstancesResponse> + getListInstancesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.ListInstancesRequest, + com.google.cloud.alloydb.v1alpha.ListInstancesResponse> + getListInstancesMethod; + if ((getListInstancesMethod = AlloyDBAdminGrpc.getListInstancesMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getListInstancesMethod = AlloyDBAdminGrpc.getListInstancesMethod) == null) { + AlloyDBAdminGrpc.getListInstancesMethod = + getListInstancesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListInstances")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.ListInstancesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.ListInstancesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("ListInstances")) + .build(); + } + } + } + return getListInstancesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GetInstanceRequest, + com.google.cloud.alloydb.v1alpha.Instance> + getGetInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetInstance", + requestType = com.google.cloud.alloydb.v1alpha.GetInstanceRequest.class, + responseType = com.google.cloud.alloydb.v1alpha.Instance.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GetInstanceRequest, + com.google.cloud.alloydb.v1alpha.Instance> + getGetInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GetInstanceRequest, + com.google.cloud.alloydb.v1alpha.Instance> + getGetInstanceMethod; + if ((getGetInstanceMethod = AlloyDBAdminGrpc.getGetInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGetInstanceMethod = AlloyDBAdminGrpc.getGetInstanceMethod) == null) { + AlloyDBAdminGrpc.getGetInstanceMethod = + getGetInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.GetInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("GetInstance")) + .build(); + } + } + } + return getGetInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest, com.google.longrunning.Operation> + getCreateInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateInstance", + requestType = com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest, com.google.longrunning.Operation> + getCreateInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest, + com.google.longrunning.Operation> + getCreateInstanceMethod; + if ((getCreateInstanceMethod = AlloyDBAdminGrpc.getCreateInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateInstanceMethod = AlloyDBAdminGrpc.getCreateInstanceMethod) == null) { + AlloyDBAdminGrpc.getCreateInstanceMethod = + getCreateInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("CreateInstance")) + .build(); + } + } + } + return getCreateInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest, + com.google.longrunning.Operation> + getCreateSecondaryInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSecondaryInstance", + requestType = com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest, + com.google.longrunning.Operation> + getCreateSecondaryInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest, + com.google.longrunning.Operation> + getCreateSecondaryInstanceMethod; + if ((getCreateSecondaryInstanceMethod = AlloyDBAdminGrpc.getCreateSecondaryInstanceMethod) + == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateSecondaryInstanceMethod = AlloyDBAdminGrpc.getCreateSecondaryInstanceMethod) + == null) { + AlloyDBAdminGrpc.getCreateSecondaryInstanceMethod = + getCreateSecondaryInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateSecondaryInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("CreateSecondaryInstance")) + .build(); + } + } + } + return getCreateSecondaryInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest, + com.google.longrunning.Operation> + getBatchCreateInstancesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BatchCreateInstances", + requestType = com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest, + com.google.longrunning.Operation> + getBatchCreateInstancesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest, + com.google.longrunning.Operation> + getBatchCreateInstancesMethod; + if ((getBatchCreateInstancesMethod = AlloyDBAdminGrpc.getBatchCreateInstancesMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getBatchCreateInstancesMethod = AlloyDBAdminGrpc.getBatchCreateInstancesMethod) + == null) { + AlloyDBAdminGrpc.getBatchCreateInstancesMethod = + getBatchCreateInstancesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "BatchCreateInstances")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("BatchCreateInstances")) + .build(); + } + } + } + return getBatchCreateInstancesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest, com.google.longrunning.Operation> + getUpdateInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateInstance", + requestType = com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest, com.google.longrunning.Operation> + getUpdateInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest, + com.google.longrunning.Operation> + getUpdateInstanceMethod; + if ((getUpdateInstanceMethod = AlloyDBAdminGrpc.getUpdateInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getUpdateInstanceMethod = AlloyDBAdminGrpc.getUpdateInstanceMethod) == null) { + AlloyDBAdminGrpc.getUpdateInstanceMethod = + getUpdateInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("UpdateInstance")) + .build(); + } + } + } + return getUpdateInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest, com.google.longrunning.Operation> + getDeleteInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteInstance", + requestType = com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest, com.google.longrunning.Operation> + getDeleteInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest, + com.google.longrunning.Operation> + getDeleteInstanceMethod; + if ((getDeleteInstanceMethod = AlloyDBAdminGrpc.getDeleteInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getDeleteInstanceMethod = AlloyDBAdminGrpc.getDeleteInstanceMethod) == null) { + AlloyDBAdminGrpc.getDeleteInstanceMethod = + getDeleteInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("DeleteInstance")) + .build(); + } + } + } + return getDeleteInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest, + com.google.longrunning.Operation> + getFailoverInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FailoverInstance", + requestType = com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest, + com.google.longrunning.Operation> + getFailoverInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest, + com.google.longrunning.Operation> + getFailoverInstanceMethod; + if ((getFailoverInstanceMethod = AlloyDBAdminGrpc.getFailoverInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getFailoverInstanceMethod = AlloyDBAdminGrpc.getFailoverInstanceMethod) == null) { + AlloyDBAdminGrpc.getFailoverInstanceMethod = + getFailoverInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "FailoverInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("FailoverInstance")) + .build(); + } + } + } + return getFailoverInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.RestartInstanceRequest, com.google.longrunning.Operation> + getRestartInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RestartInstance", + requestType = com.google.cloud.alloydb.v1alpha.RestartInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.RestartInstanceRequest, com.google.longrunning.Operation> + getRestartInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.RestartInstanceRequest, + com.google.longrunning.Operation> + getRestartInstanceMethod; + if ((getRestartInstanceMethod = AlloyDBAdminGrpc.getRestartInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getRestartInstanceMethod = AlloyDBAdminGrpc.getRestartInstanceMethod) == null) { + AlloyDBAdminGrpc.getRestartInstanceMethod = + getRestartInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RestartInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.RestartInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("RestartInstance")) + .build(); + } + } + } + return getRestartInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.ListBackupsRequest, + com.google.cloud.alloydb.v1alpha.ListBackupsResponse> + getListBackupsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBackups", + requestType = com.google.cloud.alloydb.v1alpha.ListBackupsRequest.class, + responseType = com.google.cloud.alloydb.v1alpha.ListBackupsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.ListBackupsRequest, + com.google.cloud.alloydb.v1alpha.ListBackupsResponse> + getListBackupsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.ListBackupsRequest, + com.google.cloud.alloydb.v1alpha.ListBackupsResponse> + getListBackupsMethod; + if ((getListBackupsMethod = AlloyDBAdminGrpc.getListBackupsMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getListBackupsMethod = AlloyDBAdminGrpc.getListBackupsMethod) == null) { + AlloyDBAdminGrpc.getListBackupsMethod = + getListBackupsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBackups")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.ListBackupsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.ListBackupsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("ListBackups")) + .build(); + } + } + } + return getListBackupsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GetBackupRequest, + com.google.cloud.alloydb.v1alpha.Backup> + getGetBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBackup", + requestType = com.google.cloud.alloydb.v1alpha.GetBackupRequest.class, + responseType = com.google.cloud.alloydb.v1alpha.Backup.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GetBackupRequest, + com.google.cloud.alloydb.v1alpha.Backup> + getGetBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GetBackupRequest, + com.google.cloud.alloydb.v1alpha.Backup> + getGetBackupMethod; + if ((getGetBackupMethod = AlloyDBAdminGrpc.getGetBackupMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGetBackupMethod = AlloyDBAdminGrpc.getGetBackupMethod) == null) { + AlloyDBAdminGrpc.getGetBackupMethod = + getGetBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.GetBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.Backup.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("GetBackup")) + .build(); + } + } + } + return getGetBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBackup", + requestType = com.google.cloud.alloydb.v1alpha.CreateBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod; + if ((getCreateBackupMethod = AlloyDBAdminGrpc.getCreateBackupMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateBackupMethod = AlloyDBAdminGrpc.getCreateBackupMethod) == null) { + AlloyDBAdminGrpc.getCreateBackupMethod = + getCreateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.CreateBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("CreateBackup")) + .build(); + } + } + } + return getCreateBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.UpdateBackupRequest, com.google.longrunning.Operation> + getUpdateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBackup", + requestType = com.google.cloud.alloydb.v1alpha.UpdateBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.UpdateBackupRequest, com.google.longrunning.Operation> + getUpdateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.UpdateBackupRequest, com.google.longrunning.Operation> + getUpdateBackupMethod; + if ((getUpdateBackupMethod = AlloyDBAdminGrpc.getUpdateBackupMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getUpdateBackupMethod = AlloyDBAdminGrpc.getUpdateBackupMethod) == null) { + AlloyDBAdminGrpc.getUpdateBackupMethod = + getUpdateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.UpdateBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("UpdateBackup")) + .build(); + } + } + } + return getUpdateBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.DeleteBackupRequest, com.google.longrunning.Operation> + getDeleteBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBackup", + requestType = com.google.cloud.alloydb.v1alpha.DeleteBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.DeleteBackupRequest, com.google.longrunning.Operation> + getDeleteBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.DeleteBackupRequest, com.google.longrunning.Operation> + getDeleteBackupMethod; + if ((getDeleteBackupMethod = AlloyDBAdminGrpc.getDeleteBackupMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getDeleteBackupMethod = AlloyDBAdminGrpc.getDeleteBackupMethod) == null) { + AlloyDBAdminGrpc.getDeleteBackupMethod = + getDeleteBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.DeleteBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("DeleteBackup")) + .build(); + } + } + } + return getDeleteBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest, + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse> + getListSupportedDatabaseFlagsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSupportedDatabaseFlags", + requestType = com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.class, + responseType = com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest, + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse> + getListSupportedDatabaseFlagsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest, + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse> + getListSupportedDatabaseFlagsMethod; + if ((getListSupportedDatabaseFlagsMethod = AlloyDBAdminGrpc.getListSupportedDatabaseFlagsMethod) + == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getListSupportedDatabaseFlagsMethod = + AlloyDBAdminGrpc.getListSupportedDatabaseFlagsMethod) + == null) { + AlloyDBAdminGrpc.getListSupportedDatabaseFlagsMethod = + getListSupportedDatabaseFlagsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListSupportedDatabaseFlags")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("ListSupportedDatabaseFlags")) + .build(); + } + } + } + return getListSupportedDatabaseFlagsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest, + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse> + getGenerateClientCertificateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateClientCertificate", + requestType = com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.class, + responseType = com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest, + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse> + getGenerateClientCertificateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest, + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse> + getGenerateClientCertificateMethod; + if ((getGenerateClientCertificateMethod = AlloyDBAdminGrpc.getGenerateClientCertificateMethod) + == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGenerateClientCertificateMethod = + AlloyDBAdminGrpc.getGenerateClientCertificateMethod) + == null) { + AlloyDBAdminGrpc.getGenerateClientCertificateMethod = + getGenerateClientCertificateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GenerateClientCertificate")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("GenerateClientCertificate")) + .build(); + } + } + } + return getGenerateClientCertificateMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest, + com.google.cloud.alloydb.v1alpha.ConnectionInfo> + getGetConnectionInfoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetConnectionInfo", + requestType = com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.class, + responseType = com.google.cloud.alloydb.v1alpha.ConnectionInfo.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest, + com.google.cloud.alloydb.v1alpha.ConnectionInfo> + getGetConnectionInfoMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest, + com.google.cloud.alloydb.v1alpha.ConnectionInfo> + getGetConnectionInfoMethod; + if ((getGetConnectionInfoMethod = AlloyDBAdminGrpc.getGetConnectionInfoMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGetConnectionInfoMethod = AlloyDBAdminGrpc.getGetConnectionInfoMethod) == null) { + AlloyDBAdminGrpc.getGetConnectionInfoMethod = + getGetConnectionInfoMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetConnectionInfo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.ConnectionInfo.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("GetConnectionInfo")) + .build(); + } + } + } + return getGetConnectionInfoMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AlloyDBAdminStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AlloyDBAdminStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminStub(channel, callOptions); + } + }; + return AlloyDBAdminStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AlloyDBAdminBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AlloyDBAdminBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminBlockingStub(channel, callOptions); + } + }; + return AlloyDBAdminBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AlloyDBAdminFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AlloyDBAdminFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminFutureStub(channel, callOptions); + } + }; + return AlloyDBAdminFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public abstract static class AlloyDBAdminImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists Clusters in a given project and location.
+     * 
+ */ + public void listClusters( + com.google.cloud.alloydb.v1alpha.ListClustersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListClustersMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Cluster.
+     * 
+ */ + public void getCluster( + com.google.cloud.alloydb.v1alpha.GetClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location.
+     * 
+ */ + public void createCluster( + com.google.cloud.alloydb.v1alpha.CreateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Cluster.
+     * 
+ */ + public void updateCluster( + com.google.cloud.alloydb.v1alpha.UpdateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single Cluster.
+     * 
+ */ + public void deleteCluster( + com.google.cloud.alloydb.v1alpha.DeleteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Promotes a SECONDARY cluster. This turns down replication
+     * from the PRIMARY cluster and promotes a secondary cluster
+     * into its own standalone cluster.
+     * Imperative only.
+     * 
+ */ + public void promoteCluster( + com.google.cloud.alloydb.v1alpha.PromoteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPromoteClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location, with a volume
+     * restored from the provided source, either a backup ID or a point-in-time
+     * and a source cluster.
+     * 
+ */ + public void restoreCluster( + com.google.cloud.alloydb.v1alpha.RestoreClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRestoreClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a cluster of type SECONDARY in the given location using
+     * the primary cluster as the source.
+     * 
+ */ + public void createSecondaryCluster( + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSecondaryClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists Instances in a given project and location.
+     * 
+ */ + public void listInstances( + com.google.cloud.alloydb.v1alpha.ListInstancesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListInstancesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Instance.
+     * 
+ */ + public void getInstance( + com.google.cloud.alloydb.v1alpha.GetInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Instance in a given project and location.
+     * 
+ */ + public void createInstance( + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new SECONDARY Instance in a given project and location.
+     * 
+ */ + public void createSecondaryInstance( + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSecondaryInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates new instances under the given project, location and cluster.
+     * There can be only one primary instance in a cluster. If the primary
+     * instance exists in the cluster as well as this request, then API will
+     * throw an error.
+     * The primary instance should exist before any read pool instance is
+     * created. If the primary instance is a part of the request payload, then
+     * the API will take care of creating instances in the correct order.
+     * This method is here to support Google-internal use cases, and is not meant
+     * for external customers to consume. Please do not start relying on it; its
+     * behavior is subject to change without notice.
+     * 
+ */ + public void batchCreateInstances( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getBatchCreateInstancesMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Instance.
+     * 
+ */ + public void updateInstance( + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single Instance.
+     * 
+ */ + public void deleteInstance( + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Forces a Failover for a highly available instance.
+     * Failover promotes the HA standby instance as the new primary.
+     * Imperative only.
+     * 
+ */ + public void failoverInstance( + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFailoverInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Restart an Instance in a cluster.
+     * Imperative only.
+     * 
+ */ + public void restartInstance( + com.google.cloud.alloydb.v1alpha.RestartInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRestartInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists Backups in a given project and location.
+     * 
+ */ + public void listBackups( + com.google.cloud.alloydb.v1alpha.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListBackupsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Backup.
+     * 
+ */ + public void getBackup( + com.google.cloud.alloydb.v1alpha.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Backup in a given project and location.
+     * 
+ */ + public void createBackup( + com.google.cloud.alloydb.v1alpha.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Backup.
+     * 
+ */ + public void updateBackup( + com.google.cloud.alloydb.v1alpha.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single Backup.
+     * 
+ */ + public void deleteBackup( + com.google.cloud.alloydb.v1alpha.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists SupportedDatabaseFlags for a given project and location.
+     * 
+ */ + public void listSupportedDatabaseFlags( + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSupportedDatabaseFlagsMethod(), responseObserver); + } + + /** + * + * + *
+     * Generate a client certificate signed by a Cluster CA.
+     * The sole purpose of this endpoint is to support the Auth Proxy client and
+     * the endpoint's behavior is subject to change without notice, so do not rely
+     * on its behavior remaining constant. Future changes will not break the Auth
+     * Proxy client.
+     * 
+ */ + public void generateClientCertificate( + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGenerateClientCertificateMethod(), responseObserver); + } + + /** + * + * + *
+     * Get instance metadata used for a connection.
+     * 
+ */ + public void getConnectionInfo( + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetConnectionInfoMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListClustersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.ListClustersRequest, + com.google.cloud.alloydb.v1alpha.ListClustersResponse>( + this, METHODID_LIST_CLUSTERS))) + .addMethod( + getGetClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.GetClusterRequest, + com.google.cloud.alloydb.v1alpha.Cluster>(this, METHODID_GET_CLUSTER))) + .addMethod( + getCreateClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.CreateClusterRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_CLUSTER))) + .addMethod( + getUpdateClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.UpdateClusterRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_CLUSTER))) + .addMethod( + getDeleteClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.DeleteClusterRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_CLUSTER))) + .addMethod( + getPromoteClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.PromoteClusterRequest, + com.google.longrunning.Operation>(this, METHODID_PROMOTE_CLUSTER))) + .addMethod( + getRestoreClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.RestoreClusterRequest, + com.google.longrunning.Operation>(this, METHODID_RESTORE_CLUSTER))) + .addMethod( + getCreateSecondaryClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_SECONDARY_CLUSTER))) + .addMethod( + getListInstancesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.ListInstancesRequest, + com.google.cloud.alloydb.v1alpha.ListInstancesResponse>( + this, METHODID_LIST_INSTANCES))) + .addMethod( + getGetInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.GetInstanceRequest, + com.google.cloud.alloydb.v1alpha.Instance>(this, METHODID_GET_INSTANCE))) + .addMethod( + getCreateInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_INSTANCE))) + .addMethod( + getCreateSecondaryInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_SECONDARY_INSTANCE))) + .addMethod( + getBatchCreateInstancesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest, + com.google.longrunning.Operation>(this, METHODID_BATCH_CREATE_INSTANCES))) + .addMethod( + getUpdateInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_INSTANCE))) + .addMethod( + getDeleteInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_INSTANCE))) + .addMethod( + getFailoverInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_FAILOVER_INSTANCE))) + .addMethod( + getRestartInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.RestartInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_RESTART_INSTANCE))) + .addMethod( + getListBackupsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.ListBackupsRequest, + com.google.cloud.alloydb.v1alpha.ListBackupsResponse>( + this, METHODID_LIST_BACKUPS))) + .addMethod( + getGetBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.GetBackupRequest, + com.google.cloud.alloydb.v1alpha.Backup>(this, METHODID_GET_BACKUP))) + .addMethod( + getCreateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.CreateBackupRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_BACKUP))) + .addMethod( + getUpdateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.UpdateBackupRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_BACKUP))) + .addMethod( + getDeleteBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.DeleteBackupRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_BACKUP))) + .addMethod( + getListSupportedDatabaseFlagsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest, + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse>( + this, METHODID_LIST_SUPPORTED_DATABASE_FLAGS))) + .addMethod( + getGenerateClientCertificateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest, + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse>( + this, METHODID_GENERATE_CLIENT_CERTIFICATE))) + .addMethod( + getGetConnectionInfoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest, + com.google.cloud.alloydb.v1alpha.ConnectionInfo>( + this, METHODID_GET_CONNECTION_INFO))) + .build(); + } + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class AlloyDBAdminStub + extends io.grpc.stub.AbstractAsyncStub { + private AlloyDBAdminStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AlloyDBAdminStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Clusters in a given project and location.
+     * 
+ */ + public void listClusters( + com.google.cloud.alloydb.v1alpha.ListClustersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListClustersMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Cluster.
+     * 
+ */ + public void getCluster( + com.google.cloud.alloydb.v1alpha.GetClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetClusterMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location.
+     * 
+ */ + public void createCluster( + com.google.cloud.alloydb.v1alpha.CreateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Cluster.
+     * 
+ */ + public void updateCluster( + com.google.cloud.alloydb.v1alpha.UpdateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single Cluster.
+     * 
+ */ + public void deleteCluster( + com.google.cloud.alloydb.v1alpha.DeleteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Promotes a SECONDARY cluster. This turns down replication
+     * from the PRIMARY cluster and promotes a secondary cluster
+     * into its own standalone cluster.
+     * Imperative only.
+     * 
+ */ + public void promoteCluster( + com.google.cloud.alloydb.v1alpha.PromoteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPromoteClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location, with a volume
+     * restored from the provided source, either a backup ID or a point-in-time
+     * and a source cluster.
+     * 
+ */ + public void restoreCluster( + com.google.cloud.alloydb.v1alpha.RestoreClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRestoreClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a cluster of type SECONDARY in the given location using
+     * the primary cluster as the source.
+     * 
+ */ + public void createSecondaryCluster( + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSecondaryClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists Instances in a given project and location.
+     * 
+ */ + public void listInstances( + com.google.cloud.alloydb.v1alpha.ListInstancesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListInstancesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Instance.
+     * 
+ */ + public void getInstance( + com.google.cloud.alloydb.v1alpha.GetInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new Instance in a given project and location.
+     * 
+ */ + public void createInstance( + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new SECONDARY Instance in a given project and location.
+     * 
+ */ + public void createSecondaryInstance( + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSecondaryInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates new instances under the given project, location and cluster.
+     * There can be only one primary instance in a cluster. If the primary
+     * instance exists in the cluster as well as this request, then API will
+     * throw an error.
+     * The primary instance should exist before any read pool instance is
+     * created. If the primary instance is a part of the request payload, then
+     * the API will take care of creating instances in the correct order.
+     * This method is here to support Google-internal use cases, and is not meant
+     * for external customers to consume. Please do not start relying on it; its
+     * behavior is subject to change without notice.
+     * 
+ */ + public void batchCreateInstances( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBatchCreateInstancesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Instance.
+     * 
+ */ + public void updateInstance( + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single Instance.
+     * 
+ */ + public void deleteInstance( + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Forces a Failover for a highly available instance.
+     * Failover promotes the HA standby instance as the new primary.
+     * Imperative only.
+     * 
+ */ + public void failoverInstance( + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFailoverInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Restart an Instance in a cluster.
+     * Imperative only.
+     * 
+ */ + public void restartInstance( + com.google.cloud.alloydb.v1alpha.RestartInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRestartInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists Backups in a given project and location.
+     * 
+ */ + public void listBackups( + com.google.cloud.alloydb.v1alpha.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Backup.
+     * 
+ */ + public void getBackup( + com.google.cloud.alloydb.v1alpha.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new Backup in a given project and location.
+     * 
+ */ + public void createBackup( + com.google.cloud.alloydb.v1alpha.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Backup.
+     * 
+ */ + public void updateBackup( + com.google.cloud.alloydb.v1alpha.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single Backup.
+     * 
+ */ + public void deleteBackup( + com.google.cloud.alloydb.v1alpha.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists SupportedDatabaseFlags for a given project and location.
+     * 
+ */ + public void listSupportedDatabaseFlags( + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSupportedDatabaseFlagsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Generate a client certificate signed by a Cluster CA.
+     * The sole purpose of this endpoint is to support the Auth Proxy client and
+     * the endpoint's behavior is subject to change without notice, so do not rely
+     * on its behavior remaining constant. Future changes will not break the Auth
+     * Proxy client.
+     * 
+ */ + public void generateClientCertificate( + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGenerateClientCertificateMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get instance metadata used for a connection.
+     * 
+ */ + public void getConnectionInfo( + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetConnectionInfoMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class AlloyDBAdminBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private AlloyDBAdminBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AlloyDBAdminBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Clusters in a given project and location.
+     * 
+ */ + public com.google.cloud.alloydb.v1alpha.ListClustersResponse listClusters( + com.google.cloud.alloydb.v1alpha.ListClustersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListClustersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Cluster.
+     * 
+ */ + public com.google.cloud.alloydb.v1alpha.Cluster getCluster( + com.google.cloud.alloydb.v1alpha.GetClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createCluster( + com.google.cloud.alloydb.v1alpha.CreateClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Cluster.
+     * 
+ */ + public com.google.longrunning.Operation updateCluster( + com.google.cloud.alloydb.v1alpha.UpdateClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single Cluster.
+     * 
+ */ + public com.google.longrunning.Operation deleteCluster( + com.google.cloud.alloydb.v1alpha.DeleteClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Promotes a SECONDARY cluster. This turns down replication
+     * from the PRIMARY cluster and promotes a secondary cluster
+     * into its own standalone cluster.
+     * Imperative only.
+     * 
+ */ + public com.google.longrunning.Operation promoteCluster( + com.google.cloud.alloydb.v1alpha.PromoteClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPromoteClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location, with a volume
+     * restored from the provided source, either a backup ID or a point-in-time
+     * and a source cluster.
+     * 
+ */ + public com.google.longrunning.Operation restoreCluster( + com.google.cloud.alloydb.v1alpha.RestoreClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRestoreClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a cluster of type SECONDARY in the given location using
+     * the primary cluster as the source.
+     * 
+ */ + public com.google.longrunning.Operation createSecondaryCluster( + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSecondaryClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists Instances in a given project and location.
+     * 
+ */ + public com.google.cloud.alloydb.v1alpha.ListInstancesResponse listInstances( + com.google.cloud.alloydb.v1alpha.ListInstancesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListInstancesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Instance.
+     * 
+ */ + public com.google.cloud.alloydb.v1alpha.Instance getInstance( + com.google.cloud.alloydb.v1alpha.GetInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Instance in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createInstance( + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new SECONDARY Instance in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createSecondaryInstance( + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSecondaryInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates new instances under the given project, location and cluster.
+     * There can be only one primary instance in a cluster. If the primary
+     * instance exists in the cluster as well as this request, then API will
+     * throw an error.
+     * The primary instance should exist before any read pool instance is
+     * created. If the primary instance is a part of the request payload, then
+     * the API will take care of creating instances in the correct order.
+     * This method is here to support Google-internal use cases, and is not meant
+     * for external customers to consume. Please do not start relying on it; its
+     * behavior is subject to change without notice.
+     * 
+ */ + public com.google.longrunning.Operation batchCreateInstances( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBatchCreateInstancesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Instance.
+     * 
+ */ + public com.google.longrunning.Operation updateInstance( + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single Instance.
+     * 
+ */ + public com.google.longrunning.Operation deleteInstance( + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Forces a Failover for a highly available instance.
+     * Failover promotes the HA standby instance as the new primary.
+     * Imperative only.
+     * 
+ */ + public com.google.longrunning.Operation failoverInstance( + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFailoverInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Restart an Instance in a cluster.
+     * Imperative only.
+     * 
+ */ + public com.google.longrunning.Operation restartInstance( + com.google.cloud.alloydb.v1alpha.RestartInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRestartInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists Backups in a given project and location.
+     * 
+ */ + public com.google.cloud.alloydb.v1alpha.ListBackupsResponse listBackups( + com.google.cloud.alloydb.v1alpha.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBackupsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Backup.
+     * 
+ */ + public com.google.cloud.alloydb.v1alpha.Backup getBackup( + com.google.cloud.alloydb.v1alpha.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Backup in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createBackup( + com.google.cloud.alloydb.v1alpha.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Backup.
+     * 
+ */ + public com.google.longrunning.Operation updateBackup( + com.google.cloud.alloydb.v1alpha.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single Backup.
+     * 
+ */ + public com.google.longrunning.Operation deleteBackup( + com.google.cloud.alloydb.v1alpha.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists SupportedDatabaseFlags for a given project and location.
+     * 
+ */ + public com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + listSupportedDatabaseFlags( + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSupportedDatabaseFlagsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Generate a client certificate signed by a Cluster CA.
+     * The sole purpose of this endpoint is to support the Auth Proxy client and
+     * the endpoint's behavior is subject to change without notice, so do not rely
+     * on its behavior remaining constant. Future changes will not break the Auth
+     * Proxy client.
+     * 
+ */ + public com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + generateClientCertificate( + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGenerateClientCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get instance metadata used for a connection.
+     * 
+ */ + public com.google.cloud.alloydb.v1alpha.ConnectionInfo getConnectionInfo( + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetConnectionInfoMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class AlloyDBAdminFutureStub + extends io.grpc.stub.AbstractFutureStub { + private AlloyDBAdminFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AlloyDBAdminFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Clusters in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1alpha.ListClustersResponse> + listClusters(com.google.cloud.alloydb.v1alpha.ListClustersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListClustersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1alpha.Cluster> + getCluster(com.google.cloud.alloydb.v1alpha.GetClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createCluster(com.google.cloud.alloydb.v1alpha.CreateClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateCluster(com.google.cloud.alloydb.v1alpha.UpdateClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single Cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteCluster(com.google.cloud.alloydb.v1alpha.DeleteClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Promotes a SECONDARY cluster. This turns down replication
+     * from the PRIMARY cluster and promotes a secondary cluster
+     * into its own standalone cluster.
+     * Imperative only.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + promoteCluster(com.google.cloud.alloydb.v1alpha.PromoteClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPromoteClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location, with a volume
+     * restored from the provided source, either a backup ID or a point-in-time
+     * and a source cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + restoreCluster(com.google.cloud.alloydb.v1alpha.RestoreClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRestoreClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a cluster of type SECONDARY in the given location using
+     * the primary cluster as the source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSecondaryCluster( + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSecondaryClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists Instances in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1alpha.ListInstancesResponse> + listInstances(com.google.cloud.alloydb.v1alpha.ListInstancesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListInstancesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1alpha.Instance> + getInstance(com.google.cloud.alloydb.v1alpha.GetInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Instance in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createInstance(com.google.cloud.alloydb.v1alpha.CreateInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new SECONDARY Instance in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSecondaryInstance( + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSecondaryInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates new instances under the given project, location and cluster.
+     * There can be only one primary instance in a cluster. If the primary
+     * instance exists in the cluster as well as this request, then API will
+     * throw an error.
+     * The primary instance should exist before any read pool instance is
+     * created. If the primary instance is a part of the request payload, then
+     * the API will take care of creating instances in the correct order.
+     * This method is here to support Google-internal use cases, and is not meant
+     * for external customers to consume. Please do not start relying on it; its
+     * behavior is subject to change without notice.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + batchCreateInstances(com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBatchCreateInstancesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateInstance(com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single Instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteInstance(com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Forces a Failover for a highly available instance.
+     * Failover promotes the HA standby instance as the new primary.
+     * Imperative only.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + failoverInstance(com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFailoverInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Restart an Instance in a cluster.
+     * Imperative only.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + restartInstance(com.google.cloud.alloydb.v1alpha.RestartInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRestartInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists Backups in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1alpha.ListBackupsResponse> + listBackups(com.google.cloud.alloydb.v1alpha.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1alpha.Backup> + getBackup(com.google.cloud.alloydb.v1alpha.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Backup in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createBackup(com.google.cloud.alloydb.v1alpha.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateBackup(com.google.cloud.alloydb.v1alpha.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single Backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteBackup(com.google.cloud.alloydb.v1alpha.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists SupportedDatabaseFlags for a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse> + listSupportedDatabaseFlags( + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSupportedDatabaseFlagsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Generate a client certificate signed by a Cluster CA.
+     * The sole purpose of this endpoint is to support the Auth Proxy client and
+     * the endpoint's behavior is subject to change without notice, so do not rely
+     * on its behavior remaining constant. Future changes will not break the Auth
+     * Proxy client.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse> + generateClientCertificate( + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGenerateClientCertificateMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get instance metadata used for a connection.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1alpha.ConnectionInfo> + getConnectionInfo(com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetConnectionInfoMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_CLUSTERS = 0; + private static final int METHODID_GET_CLUSTER = 1; + private static final int METHODID_CREATE_CLUSTER = 2; + private static final int METHODID_UPDATE_CLUSTER = 3; + private static final int METHODID_DELETE_CLUSTER = 4; + private static final int METHODID_PROMOTE_CLUSTER = 5; + private static final int METHODID_RESTORE_CLUSTER = 6; + private static final int METHODID_CREATE_SECONDARY_CLUSTER = 7; + private static final int METHODID_LIST_INSTANCES = 8; + private static final int METHODID_GET_INSTANCE = 9; + private static final int METHODID_CREATE_INSTANCE = 10; + private static final int METHODID_CREATE_SECONDARY_INSTANCE = 11; + private static final int METHODID_BATCH_CREATE_INSTANCES = 12; + private static final int METHODID_UPDATE_INSTANCE = 13; + private static final int METHODID_DELETE_INSTANCE = 14; + private static final int METHODID_FAILOVER_INSTANCE = 15; + private static final int METHODID_RESTART_INSTANCE = 16; + private static final int METHODID_LIST_BACKUPS = 17; + private static final int METHODID_GET_BACKUP = 18; + private static final int METHODID_CREATE_BACKUP = 19; + private static final int METHODID_UPDATE_BACKUP = 20; + private static final int METHODID_DELETE_BACKUP = 21; + private static final int METHODID_LIST_SUPPORTED_DATABASE_FLAGS = 22; + private static final int METHODID_GENERATE_CLIENT_CERTIFICATE = 23; + private static final int METHODID_GET_CONNECTION_INFO = 24; + + 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 AlloyDBAdminImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AlloyDBAdminImplBase 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_CLUSTERS: + serviceImpl.listClusters( + (com.google.cloud.alloydb.v1alpha.ListClustersRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_CLUSTER: + serviceImpl.getCluster( + (com.google.cloud.alloydb.v1alpha.GetClusterRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_CLUSTER: + serviceImpl.createCluster( + (com.google.cloud.alloydb.v1alpha.CreateClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_CLUSTER: + serviceImpl.updateCluster( + (com.google.cloud.alloydb.v1alpha.UpdateClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_CLUSTER: + serviceImpl.deleteCluster( + (com.google.cloud.alloydb.v1alpha.DeleteClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PROMOTE_CLUSTER: + serviceImpl.promoteCluster( + (com.google.cloud.alloydb.v1alpha.PromoteClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESTORE_CLUSTER: + serviceImpl.restoreCluster( + (com.google.cloud.alloydb.v1alpha.RestoreClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_SECONDARY_CLUSTER: + serviceImpl.createSecondaryCluster( + (com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_INSTANCES: + serviceImpl.listInstances( + (com.google.cloud.alloydb.v1alpha.ListInstancesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_INSTANCE: + serviceImpl.getInstance( + (com.google.cloud.alloydb.v1alpha.GetInstanceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_INSTANCE: + serviceImpl.createInstance( + (com.google.cloud.alloydb.v1alpha.CreateInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_SECONDARY_INSTANCE: + serviceImpl.createSecondaryInstance( + (com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_BATCH_CREATE_INSTANCES: + serviceImpl.batchCreateInstances( + (com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_INSTANCE: + serviceImpl.updateInstance( + (com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_INSTANCE: + serviceImpl.deleteInstance( + (com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_FAILOVER_INSTANCE: + serviceImpl.failoverInstance( + (com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESTART_INSTANCE: + serviceImpl.restartInstance( + (com.google.cloud.alloydb.v1alpha.RestartInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_BACKUPS: + serviceImpl.listBackups( + (com.google.cloud.alloydb.v1alpha.ListBackupsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_BACKUP: + serviceImpl.getBackup( + (com.google.cloud.alloydb.v1alpha.GetBackupRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_BACKUP: + serviceImpl.createBackup( + (com.google.cloud.alloydb.v1alpha.CreateBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_BACKUP: + serviceImpl.updateBackup( + (com.google.cloud.alloydb.v1alpha.UpdateBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_BACKUP: + serviceImpl.deleteBackup( + (com.google.cloud.alloydb.v1alpha.DeleteBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SUPPORTED_DATABASE_FLAGS: + serviceImpl.listSupportedDatabaseFlags( + (com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse>) + responseObserver); + break; + case METHODID_GENERATE_CLIENT_CERTIFICATE: + serviceImpl.generateClientCertificate( + (com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse>) + responseObserver); + break; + case METHODID_GET_CONNECTION_INFO: + serviceImpl.getConnectionInfo( + (com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest) 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 AlloyDBAdminBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AlloyDBAdminBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AlloyDBAdmin"); + } + } + + private static final class AlloyDBAdminFileDescriptorSupplier + extends AlloyDBAdminBaseDescriptorSupplier { + AlloyDBAdminFileDescriptorSupplier() {} + } + + private static final class AlloyDBAdminMethodDescriptorSupplier + extends AlloyDBAdminBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AlloyDBAdminMethodDescriptorSupplier(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 (AlloyDBAdminGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AlloyDBAdminFileDescriptorSupplier()) + .addMethod(getListClustersMethod()) + .addMethod(getGetClusterMethod()) + .addMethod(getCreateClusterMethod()) + .addMethod(getUpdateClusterMethod()) + .addMethod(getDeleteClusterMethod()) + .addMethod(getPromoteClusterMethod()) + .addMethod(getRestoreClusterMethod()) + .addMethod(getCreateSecondaryClusterMethod()) + .addMethod(getListInstancesMethod()) + .addMethod(getGetInstanceMethod()) + .addMethod(getCreateInstanceMethod()) + .addMethod(getCreateSecondaryInstanceMethod()) + .addMethod(getBatchCreateInstancesMethod()) + .addMethod(getUpdateInstanceMethod()) + .addMethod(getDeleteInstanceMethod()) + .addMethod(getFailoverInstanceMethod()) + .addMethod(getRestartInstanceMethod()) + .addMethod(getListBackupsMethod()) + .addMethod(getGetBackupMethod()) + .addMethod(getCreateBackupMethod()) + .addMethod(getUpdateBackupMethod()) + .addMethod(getDeleteBackupMethod()) + .addMethod(getListSupportedDatabaseFlagsMethod()) + .addMethod(getGenerateClientCertificateMethod()) + .addMethod(getGetConnectionInfoMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-alloydb/grpc-google-cloud-alloydb-v1beta/pom.xml b/java-alloydb/grpc-google-cloud-alloydb-v1beta/pom.xml new file mode 100644 index 000000000000..d6aae297b5a3 --- /dev/null +++ b/java-alloydb/grpc-google-cloud-alloydb-v1beta/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-alloydb-v1beta + 0.0.1-SNAPSHOT + grpc-google-cloud-alloydb-v1beta + GRPC library for google-cloud-alloydb + + com.google.cloud + google-cloud-alloydb-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-alloydb-v1beta + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-alloydb/grpc-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminGrpc.java b/java-alloydb/grpc-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminGrpc.java new file mode 100644 index 000000000000..0de88b885c8a --- /dev/null +++ b/java-alloydb/grpc-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminGrpc.java @@ -0,0 +1,3221 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.alloydb.v1beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service describing handlers for resources
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/alloydb/v1beta/service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class AlloyDBAdminGrpc { + + private AlloyDBAdminGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.alloydb.v1beta.AlloyDBAdmin"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.ListClustersRequest, + com.google.cloud.alloydb.v1beta.ListClustersResponse> + getListClustersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListClusters", + requestType = com.google.cloud.alloydb.v1beta.ListClustersRequest.class, + responseType = com.google.cloud.alloydb.v1beta.ListClustersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.ListClustersRequest, + com.google.cloud.alloydb.v1beta.ListClustersResponse> + getListClustersMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.ListClustersRequest, + com.google.cloud.alloydb.v1beta.ListClustersResponse> + getListClustersMethod; + if ((getListClustersMethod = AlloyDBAdminGrpc.getListClustersMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getListClustersMethod = AlloyDBAdminGrpc.getListClustersMethod) == null) { + AlloyDBAdminGrpc.getListClustersMethod = + getListClustersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListClusters")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.ListClustersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.ListClustersResponse + .getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("ListClusters")) + .build(); + } + } + } + return getListClustersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GetClusterRequest, + com.google.cloud.alloydb.v1beta.Cluster> + getGetClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCluster", + requestType = com.google.cloud.alloydb.v1beta.GetClusterRequest.class, + responseType = com.google.cloud.alloydb.v1beta.Cluster.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GetClusterRequest, + com.google.cloud.alloydb.v1beta.Cluster> + getGetClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GetClusterRequest, + com.google.cloud.alloydb.v1beta.Cluster> + getGetClusterMethod; + if ((getGetClusterMethod = AlloyDBAdminGrpc.getGetClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGetClusterMethod = AlloyDBAdminGrpc.getGetClusterMethod) == null) { + AlloyDBAdminGrpc.getGetClusterMethod = + getGetClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.GetClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("GetCluster")) + .build(); + } + } + } + return getGetClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateClusterRequest, com.google.longrunning.Operation> + getCreateClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateCluster", + requestType = com.google.cloud.alloydb.v1beta.CreateClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateClusterRequest, com.google.longrunning.Operation> + getCreateClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateClusterRequest, com.google.longrunning.Operation> + getCreateClusterMethod; + if ((getCreateClusterMethod = AlloyDBAdminGrpc.getCreateClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateClusterMethod = AlloyDBAdminGrpc.getCreateClusterMethod) == null) { + AlloyDBAdminGrpc.getCreateClusterMethod = + getCreateClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.CreateClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("CreateCluster")) + .build(); + } + } + } + return getCreateClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.UpdateClusterRequest, com.google.longrunning.Operation> + getUpdateClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCluster", + requestType = com.google.cloud.alloydb.v1beta.UpdateClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.UpdateClusterRequest, com.google.longrunning.Operation> + getUpdateClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.UpdateClusterRequest, com.google.longrunning.Operation> + getUpdateClusterMethod; + if ((getUpdateClusterMethod = AlloyDBAdminGrpc.getUpdateClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getUpdateClusterMethod = AlloyDBAdminGrpc.getUpdateClusterMethod) == null) { + AlloyDBAdminGrpc.getUpdateClusterMethod = + getUpdateClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.UpdateClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("UpdateCluster")) + .build(); + } + } + } + return getUpdateClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.DeleteClusterRequest, com.google.longrunning.Operation> + getDeleteClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteCluster", + requestType = com.google.cloud.alloydb.v1beta.DeleteClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.DeleteClusterRequest, com.google.longrunning.Operation> + getDeleteClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.DeleteClusterRequest, com.google.longrunning.Operation> + getDeleteClusterMethod; + if ((getDeleteClusterMethod = AlloyDBAdminGrpc.getDeleteClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getDeleteClusterMethod = AlloyDBAdminGrpc.getDeleteClusterMethod) == null) { + AlloyDBAdminGrpc.getDeleteClusterMethod = + getDeleteClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.DeleteClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("DeleteCluster")) + .build(); + } + } + } + return getDeleteClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.PromoteClusterRequest, com.google.longrunning.Operation> + getPromoteClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PromoteCluster", + requestType = com.google.cloud.alloydb.v1beta.PromoteClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.PromoteClusterRequest, com.google.longrunning.Operation> + getPromoteClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.PromoteClusterRequest, com.google.longrunning.Operation> + getPromoteClusterMethod; + if ((getPromoteClusterMethod = AlloyDBAdminGrpc.getPromoteClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getPromoteClusterMethod = AlloyDBAdminGrpc.getPromoteClusterMethod) == null) { + AlloyDBAdminGrpc.getPromoteClusterMethod = + getPromoteClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PromoteCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.PromoteClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("PromoteCluster")) + .build(); + } + } + } + return getPromoteClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.RestoreClusterRequest, com.google.longrunning.Operation> + getRestoreClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RestoreCluster", + requestType = com.google.cloud.alloydb.v1beta.RestoreClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.RestoreClusterRequest, com.google.longrunning.Operation> + getRestoreClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.RestoreClusterRequest, com.google.longrunning.Operation> + getRestoreClusterMethod; + if ((getRestoreClusterMethod = AlloyDBAdminGrpc.getRestoreClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getRestoreClusterMethod = AlloyDBAdminGrpc.getRestoreClusterMethod) == null) { + AlloyDBAdminGrpc.getRestoreClusterMethod = + getRestoreClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RestoreCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.RestoreClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("RestoreCluster")) + .build(); + } + } + } + return getRestoreClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest, + com.google.longrunning.Operation> + getCreateSecondaryClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSecondaryCluster", + requestType = com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest, + com.google.longrunning.Operation> + getCreateSecondaryClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest, + com.google.longrunning.Operation> + getCreateSecondaryClusterMethod; + if ((getCreateSecondaryClusterMethod = AlloyDBAdminGrpc.getCreateSecondaryClusterMethod) + == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateSecondaryClusterMethod = AlloyDBAdminGrpc.getCreateSecondaryClusterMethod) + == null) { + AlloyDBAdminGrpc.getCreateSecondaryClusterMethod = + getCreateSecondaryClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateSecondaryCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("CreateSecondaryCluster")) + .build(); + } + } + } + return getCreateSecondaryClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.ListInstancesRequest, + com.google.cloud.alloydb.v1beta.ListInstancesResponse> + getListInstancesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListInstances", + requestType = com.google.cloud.alloydb.v1beta.ListInstancesRequest.class, + responseType = com.google.cloud.alloydb.v1beta.ListInstancesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.ListInstancesRequest, + com.google.cloud.alloydb.v1beta.ListInstancesResponse> + getListInstancesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.ListInstancesRequest, + com.google.cloud.alloydb.v1beta.ListInstancesResponse> + getListInstancesMethod; + if ((getListInstancesMethod = AlloyDBAdminGrpc.getListInstancesMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getListInstancesMethod = AlloyDBAdminGrpc.getListInstancesMethod) == null) { + AlloyDBAdminGrpc.getListInstancesMethod = + getListInstancesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListInstances")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.ListInstancesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.ListInstancesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("ListInstances")) + .build(); + } + } + } + return getListInstancesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GetInstanceRequest, + com.google.cloud.alloydb.v1beta.Instance> + getGetInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetInstance", + requestType = com.google.cloud.alloydb.v1beta.GetInstanceRequest.class, + responseType = com.google.cloud.alloydb.v1beta.Instance.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GetInstanceRequest, + com.google.cloud.alloydb.v1beta.Instance> + getGetInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GetInstanceRequest, + com.google.cloud.alloydb.v1beta.Instance> + getGetInstanceMethod; + if ((getGetInstanceMethod = AlloyDBAdminGrpc.getGetInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGetInstanceMethod = AlloyDBAdminGrpc.getGetInstanceMethod) == null) { + AlloyDBAdminGrpc.getGetInstanceMethod = + getGetInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.GetInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("GetInstance")) + .build(); + } + } + } + return getGetInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateInstanceRequest, com.google.longrunning.Operation> + getCreateInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateInstance", + requestType = com.google.cloud.alloydb.v1beta.CreateInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateInstanceRequest, com.google.longrunning.Operation> + getCreateInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateInstanceRequest, com.google.longrunning.Operation> + getCreateInstanceMethod; + if ((getCreateInstanceMethod = AlloyDBAdminGrpc.getCreateInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateInstanceMethod = AlloyDBAdminGrpc.getCreateInstanceMethod) == null) { + AlloyDBAdminGrpc.getCreateInstanceMethod = + getCreateInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.CreateInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("CreateInstance")) + .build(); + } + } + } + return getCreateInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest, + com.google.longrunning.Operation> + getCreateSecondaryInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSecondaryInstance", + requestType = com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest, + com.google.longrunning.Operation> + getCreateSecondaryInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest, + com.google.longrunning.Operation> + getCreateSecondaryInstanceMethod; + if ((getCreateSecondaryInstanceMethod = AlloyDBAdminGrpc.getCreateSecondaryInstanceMethod) + == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateSecondaryInstanceMethod = AlloyDBAdminGrpc.getCreateSecondaryInstanceMethod) + == null) { + AlloyDBAdminGrpc.getCreateSecondaryInstanceMethod = + getCreateSecondaryInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateSecondaryInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("CreateSecondaryInstance")) + .build(); + } + } + } + return getCreateSecondaryInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest, + com.google.longrunning.Operation> + getBatchCreateInstancesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BatchCreateInstances", + requestType = com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest, + com.google.longrunning.Operation> + getBatchCreateInstancesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest, + com.google.longrunning.Operation> + getBatchCreateInstancesMethod; + if ((getBatchCreateInstancesMethod = AlloyDBAdminGrpc.getBatchCreateInstancesMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getBatchCreateInstancesMethod = AlloyDBAdminGrpc.getBatchCreateInstancesMethod) + == null) { + AlloyDBAdminGrpc.getBatchCreateInstancesMethod = + getBatchCreateInstancesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "BatchCreateInstances")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("BatchCreateInstances")) + .build(); + } + } + } + return getBatchCreateInstancesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.UpdateInstanceRequest, com.google.longrunning.Operation> + getUpdateInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateInstance", + requestType = com.google.cloud.alloydb.v1beta.UpdateInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.UpdateInstanceRequest, com.google.longrunning.Operation> + getUpdateInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.UpdateInstanceRequest, com.google.longrunning.Operation> + getUpdateInstanceMethod; + if ((getUpdateInstanceMethod = AlloyDBAdminGrpc.getUpdateInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getUpdateInstanceMethod = AlloyDBAdminGrpc.getUpdateInstanceMethod) == null) { + AlloyDBAdminGrpc.getUpdateInstanceMethod = + getUpdateInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.UpdateInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("UpdateInstance")) + .build(); + } + } + } + return getUpdateInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.DeleteInstanceRequest, com.google.longrunning.Operation> + getDeleteInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteInstance", + requestType = com.google.cloud.alloydb.v1beta.DeleteInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.DeleteInstanceRequest, com.google.longrunning.Operation> + getDeleteInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.DeleteInstanceRequest, com.google.longrunning.Operation> + getDeleteInstanceMethod; + if ((getDeleteInstanceMethod = AlloyDBAdminGrpc.getDeleteInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getDeleteInstanceMethod = AlloyDBAdminGrpc.getDeleteInstanceMethod) == null) { + AlloyDBAdminGrpc.getDeleteInstanceMethod = + getDeleteInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.DeleteInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("DeleteInstance")) + .build(); + } + } + } + return getDeleteInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.FailoverInstanceRequest, com.google.longrunning.Operation> + getFailoverInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FailoverInstance", + requestType = com.google.cloud.alloydb.v1beta.FailoverInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.FailoverInstanceRequest, com.google.longrunning.Operation> + getFailoverInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.FailoverInstanceRequest, + com.google.longrunning.Operation> + getFailoverInstanceMethod; + if ((getFailoverInstanceMethod = AlloyDBAdminGrpc.getFailoverInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getFailoverInstanceMethod = AlloyDBAdminGrpc.getFailoverInstanceMethod) == null) { + AlloyDBAdminGrpc.getFailoverInstanceMethod = + getFailoverInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "FailoverInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.FailoverInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("FailoverInstance")) + .build(); + } + } + } + return getFailoverInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.RestartInstanceRequest, com.google.longrunning.Operation> + getRestartInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RestartInstance", + requestType = com.google.cloud.alloydb.v1beta.RestartInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.RestartInstanceRequest, com.google.longrunning.Operation> + getRestartInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.RestartInstanceRequest, + com.google.longrunning.Operation> + getRestartInstanceMethod; + if ((getRestartInstanceMethod = AlloyDBAdminGrpc.getRestartInstanceMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getRestartInstanceMethod = AlloyDBAdminGrpc.getRestartInstanceMethod) == null) { + AlloyDBAdminGrpc.getRestartInstanceMethod = + getRestartInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RestartInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.RestartInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("RestartInstance")) + .build(); + } + } + } + return getRestartInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.ListBackupsRequest, + com.google.cloud.alloydb.v1beta.ListBackupsResponse> + getListBackupsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBackups", + requestType = com.google.cloud.alloydb.v1beta.ListBackupsRequest.class, + responseType = com.google.cloud.alloydb.v1beta.ListBackupsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.ListBackupsRequest, + com.google.cloud.alloydb.v1beta.ListBackupsResponse> + getListBackupsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.ListBackupsRequest, + com.google.cloud.alloydb.v1beta.ListBackupsResponse> + getListBackupsMethod; + if ((getListBackupsMethod = AlloyDBAdminGrpc.getListBackupsMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getListBackupsMethod = AlloyDBAdminGrpc.getListBackupsMethod) == null) { + AlloyDBAdminGrpc.getListBackupsMethod = + getListBackupsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBackups")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.ListBackupsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.ListBackupsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("ListBackups")) + .build(); + } + } + } + return getListBackupsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GetBackupRequest, com.google.cloud.alloydb.v1beta.Backup> + getGetBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBackup", + requestType = com.google.cloud.alloydb.v1beta.GetBackupRequest.class, + responseType = com.google.cloud.alloydb.v1beta.Backup.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GetBackupRequest, com.google.cloud.alloydb.v1beta.Backup> + getGetBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GetBackupRequest, + com.google.cloud.alloydb.v1beta.Backup> + getGetBackupMethod; + if ((getGetBackupMethod = AlloyDBAdminGrpc.getGetBackupMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGetBackupMethod = AlloyDBAdminGrpc.getGetBackupMethod) == null) { + AlloyDBAdminGrpc.getGetBackupMethod = + getGetBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.GetBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.Backup.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("GetBackup")) + .build(); + } + } + } + return getGetBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBackup", + requestType = com.google.cloud.alloydb.v1beta.CreateBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod; + if ((getCreateBackupMethod = AlloyDBAdminGrpc.getCreateBackupMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateBackupMethod = AlloyDBAdminGrpc.getCreateBackupMethod) == null) { + AlloyDBAdminGrpc.getCreateBackupMethod = + getCreateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.CreateBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("CreateBackup")) + .build(); + } + } + } + return getCreateBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.UpdateBackupRequest, com.google.longrunning.Operation> + getUpdateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBackup", + requestType = com.google.cloud.alloydb.v1beta.UpdateBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.UpdateBackupRequest, com.google.longrunning.Operation> + getUpdateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.UpdateBackupRequest, com.google.longrunning.Operation> + getUpdateBackupMethod; + if ((getUpdateBackupMethod = AlloyDBAdminGrpc.getUpdateBackupMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getUpdateBackupMethod = AlloyDBAdminGrpc.getUpdateBackupMethod) == null) { + AlloyDBAdminGrpc.getUpdateBackupMethod = + getUpdateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.UpdateBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("UpdateBackup")) + .build(); + } + } + } + return getUpdateBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.DeleteBackupRequest, com.google.longrunning.Operation> + getDeleteBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBackup", + requestType = com.google.cloud.alloydb.v1beta.DeleteBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.DeleteBackupRequest, com.google.longrunning.Operation> + getDeleteBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.DeleteBackupRequest, com.google.longrunning.Operation> + getDeleteBackupMethod; + if ((getDeleteBackupMethod = AlloyDBAdminGrpc.getDeleteBackupMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getDeleteBackupMethod = AlloyDBAdminGrpc.getDeleteBackupMethod) == null) { + AlloyDBAdminGrpc.getDeleteBackupMethod = + getDeleteBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.DeleteBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("DeleteBackup")) + .build(); + } + } + } + return getDeleteBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest, + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse> + getListSupportedDatabaseFlagsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSupportedDatabaseFlags", + requestType = com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.class, + responseType = com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest, + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse> + getListSupportedDatabaseFlagsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest, + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse> + getListSupportedDatabaseFlagsMethod; + if ((getListSupportedDatabaseFlagsMethod = AlloyDBAdminGrpc.getListSupportedDatabaseFlagsMethod) + == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getListSupportedDatabaseFlagsMethod = + AlloyDBAdminGrpc.getListSupportedDatabaseFlagsMethod) + == null) { + AlloyDBAdminGrpc.getListSupportedDatabaseFlagsMethod = + getListSupportedDatabaseFlagsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListSupportedDatabaseFlags")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("ListSupportedDatabaseFlags")) + .build(); + } + } + } + return getListSupportedDatabaseFlagsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest, + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse> + getGenerateClientCertificateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateClientCertificate", + requestType = com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.class, + responseType = com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest, + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse> + getGenerateClientCertificateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest, + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse> + getGenerateClientCertificateMethod; + if ((getGenerateClientCertificateMethod = AlloyDBAdminGrpc.getGenerateClientCertificateMethod) + == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGenerateClientCertificateMethod = + AlloyDBAdminGrpc.getGenerateClientCertificateMethod) + == null) { + AlloyDBAdminGrpc.getGenerateClientCertificateMethod = + getGenerateClientCertificateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GenerateClientCertificate")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("GenerateClientCertificate")) + .build(); + } + } + } + return getGenerateClientCertificateMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest, + com.google.cloud.alloydb.v1beta.ConnectionInfo> + getGetConnectionInfoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetConnectionInfo", + requestType = com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest.class, + responseType = com.google.cloud.alloydb.v1beta.ConnectionInfo.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest, + com.google.cloud.alloydb.v1beta.ConnectionInfo> + getGetConnectionInfoMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest, + com.google.cloud.alloydb.v1beta.ConnectionInfo> + getGetConnectionInfoMethod; + if ((getGetConnectionInfoMethod = AlloyDBAdminGrpc.getGetConnectionInfoMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGetConnectionInfoMethod = AlloyDBAdminGrpc.getGetConnectionInfoMethod) == null) { + AlloyDBAdminGrpc.getGetConnectionInfoMethod = + getGetConnectionInfoMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetConnectionInfo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.ConnectionInfo.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("GetConnectionInfo")) + .build(); + } + } + } + return getGetConnectionInfoMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AlloyDBAdminStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AlloyDBAdminStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminStub(channel, callOptions); + } + }; + return AlloyDBAdminStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AlloyDBAdminBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AlloyDBAdminBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminBlockingStub(channel, callOptions); + } + }; + return AlloyDBAdminBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AlloyDBAdminFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AlloyDBAdminFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminFutureStub(channel, callOptions); + } + }; + return AlloyDBAdminFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public abstract static class AlloyDBAdminImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists Clusters in a given project and location.
+     * 
+ */ + public void listClusters( + com.google.cloud.alloydb.v1beta.ListClustersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListClustersMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Cluster.
+     * 
+ */ + public void getCluster( + com.google.cloud.alloydb.v1beta.GetClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location.
+     * 
+ */ + public void createCluster( + com.google.cloud.alloydb.v1beta.CreateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Cluster.
+     * 
+ */ + public void updateCluster( + com.google.cloud.alloydb.v1beta.UpdateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single Cluster.
+     * 
+ */ + public void deleteCluster( + com.google.cloud.alloydb.v1beta.DeleteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Promotes a SECONDARY cluster. This turns down replication
+     * from the PRIMARY cluster and promotes a secondary cluster
+     * into its own standalone cluster.
+     * Imperative only.
+     * 
+ */ + public void promoteCluster( + com.google.cloud.alloydb.v1beta.PromoteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPromoteClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location, with a volume
+     * restored from the provided source, either a backup ID or a point-in-time
+     * and a source cluster.
+     * 
+ */ + public void restoreCluster( + com.google.cloud.alloydb.v1beta.RestoreClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRestoreClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a cluster of type SECONDARY in the given location using
+     * the primary cluster as the source.
+     * 
+ */ + public void createSecondaryCluster( + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSecondaryClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists Instances in a given project and location.
+     * 
+ */ + public void listInstances( + com.google.cloud.alloydb.v1beta.ListInstancesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListInstancesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Instance.
+     * 
+ */ + public void getInstance( + com.google.cloud.alloydb.v1beta.GetInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Instance in a given project and location.
+     * 
+ */ + public void createInstance( + com.google.cloud.alloydb.v1beta.CreateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new SECONDARY Instance in a given project and location.
+     * 
+ */ + public void createSecondaryInstance( + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSecondaryInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates new instances under the given project, location and cluster.
+     * There can be only one primary instance in a cluster. If the primary
+     * instance exists in the cluster as well as this request, then API will
+     * throw an error.
+     * The primary instance should exist before any read pool instance is
+     * created. If the primary instance is a part of the request payload, then
+     * the API will take care of creating instances in the correct order.
+     * This method is here to support Google-internal use cases, and is not meant
+     * for external customers to consume. Please do not start relying on it; its
+     * behavior is subject to change without notice.
+     * 
+ */ + public void batchCreateInstances( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getBatchCreateInstancesMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Instance.
+     * 
+ */ + public void updateInstance( + com.google.cloud.alloydb.v1beta.UpdateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single Instance.
+     * 
+ */ + public void deleteInstance( + com.google.cloud.alloydb.v1beta.DeleteInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Forces a Failover for a highly available instance.
+     * Failover promotes the HA standby instance as the new primary.
+     * Imperative only.
+     * 
+ */ + public void failoverInstance( + com.google.cloud.alloydb.v1beta.FailoverInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFailoverInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Restart an Instance in a cluster.
+     * Imperative only.
+     * 
+ */ + public void restartInstance( + com.google.cloud.alloydb.v1beta.RestartInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRestartInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists Backups in a given project and location.
+     * 
+ */ + public void listBackups( + com.google.cloud.alloydb.v1beta.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListBackupsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Backup.
+     * 
+ */ + public void getBackup( + com.google.cloud.alloydb.v1beta.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Backup in a given project and location.
+     * 
+ */ + public void createBackup( + com.google.cloud.alloydb.v1beta.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Backup.
+     * 
+ */ + public void updateBackup( + com.google.cloud.alloydb.v1beta.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single Backup.
+     * 
+ */ + public void deleteBackup( + com.google.cloud.alloydb.v1beta.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists SupportedDatabaseFlags for a given project and location.
+     * 
+ */ + public void listSupportedDatabaseFlags( + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSupportedDatabaseFlagsMethod(), responseObserver); + } + + /** + * + * + *
+     * Generate a client certificate signed by a Cluster CA.
+     * The sole purpose of this endpoint is to support the Auth Proxy client and
+     * the endpoint's behavior is subject to change without notice, so do not rely
+     * on its behavior remaining constant. Future changes will not break the Auth
+     * Proxy client.
+     * 
+ */ + public void generateClientCertificate( + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGenerateClientCertificateMethod(), responseObserver); + } + + /** + * + * + *
+     * Get instance metadata used for a connection.
+     * 
+ */ + public void getConnectionInfo( + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetConnectionInfoMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListClustersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.ListClustersRequest, + com.google.cloud.alloydb.v1beta.ListClustersResponse>( + this, METHODID_LIST_CLUSTERS))) + .addMethod( + getGetClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.GetClusterRequest, + com.google.cloud.alloydb.v1beta.Cluster>(this, METHODID_GET_CLUSTER))) + .addMethod( + getCreateClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.CreateClusterRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_CLUSTER))) + .addMethod( + getUpdateClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.UpdateClusterRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_CLUSTER))) + .addMethod( + getDeleteClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.DeleteClusterRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_CLUSTER))) + .addMethod( + getPromoteClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.PromoteClusterRequest, + com.google.longrunning.Operation>(this, METHODID_PROMOTE_CLUSTER))) + .addMethod( + getRestoreClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.RestoreClusterRequest, + com.google.longrunning.Operation>(this, METHODID_RESTORE_CLUSTER))) + .addMethod( + getCreateSecondaryClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_SECONDARY_CLUSTER))) + .addMethod( + getListInstancesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.ListInstancesRequest, + com.google.cloud.alloydb.v1beta.ListInstancesResponse>( + this, METHODID_LIST_INSTANCES))) + .addMethod( + getGetInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.GetInstanceRequest, + com.google.cloud.alloydb.v1beta.Instance>(this, METHODID_GET_INSTANCE))) + .addMethod( + getCreateInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.CreateInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_INSTANCE))) + .addMethod( + getCreateSecondaryInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_SECONDARY_INSTANCE))) + .addMethod( + getBatchCreateInstancesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest, + com.google.longrunning.Operation>(this, METHODID_BATCH_CREATE_INSTANCES))) + .addMethod( + getUpdateInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.UpdateInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_INSTANCE))) + .addMethod( + getDeleteInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.DeleteInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_INSTANCE))) + .addMethod( + getFailoverInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.FailoverInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_FAILOVER_INSTANCE))) + .addMethod( + getRestartInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.RestartInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_RESTART_INSTANCE))) + .addMethod( + getListBackupsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.ListBackupsRequest, + com.google.cloud.alloydb.v1beta.ListBackupsResponse>( + this, METHODID_LIST_BACKUPS))) + .addMethod( + getGetBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.GetBackupRequest, + com.google.cloud.alloydb.v1beta.Backup>(this, METHODID_GET_BACKUP))) + .addMethod( + getCreateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.CreateBackupRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_BACKUP))) + .addMethod( + getUpdateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.UpdateBackupRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_BACKUP))) + .addMethod( + getDeleteBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.DeleteBackupRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_BACKUP))) + .addMethod( + getListSupportedDatabaseFlagsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest, + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse>( + this, METHODID_LIST_SUPPORTED_DATABASE_FLAGS))) + .addMethod( + getGenerateClientCertificateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest, + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse>( + this, METHODID_GENERATE_CLIENT_CERTIFICATE))) + .addMethod( + getGetConnectionInfoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest, + com.google.cloud.alloydb.v1beta.ConnectionInfo>( + this, METHODID_GET_CONNECTION_INFO))) + .build(); + } + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class AlloyDBAdminStub + extends io.grpc.stub.AbstractAsyncStub { + private AlloyDBAdminStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AlloyDBAdminStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Clusters in a given project and location.
+     * 
+ */ + public void listClusters( + com.google.cloud.alloydb.v1beta.ListClustersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListClustersMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Cluster.
+     * 
+ */ + public void getCluster( + com.google.cloud.alloydb.v1beta.GetClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetClusterMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location.
+     * 
+ */ + public void createCluster( + com.google.cloud.alloydb.v1beta.CreateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Cluster.
+     * 
+ */ + public void updateCluster( + com.google.cloud.alloydb.v1beta.UpdateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single Cluster.
+     * 
+ */ + public void deleteCluster( + com.google.cloud.alloydb.v1beta.DeleteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Promotes a SECONDARY cluster. This turns down replication
+     * from the PRIMARY cluster and promotes a secondary cluster
+     * into its own standalone cluster.
+     * Imperative only.
+     * 
+ */ + public void promoteCluster( + com.google.cloud.alloydb.v1beta.PromoteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPromoteClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location, with a volume
+     * restored from the provided source, either a backup ID or a point-in-time
+     * and a source cluster.
+     * 
+ */ + public void restoreCluster( + com.google.cloud.alloydb.v1beta.RestoreClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRestoreClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a cluster of type SECONDARY in the given location using
+     * the primary cluster as the source.
+     * 
+ */ + public void createSecondaryCluster( + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSecondaryClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists Instances in a given project and location.
+     * 
+ */ + public void listInstances( + com.google.cloud.alloydb.v1beta.ListInstancesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListInstancesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Instance.
+     * 
+ */ + public void getInstance( + com.google.cloud.alloydb.v1beta.GetInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new Instance in a given project and location.
+     * 
+ */ + public void createInstance( + com.google.cloud.alloydb.v1beta.CreateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new SECONDARY Instance in a given project and location.
+     * 
+ */ + public void createSecondaryInstance( + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSecondaryInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates new instances under the given project, location and cluster.
+     * There can be only one primary instance in a cluster. If the primary
+     * instance exists in the cluster as well as this request, then API will
+     * throw an error.
+     * The primary instance should exist before any read pool instance is
+     * created. If the primary instance is a part of the request payload, then
+     * the API will take care of creating instances in the correct order.
+     * This method is here to support Google-internal use cases, and is not meant
+     * for external customers to consume. Please do not start relying on it; its
+     * behavior is subject to change without notice.
+     * 
+ */ + public void batchCreateInstances( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBatchCreateInstancesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Instance.
+     * 
+ */ + public void updateInstance( + com.google.cloud.alloydb.v1beta.UpdateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single Instance.
+     * 
+ */ + public void deleteInstance( + com.google.cloud.alloydb.v1beta.DeleteInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Forces a Failover for a highly available instance.
+     * Failover promotes the HA standby instance as the new primary.
+     * Imperative only.
+     * 
+ */ + public void failoverInstance( + com.google.cloud.alloydb.v1beta.FailoverInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFailoverInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Restart an Instance in a cluster.
+     * Imperative only.
+     * 
+ */ + public void restartInstance( + com.google.cloud.alloydb.v1beta.RestartInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRestartInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists Backups in a given project and location.
+     * 
+ */ + public void listBackups( + com.google.cloud.alloydb.v1beta.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Backup.
+     * 
+ */ + public void getBackup( + com.google.cloud.alloydb.v1beta.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new Backup in a given project and location.
+     * 
+ */ + public void createBackup( + com.google.cloud.alloydb.v1beta.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Backup.
+     * 
+ */ + public void updateBackup( + com.google.cloud.alloydb.v1beta.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single Backup.
+     * 
+ */ + public void deleteBackup( + com.google.cloud.alloydb.v1beta.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists SupportedDatabaseFlags for a given project and location.
+     * 
+ */ + public void listSupportedDatabaseFlags( + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSupportedDatabaseFlagsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Generate a client certificate signed by a Cluster CA.
+     * The sole purpose of this endpoint is to support the Auth Proxy client and
+     * the endpoint's behavior is subject to change without notice, so do not rely
+     * on its behavior remaining constant. Future changes will not break the Auth
+     * Proxy client.
+     * 
+ */ + public void generateClientCertificate( + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGenerateClientCertificateMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get instance metadata used for a connection.
+     * 
+ */ + public void getConnectionInfo( + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetConnectionInfoMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class AlloyDBAdminBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private AlloyDBAdminBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AlloyDBAdminBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Clusters in a given project and location.
+     * 
+ */ + public com.google.cloud.alloydb.v1beta.ListClustersResponse listClusters( + com.google.cloud.alloydb.v1beta.ListClustersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListClustersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Cluster.
+     * 
+ */ + public com.google.cloud.alloydb.v1beta.Cluster getCluster( + com.google.cloud.alloydb.v1beta.GetClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createCluster( + com.google.cloud.alloydb.v1beta.CreateClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Cluster.
+     * 
+ */ + public com.google.longrunning.Operation updateCluster( + com.google.cloud.alloydb.v1beta.UpdateClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single Cluster.
+     * 
+ */ + public com.google.longrunning.Operation deleteCluster( + com.google.cloud.alloydb.v1beta.DeleteClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Promotes a SECONDARY cluster. This turns down replication
+     * from the PRIMARY cluster and promotes a secondary cluster
+     * into its own standalone cluster.
+     * Imperative only.
+     * 
+ */ + public com.google.longrunning.Operation promoteCluster( + com.google.cloud.alloydb.v1beta.PromoteClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPromoteClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location, with a volume
+     * restored from the provided source, either a backup ID or a point-in-time
+     * and a source cluster.
+     * 
+ */ + public com.google.longrunning.Operation restoreCluster( + com.google.cloud.alloydb.v1beta.RestoreClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRestoreClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a cluster of type SECONDARY in the given location using
+     * the primary cluster as the source.
+     * 
+ */ + public com.google.longrunning.Operation createSecondaryCluster( + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSecondaryClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists Instances in a given project and location.
+     * 
+ */ + public com.google.cloud.alloydb.v1beta.ListInstancesResponse listInstances( + com.google.cloud.alloydb.v1beta.ListInstancesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListInstancesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Instance.
+     * 
+ */ + public com.google.cloud.alloydb.v1beta.Instance getInstance( + com.google.cloud.alloydb.v1beta.GetInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Instance in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createInstance( + com.google.cloud.alloydb.v1beta.CreateInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new SECONDARY Instance in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createSecondaryInstance( + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSecondaryInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates new instances under the given project, location and cluster.
+     * There can be only one primary instance in a cluster. If the primary
+     * instance exists in the cluster as well as this request, then API will
+     * throw an error.
+     * The primary instance should exist before any read pool instance is
+     * created. If the primary instance is a part of the request payload, then
+     * the API will take care of creating instances in the correct order.
+     * This method is here to support Google-internal use cases, and is not meant
+     * for external customers to consume. Please do not start relying on it; its
+     * behavior is subject to change without notice.
+     * 
+ */ + public com.google.longrunning.Operation batchCreateInstances( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBatchCreateInstancesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Instance.
+     * 
+ */ + public com.google.longrunning.Operation updateInstance( + com.google.cloud.alloydb.v1beta.UpdateInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single Instance.
+     * 
+ */ + public com.google.longrunning.Operation deleteInstance( + com.google.cloud.alloydb.v1beta.DeleteInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Forces a Failover for a highly available instance.
+     * Failover promotes the HA standby instance as the new primary.
+     * Imperative only.
+     * 
+ */ + public com.google.longrunning.Operation failoverInstance( + com.google.cloud.alloydb.v1beta.FailoverInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFailoverInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Restart an Instance in a cluster.
+     * Imperative only.
+     * 
+ */ + public com.google.longrunning.Operation restartInstance( + com.google.cloud.alloydb.v1beta.RestartInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRestartInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists Backups in a given project and location.
+     * 
+ */ + public com.google.cloud.alloydb.v1beta.ListBackupsResponse listBackups( + com.google.cloud.alloydb.v1beta.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBackupsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Backup.
+     * 
+ */ + public com.google.cloud.alloydb.v1beta.Backup getBackup( + com.google.cloud.alloydb.v1beta.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Backup in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createBackup( + com.google.cloud.alloydb.v1beta.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Backup.
+     * 
+ */ + public com.google.longrunning.Operation updateBackup( + com.google.cloud.alloydb.v1beta.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single Backup.
+     * 
+ */ + public com.google.longrunning.Operation deleteBackup( + com.google.cloud.alloydb.v1beta.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists SupportedDatabaseFlags for a given project and location.
+     * 
+ */ + public com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + listSupportedDatabaseFlags( + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSupportedDatabaseFlagsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Generate a client certificate signed by a Cluster CA.
+     * The sole purpose of this endpoint is to support the Auth Proxy client and
+     * the endpoint's behavior is subject to change without notice, so do not rely
+     * on its behavior remaining constant. Future changes will not break the Auth
+     * Proxy client.
+     * 
+ */ + public com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + generateClientCertificate( + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGenerateClientCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get instance metadata used for a connection.
+     * 
+ */ + public com.google.cloud.alloydb.v1beta.ConnectionInfo getConnectionInfo( + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetConnectionInfoMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class AlloyDBAdminFutureStub + extends io.grpc.stub.AbstractFutureStub { + private AlloyDBAdminFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AlloyDBAdminFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AlloyDBAdminFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Clusters in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1beta.ListClustersResponse> + listClusters(com.google.cloud.alloydb.v1beta.ListClustersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListClustersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1beta.Cluster> + getCluster(com.google.cloud.alloydb.v1beta.GetClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createCluster(com.google.cloud.alloydb.v1beta.CreateClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateCluster(com.google.cloud.alloydb.v1beta.UpdateClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single Cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteCluster(com.google.cloud.alloydb.v1beta.DeleteClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Promotes a SECONDARY cluster. This turns down replication
+     * from the PRIMARY cluster and promotes a secondary cluster
+     * into its own standalone cluster.
+     * Imperative only.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + promoteCluster(com.google.cloud.alloydb.v1beta.PromoteClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPromoteClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Cluster in a given project and location, with a volume
+     * restored from the provided source, either a backup ID or a point-in-time
+     * and a source cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + restoreCluster(com.google.cloud.alloydb.v1beta.RestoreClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRestoreClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a cluster of type SECONDARY in the given location using
+     * the primary cluster as the source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSecondaryCluster( + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSecondaryClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists Instances in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1beta.ListInstancesResponse> + listInstances(com.google.cloud.alloydb.v1beta.ListInstancesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListInstancesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1beta.Instance> + getInstance(com.google.cloud.alloydb.v1beta.GetInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Instance in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createInstance(com.google.cloud.alloydb.v1beta.CreateInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new SECONDARY Instance in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSecondaryInstance( + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSecondaryInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates new instances under the given project, location and cluster.
+     * There can be only one primary instance in a cluster. If the primary
+     * instance exists in the cluster as well as this request, then API will
+     * throw an error.
+     * The primary instance should exist before any read pool instance is
+     * created. If the primary instance is a part of the request payload, then
+     * the API will take care of creating instances in the correct order.
+     * This method is here to support Google-internal use cases, and is not meant
+     * for external customers to consume. Please do not start relying on it; its
+     * behavior is subject to change without notice.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + batchCreateInstances(com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBatchCreateInstancesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateInstance(com.google.cloud.alloydb.v1beta.UpdateInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single Instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteInstance(com.google.cloud.alloydb.v1beta.DeleteInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Forces a Failover for a highly available instance.
+     * Failover promotes the HA standby instance as the new primary.
+     * Imperative only.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + failoverInstance(com.google.cloud.alloydb.v1beta.FailoverInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFailoverInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Restart an Instance in a cluster.
+     * Imperative only.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + restartInstance(com.google.cloud.alloydb.v1beta.RestartInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRestartInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists Backups in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1beta.ListBackupsResponse> + listBackups(com.google.cloud.alloydb.v1beta.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1beta.Backup> + getBackup(com.google.cloud.alloydb.v1beta.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Backup in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createBackup(com.google.cloud.alloydb.v1beta.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateBackup(com.google.cloud.alloydb.v1beta.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single Backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteBackup(com.google.cloud.alloydb.v1beta.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists SupportedDatabaseFlags for a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse> + listSupportedDatabaseFlags( + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSupportedDatabaseFlagsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Generate a client certificate signed by a Cluster CA.
+     * The sole purpose of this endpoint is to support the Auth Proxy client and
+     * the endpoint's behavior is subject to change without notice, so do not rely
+     * on its behavior remaining constant. Future changes will not break the Auth
+     * Proxy client.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse> + generateClientCertificate( + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGenerateClientCertificateMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get instance metadata used for a connection.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1beta.ConnectionInfo> + getConnectionInfo(com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetConnectionInfoMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_CLUSTERS = 0; + private static final int METHODID_GET_CLUSTER = 1; + private static final int METHODID_CREATE_CLUSTER = 2; + private static final int METHODID_UPDATE_CLUSTER = 3; + private static final int METHODID_DELETE_CLUSTER = 4; + private static final int METHODID_PROMOTE_CLUSTER = 5; + private static final int METHODID_RESTORE_CLUSTER = 6; + private static final int METHODID_CREATE_SECONDARY_CLUSTER = 7; + private static final int METHODID_LIST_INSTANCES = 8; + private static final int METHODID_GET_INSTANCE = 9; + private static final int METHODID_CREATE_INSTANCE = 10; + private static final int METHODID_CREATE_SECONDARY_INSTANCE = 11; + private static final int METHODID_BATCH_CREATE_INSTANCES = 12; + private static final int METHODID_UPDATE_INSTANCE = 13; + private static final int METHODID_DELETE_INSTANCE = 14; + private static final int METHODID_FAILOVER_INSTANCE = 15; + private static final int METHODID_RESTART_INSTANCE = 16; + private static final int METHODID_LIST_BACKUPS = 17; + private static final int METHODID_GET_BACKUP = 18; + private static final int METHODID_CREATE_BACKUP = 19; + private static final int METHODID_UPDATE_BACKUP = 20; + private static final int METHODID_DELETE_BACKUP = 21; + private static final int METHODID_LIST_SUPPORTED_DATABASE_FLAGS = 22; + private static final int METHODID_GENERATE_CLIENT_CERTIFICATE = 23; + private static final int METHODID_GET_CONNECTION_INFO = 24; + + 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 AlloyDBAdminImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AlloyDBAdminImplBase 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_CLUSTERS: + serviceImpl.listClusters( + (com.google.cloud.alloydb.v1beta.ListClustersRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_CLUSTER: + serviceImpl.getCluster( + (com.google.cloud.alloydb.v1beta.GetClusterRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_CLUSTER: + serviceImpl.createCluster( + (com.google.cloud.alloydb.v1beta.CreateClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_CLUSTER: + serviceImpl.updateCluster( + (com.google.cloud.alloydb.v1beta.UpdateClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_CLUSTER: + serviceImpl.deleteCluster( + (com.google.cloud.alloydb.v1beta.DeleteClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PROMOTE_CLUSTER: + serviceImpl.promoteCluster( + (com.google.cloud.alloydb.v1beta.PromoteClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESTORE_CLUSTER: + serviceImpl.restoreCluster( + (com.google.cloud.alloydb.v1beta.RestoreClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_SECONDARY_CLUSTER: + serviceImpl.createSecondaryCluster( + (com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_INSTANCES: + serviceImpl.listInstances( + (com.google.cloud.alloydb.v1beta.ListInstancesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_INSTANCE: + serviceImpl.getInstance( + (com.google.cloud.alloydb.v1beta.GetInstanceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_INSTANCE: + serviceImpl.createInstance( + (com.google.cloud.alloydb.v1beta.CreateInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_SECONDARY_INSTANCE: + serviceImpl.createSecondaryInstance( + (com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_BATCH_CREATE_INSTANCES: + serviceImpl.batchCreateInstances( + (com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_INSTANCE: + serviceImpl.updateInstance( + (com.google.cloud.alloydb.v1beta.UpdateInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_INSTANCE: + serviceImpl.deleteInstance( + (com.google.cloud.alloydb.v1beta.DeleteInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_FAILOVER_INSTANCE: + serviceImpl.failoverInstance( + (com.google.cloud.alloydb.v1beta.FailoverInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESTART_INSTANCE: + serviceImpl.restartInstance( + (com.google.cloud.alloydb.v1beta.RestartInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_BACKUPS: + serviceImpl.listBackups( + (com.google.cloud.alloydb.v1beta.ListBackupsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_BACKUP: + serviceImpl.getBackup( + (com.google.cloud.alloydb.v1beta.GetBackupRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_BACKUP: + serviceImpl.createBackup( + (com.google.cloud.alloydb.v1beta.CreateBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_BACKUP: + serviceImpl.updateBackup( + (com.google.cloud.alloydb.v1beta.UpdateBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_BACKUP: + serviceImpl.deleteBackup( + (com.google.cloud.alloydb.v1beta.DeleteBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SUPPORTED_DATABASE_FLAGS: + serviceImpl.listSupportedDatabaseFlags( + (com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse>) + responseObserver); + break; + case METHODID_GENERATE_CLIENT_CERTIFICATE: + serviceImpl.generateClientCertificate( + (com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse>) + responseObserver); + break; + case METHODID_GET_CONNECTION_INFO: + serviceImpl.getConnectionInfo( + (com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest) 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 AlloyDBAdminBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AlloyDBAdminBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AlloyDBAdmin"); + } + } + + private static final class AlloyDBAdminFileDescriptorSupplier + extends AlloyDBAdminBaseDescriptorSupplier { + AlloyDBAdminFileDescriptorSupplier() {} + } + + private static final class AlloyDBAdminMethodDescriptorSupplier + extends AlloyDBAdminBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AlloyDBAdminMethodDescriptorSupplier(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 (AlloyDBAdminGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AlloyDBAdminFileDescriptorSupplier()) + .addMethod(getListClustersMethod()) + .addMethod(getGetClusterMethod()) + .addMethod(getCreateClusterMethod()) + .addMethod(getUpdateClusterMethod()) + .addMethod(getDeleteClusterMethod()) + .addMethod(getPromoteClusterMethod()) + .addMethod(getRestoreClusterMethod()) + .addMethod(getCreateSecondaryClusterMethod()) + .addMethod(getListInstancesMethod()) + .addMethod(getGetInstanceMethod()) + .addMethod(getCreateInstanceMethod()) + .addMethod(getCreateSecondaryInstanceMethod()) + .addMethod(getBatchCreateInstancesMethod()) + .addMethod(getUpdateInstanceMethod()) + .addMethod(getDeleteInstanceMethod()) + .addMethod(getFailoverInstanceMethod()) + .addMethod(getRestartInstanceMethod()) + .addMethod(getListBackupsMethod()) + .addMethod(getGetBackupMethod()) + .addMethod(getCreateBackupMethod()) + .addMethod(getUpdateBackupMethod()) + .addMethod(getDeleteBackupMethod()) + .addMethod(getListSupportedDatabaseFlagsMethod()) + .addMethod(getGenerateClientCertificateMethod()) + .addMethod(getGetConnectionInfoMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-alloydb/owlbot.py b/java-alloydb/owlbot.py new file mode 100644 index 000000000000..03c0f6686d3f --- /dev/null +++ b/java-alloydb/owlbot.py @@ -0,0 +1,36 @@ +# 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(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) \ No newline at end of file diff --git a/java-alloydb/pom.xml b/java-alloydb/pom.xml new file mode 100644 index 000000000000..ddc68437292a --- /dev/null +++ b/java-alloydb/pom.xml @@ -0,0 +1,78 @@ + + + 4.0.0 + com.google.cloud + google-cloud-alloydb-parent + pom + 0.0.1-SNAPSHOT + Google AlloyDB Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.6.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-alloydb-parent + + + + + + com.google.cloud + google-cloud-alloydb + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-alloydb-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-alloydb-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-alloydb-v1alpha + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-alloydb-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-alloydb-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-alloydb-v1alpha + 0.0.1-SNAPSHOT + + + + + + google-cloud-alloydb + grpc-google-cloud-alloydb-v1beta + grpc-google-cloud-alloydb-v1 + grpc-google-cloud-alloydb-v1alpha + proto-google-cloud-alloydb-v1 + proto-google-cloud-alloydb-v1beta + proto-google-cloud-alloydb-v1alpha + google-cloud-alloydb-bom + + + diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/clirr-ignored-differences.xml b/java-alloydb/proto-google-cloud-alloydb-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..39c1cbeb66d2 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/alloydb/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/alloydb/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/alloydb/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/pom.xml b/java-alloydb/proto-google-cloud-alloydb-v1/pom.xml new file mode 100644 index 000000000000..53c6a185ffc0 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-alloydb-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-alloydb-v1 + Proto library for google-cloud-alloydb + + com.google.cloud + google-cloud-alloydb-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-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/AutomatedBackupPolicy.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/AutomatedBackupPolicy.java new file mode 100644 index 000000000000..554d1ddcfc6d --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/AutomatedBackupPolicy.java @@ -0,0 +1,5804 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message describing the user-specified automated backup policy.
+ * All fields in the automated backup policy are optional. Defaults for each
+ * field are provided if they are not set.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.AutomatedBackupPolicy} + */ +public final class AutomatedBackupPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.AutomatedBackupPolicy) + AutomatedBackupPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use AutomatedBackupPolicy.newBuilder() to construct. + private AutomatedBackupPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AutomatedBackupPolicy() { + location_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AutomatedBackupPolicy(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.class, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.Builder.class); + } + + public interface WeeklyScheduleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + java.util.List getStartTimesList(); + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + com.google.type.TimeOfDay getStartTimes(int index); + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + int getStartTimesCount(); + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + java.util.List getStartTimesOrBuilderList(); + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + com.google.type.TimeOfDayOrBuilder getStartTimesOrBuilder(int index); + + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the daysOfWeek. + */ + java.util.List getDaysOfWeekList(); + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return The count of daysOfWeek. + */ + int getDaysOfWeekCount(); + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the element to return. + * @return The daysOfWeek at the given index. + */ + com.google.type.DayOfWeek getDaysOfWeek(int index); + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the enum numeric values on the wire for daysOfWeek. + */ + java.util.List getDaysOfWeekValueList(); + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of daysOfWeek at the given index. + */ + int getDaysOfWeekValue(int index); + } + /** + * + * + *
+   * A weekly schedule starts a backup at prescribed start times within a
+   * day, for the specified days of the week.
+   * The weekly schedule message is flexible and can be used to create many
+   * types of schedules. For example, to have a daily backup that starts at
+   * 22:00, configure the `start_times` field to have one element "22:00" and
+   * the `days_of_week` field to have all seven days of the week.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule} + */ + public static final class WeeklySchedule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) + WeeklyScheduleOrBuilder { + private static final long serialVersionUID = 0L; + // Use WeeklySchedule.newBuilder() to construct. + private WeeklySchedule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WeeklySchedule() { + startTimes_ = java.util.Collections.emptyList(); + daysOfWeek_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WeeklySchedule(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_WeeklySchedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_WeeklySchedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.class, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.Builder.class); + } + + public static final int START_TIMES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List startTimes_; + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + @java.lang.Override + public java.util.List getStartTimesList() { + return startTimes_; + } + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + @java.lang.Override + public java.util.List + getStartTimesOrBuilderList() { + return startTimes_; + } + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + @java.lang.Override + public int getStartTimesCount() { + return startTimes_.size(); + } + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + @java.lang.Override + public com.google.type.TimeOfDay getStartTimes(int index) { + return startTimes_.get(index); + } + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + @java.lang.Override + public com.google.type.TimeOfDayOrBuilder getStartTimesOrBuilder(int index) { + return startTimes_.get(index); + } + + public static final int DAYS_OF_WEEK_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List daysOfWeek_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.type.DayOfWeek> + daysOfWeek_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.type.DayOfWeek>() { + public com.google.type.DayOfWeek convert(java.lang.Integer from) { + com.google.type.DayOfWeek result = com.google.type.DayOfWeek.forNumber(from); + return result == null ? com.google.type.DayOfWeek.UNRECOGNIZED : result; + } + }; + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the daysOfWeek. + */ + @java.lang.Override + public java.util.List getDaysOfWeekList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.type.DayOfWeek>(daysOfWeek_, daysOfWeek_converter_); + } + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return The count of daysOfWeek. + */ + @java.lang.Override + public int getDaysOfWeekCount() { + return daysOfWeek_.size(); + } + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the element to return. + * @return The daysOfWeek at the given index. + */ + @java.lang.Override + public com.google.type.DayOfWeek getDaysOfWeek(int index) { + return daysOfWeek_converter_.convert(daysOfWeek_.get(index)); + } + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the enum numeric values on the wire for daysOfWeek. + */ + @java.lang.Override + public java.util.List getDaysOfWeekValueList() { + return daysOfWeek_; + } + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of daysOfWeek at the given index. + */ + @java.lang.Override + public int getDaysOfWeekValue(int index) { + return daysOfWeek_.get(index); + } + + private int daysOfWeekMemoizedSerializedSize; + + 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(); + for (int i = 0; i < startTimes_.size(); i++) { + output.writeMessage(1, startTimes_.get(i)); + } + if (getDaysOfWeekList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(daysOfWeekMemoizedSerializedSize); + } + for (int i = 0; i < daysOfWeek_.size(); i++) { + output.writeEnumNoTag(daysOfWeek_.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 < startTimes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, startTimes_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < daysOfWeek_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(daysOfWeek_.get(i)); + } + size += dataSize; + if (!getDaysOfWeekList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + daysOfWeekMemoizedSerializedSize = 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.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule other = + (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) obj; + + if (!getStartTimesList().equals(other.getStartTimesList())) return false; + if (!daysOfWeek_.equals(other.daysOfWeek_)) 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 (getStartTimesCount() > 0) { + hash = (37 * hash) + START_TIMES_FIELD_NUMBER; + hash = (53 * hash) + getStartTimesList().hashCode(); + } + if (getDaysOfWeekCount() > 0) { + hash = (37 * hash) + DAYS_OF_WEEK_FIELD_NUMBER; + hash = (53 * hash) + daysOfWeek_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule 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.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule 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.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule 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.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + 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.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule 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.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule 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 weekly schedule starts a backup at prescribed start times within a
+     * day, for the specified days of the week.
+     * The weekly schedule message is flexible and can be used to create many
+     * types of schedules. For example, to have a daily backup that starts at
+     * 22:00, configure the `start_times` field to have one element "22:00" and
+     * the `days_of_week` field to have all seven days of the week.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklyScheduleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_WeeklySchedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_WeeklySchedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.class, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.Builder.class); + } + + // Construct using + // com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (startTimesBuilder_ == null) { + startTimes_ = java.util.Collections.emptyList(); + } else { + startTimes_ = null; + startTimesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + daysOfWeek_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_WeeklySchedule_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule build() { + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule buildPartial() { + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule result = + new com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule result) { + if (startTimesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + startTimes_ = java.util.Collections.unmodifiableList(startTimes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.startTimes_ = startTimes_; + } else { + result.startTimes_ = startTimesBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + daysOfWeek_ = java.util.Collections.unmodifiableList(daysOfWeek_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.daysOfWeek_ = daysOfWeek_; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule result) { + int from_bitField0_ = bitField0_; + } + + @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.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) { + return mergeFrom( + (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule other) { + if (other + == com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance()) return this; + if (startTimesBuilder_ == null) { + if (!other.startTimes_.isEmpty()) { + if (startTimes_.isEmpty()) { + startTimes_ = other.startTimes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStartTimesIsMutable(); + startTimes_.addAll(other.startTimes_); + } + onChanged(); + } + } else { + if (!other.startTimes_.isEmpty()) { + if (startTimesBuilder_.isEmpty()) { + startTimesBuilder_.dispose(); + startTimesBuilder_ = null; + startTimes_ = other.startTimes_; + bitField0_ = (bitField0_ & ~0x00000001); + startTimesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStartTimesFieldBuilder() + : null; + } else { + startTimesBuilder_.addAllMessages(other.startTimes_); + } + } + } + if (!other.daysOfWeek_.isEmpty()) { + if (daysOfWeek_.isEmpty()) { + daysOfWeek_ = other.daysOfWeek_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDaysOfWeekIsMutable(); + daysOfWeek_.addAll(other.daysOfWeek_); + } + 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.type.TimeOfDay m = + input.readMessage(com.google.type.TimeOfDay.parser(), extensionRegistry); + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + startTimes_.add(m); + } else { + startTimesBuilder_.addMessage(m); + } + break; + } // case 10 + case 16: + { + int tmpRaw = input.readEnum(); + ensureDaysOfWeekIsMutable(); + daysOfWeek_.add(tmpRaw); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureDaysOfWeekIsMutable(); + daysOfWeek_.add(tmpRaw); + } + input.popLimit(oldLimit); + 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 startTimes_ = + java.util.Collections.emptyList(); + + private void ensureStartTimesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + startTimes_ = new java.util.ArrayList(startTimes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.type.TimeOfDay, + com.google.type.TimeOfDay.Builder, + com.google.type.TimeOfDayOrBuilder> + startTimesBuilder_; + + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public java.util.List getStartTimesList() { + if (startTimesBuilder_ == null) { + return java.util.Collections.unmodifiableList(startTimes_); + } else { + return startTimesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public int getStartTimesCount() { + if (startTimesBuilder_ == null) { + return startTimes_.size(); + } else { + return startTimesBuilder_.getCount(); + } + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public com.google.type.TimeOfDay getStartTimes(int index) { + if (startTimesBuilder_ == null) { + return startTimes_.get(index); + } else { + return startTimesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder setStartTimes(int index, com.google.type.TimeOfDay value) { + if (startTimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartTimesIsMutable(); + startTimes_.set(index, value); + onChanged(); + } else { + startTimesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder setStartTimes(int index, com.google.type.TimeOfDay.Builder builderForValue) { + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + startTimes_.set(index, builderForValue.build()); + onChanged(); + } else { + startTimesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder addStartTimes(com.google.type.TimeOfDay value) { + if (startTimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartTimesIsMutable(); + startTimes_.add(value); + onChanged(); + } else { + startTimesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder addStartTimes(int index, com.google.type.TimeOfDay value) { + if (startTimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartTimesIsMutable(); + startTimes_.add(index, value); + onChanged(); + } else { + startTimesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder addStartTimes(com.google.type.TimeOfDay.Builder builderForValue) { + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + startTimes_.add(builderForValue.build()); + onChanged(); + } else { + startTimesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder addStartTimes(int index, com.google.type.TimeOfDay.Builder builderForValue) { + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + startTimes_.add(index, builderForValue.build()); + onChanged(); + } else { + startTimesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder addAllStartTimes( + java.lang.Iterable values) { + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, startTimes_); + onChanged(); + } else { + startTimesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder clearStartTimes() { + if (startTimesBuilder_ == null) { + startTimes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + startTimesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder removeStartTimes(int index) { + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + startTimes_.remove(index); + onChanged(); + } else { + startTimesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public com.google.type.TimeOfDay.Builder getStartTimesBuilder(int index) { + return getStartTimesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public com.google.type.TimeOfDayOrBuilder getStartTimesOrBuilder(int index) { + if (startTimesBuilder_ == null) { + return startTimes_.get(index); + } else { + return startTimesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public java.util.List + getStartTimesOrBuilderList() { + if (startTimesBuilder_ != null) { + return startTimesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(startTimes_); + } + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public com.google.type.TimeOfDay.Builder addStartTimesBuilder() { + return getStartTimesFieldBuilder() + .addBuilder(com.google.type.TimeOfDay.getDefaultInstance()); + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public com.google.type.TimeOfDay.Builder addStartTimesBuilder(int index) { + return getStartTimesFieldBuilder() + .addBuilder(index, com.google.type.TimeOfDay.getDefaultInstance()); + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public java.util.List getStartTimesBuilderList() { + return getStartTimesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.type.TimeOfDay, + com.google.type.TimeOfDay.Builder, + com.google.type.TimeOfDayOrBuilder> + getStartTimesFieldBuilder() { + if (startTimesBuilder_ == null) { + startTimesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.type.TimeOfDay, + com.google.type.TimeOfDay.Builder, + com.google.type.TimeOfDayOrBuilder>( + startTimes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + startTimes_ = null; + } + return startTimesBuilder_; + } + + private java.util.List daysOfWeek_ = java.util.Collections.emptyList(); + + private void ensureDaysOfWeekIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + daysOfWeek_ = new java.util.ArrayList(daysOfWeek_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the daysOfWeek. + */ + public java.util.List getDaysOfWeekList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.type.DayOfWeek>(daysOfWeek_, daysOfWeek_converter_); + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return The count of daysOfWeek. + */ + public int getDaysOfWeekCount() { + return daysOfWeek_.size(); + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the element to return. + * @return The daysOfWeek at the given index. + */ + public com.google.type.DayOfWeek getDaysOfWeek(int index) { + return daysOfWeek_converter_.convert(daysOfWeek_.get(index)); + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index to set the value at. + * @param value The daysOfWeek to set. + * @return This builder for chaining. + */ + public Builder setDaysOfWeek(int index, com.google.type.DayOfWeek value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDaysOfWeekIsMutable(); + daysOfWeek_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param value The daysOfWeek to add. + * @return This builder for chaining. + */ + public Builder addDaysOfWeek(com.google.type.DayOfWeek value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDaysOfWeekIsMutable(); + daysOfWeek_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param values The daysOfWeek to add. + * @return This builder for chaining. + */ + public Builder addAllDaysOfWeek( + java.lang.Iterable values) { + ensureDaysOfWeekIsMutable(); + for (com.google.type.DayOfWeek value : values) { + daysOfWeek_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return This builder for chaining. + */ + public Builder clearDaysOfWeek() { + daysOfWeek_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the enum numeric values on the wire for daysOfWeek. + */ + public java.util.List getDaysOfWeekValueList() { + return java.util.Collections.unmodifiableList(daysOfWeek_); + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of daysOfWeek at the given index. + */ + public int getDaysOfWeekValue(int index) { + return daysOfWeek_.get(index); + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for daysOfWeek to set. + * @return This builder for chaining. + */ + public Builder setDaysOfWeekValue(int index, int value) { + ensureDaysOfWeekIsMutable(); + daysOfWeek_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param value The enum numeric value on the wire for daysOfWeek to add. + * @return This builder for chaining. + */ + public Builder addDaysOfWeekValue(int value) { + ensureDaysOfWeekIsMutable(); + daysOfWeek_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param values The enum numeric values on the wire for daysOfWeek to add. + * @return This builder for chaining. + */ + public Builder addAllDaysOfWeekValue(java.lang.Iterable values) { + ensureDaysOfWeekIsMutable(); + for (int value : values) { + daysOfWeek_.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.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) + private static final com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule(); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WeeklySchedule 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.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TimeBasedRetentionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return Whether the retentionPeriod field is set. + */ + boolean hasRetentionPeriod(); + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return The retentionPeriod. + */ + com.google.protobuf.Duration getRetentionPeriod(); + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder(); + } + /** + * + * + *
+   * A time based retention policy specifies that all backups within a certain
+   * time period should be retained.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention} + */ + public static final class TimeBasedRetention extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) + TimeBasedRetentionOrBuilder { + private static final long serialVersionUID = 0L; + // Use TimeBasedRetention.newBuilder() to construct. + private TimeBasedRetention(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimeBasedRetention() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TimeBasedRetention(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_TimeBasedRetention_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_TimeBasedRetention_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.class, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.Builder.class); + } + + public static final int RETENTION_PERIOD_FIELD_NUMBER = 1; + private com.google.protobuf.Duration retentionPeriod_; + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return Whether the retentionPeriod field is set. + */ + @java.lang.Override + public boolean hasRetentionPeriod() { + return retentionPeriod_ != null; + } + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return The retentionPeriod. + */ + @java.lang.Override + public com.google.protobuf.Duration getRetentionPeriod() { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder() { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } + + 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 (retentionPeriod_ != null) { + output.writeMessage(1, getRetentionPeriod()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (retentionPeriod_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRetentionPeriod()); + } + 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.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention other = + (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) obj; + + if (hasRetentionPeriod() != other.hasRetentionPeriod()) return false; + if (hasRetentionPeriod()) { + if (!getRetentionPeriod().equals(other.getRetentionPeriod())) 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 (hasRetentionPeriod()) { + hash = (37 * hash) + RETENTION_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getRetentionPeriod().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention 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.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention 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.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention 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.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + 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.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention 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.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention 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 time based retention policy specifies that all backups within a certain
+     * time period should be retained.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_TimeBasedRetention_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_TimeBasedRetention_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.class, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.Builder.class); + } + + // Construct using + // com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + retentionPeriod_ = null; + if (retentionPeriodBuilder_ != null) { + retentionPeriodBuilder_.dispose(); + retentionPeriodBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_TimeBasedRetention_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention build() { + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention buildPartial() { + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention result = + new com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.retentionPeriod_ = + retentionPeriodBuilder_ == null ? retentionPeriod_ : retentionPeriodBuilder_.build(); + } + } + + @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.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) { + return mergeFrom( + (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention other) { + if (other + == com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance()) return this; + if (other.hasRetentionPeriod()) { + mergeRetentionPeriod(other.getRetentionPeriod()); + } + 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( + getRetentionPeriodFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + 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.Duration retentionPeriod_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + retentionPeriodBuilder_; + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return Whether the retentionPeriod field is set. + */ + public boolean hasRetentionPeriod() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return The retentionPeriod. + */ + public com.google.protobuf.Duration getRetentionPeriod() { + if (retentionPeriodBuilder_ == null) { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } else { + return retentionPeriodBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder setRetentionPeriod(com.google.protobuf.Duration value) { + if (retentionPeriodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retentionPeriod_ = value; + } else { + retentionPeriodBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder setRetentionPeriod(com.google.protobuf.Duration.Builder builderForValue) { + if (retentionPeriodBuilder_ == null) { + retentionPeriod_ = builderForValue.build(); + } else { + retentionPeriodBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder mergeRetentionPeriod(com.google.protobuf.Duration value) { + if (retentionPeriodBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && retentionPeriod_ != null + && retentionPeriod_ != com.google.protobuf.Duration.getDefaultInstance()) { + getRetentionPeriodBuilder().mergeFrom(value); + } else { + retentionPeriod_ = value; + } + } else { + retentionPeriodBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder clearRetentionPeriod() { + bitField0_ = (bitField0_ & ~0x00000001); + retentionPeriod_ = null; + if (retentionPeriodBuilder_ != null) { + retentionPeriodBuilder_.dispose(); + retentionPeriodBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public com.google.protobuf.Duration.Builder getRetentionPeriodBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getRetentionPeriodFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder() { + if (retentionPeriodBuilder_ != null) { + return retentionPeriodBuilder_.getMessageOrBuilder(); + } else { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getRetentionPeriodFieldBuilder() { + if (retentionPeriodBuilder_ == null) { + retentionPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getRetentionPeriod(), getParentForChildren(), isClean()); + retentionPeriod_ = null; + } + return retentionPeriodBuilder_; + } + + @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.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) + private static final com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention(); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimeBasedRetention 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.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QuantityBasedRetentionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The number of backups to retain.
+     * 
+ * + * int32 count = 1; + * + * @return The count. + */ + int getCount(); + } + /** + * + * + *
+   * A quantity based policy specifies that a certain number of the most recent
+   * successful backups should be retained.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention} + */ + public static final class QuantityBasedRetention extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) + QuantityBasedRetentionOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuantityBasedRetention.newBuilder() to construct. + private QuantityBasedRetention(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuantityBasedRetention() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuantityBasedRetention(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_QuantityBasedRetention_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_QuantityBasedRetention_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.class, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.Builder + .class); + } + + public static final int COUNT_FIELD_NUMBER = 1; + private int count_ = 0; + /** + * + * + *
+     * The number of backups to retain.
+     * 
+ * + * int32 count = 1; + * + * @return The count. + */ + @java.lang.Override + public int getCount() { + return count_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (count_ != 0) { + output.writeInt32(1, count_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (count_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, count_); + } + 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.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention other = + (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) obj; + + if (getCount() != other.getCount()) 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) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + getCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + 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.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + 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.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + 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.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + 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.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + 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.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention 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 quantity based policy specifies that a certain number of the most recent
+     * successful backups should be retained.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_QuantityBasedRetention_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_QuantityBasedRetention_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.class, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.Builder + .class); + } + + // Construct using + // com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + count_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_QuantityBasedRetention_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention build() { + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + buildPartial() { + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention result = + new com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.count_ = count_; + } + } + + @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.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) { + return mergeFrom( + (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention other) { + if (other + == com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance()) return this; + if (other.getCount() != 0) { + setCount(other.getCount()); + } + 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: + { + count_ = input.readInt32(); + bitField0_ |= 0x00000001; + 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 bitField0_; + + private int count_; + /** + * + * + *
+       * The number of backups to retain.
+       * 
+ * + * int32 count = 1; + * + * @return The count. + */ + @java.lang.Override + public int getCount() { + return count_; + } + /** + * + * + *
+       * The number of backups to retain.
+       * 
+ * + * int32 count = 1; + * + * @param value The count to set. + * @return This builder for chaining. + */ + public Builder setCount(int value) { + + count_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The number of backups to retain.
+       * 
+ * + * int32 count = 1; + * + * @return This builder for chaining. + */ + public Builder clearCount() { + bitField0_ = (bitField0_ & ~0x00000001); + count_ = 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.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) + private static final com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention(); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuantityBasedRetention 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.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + private int scheduleCase_ = 0; + private java.lang.Object schedule_; + + public enum ScheduleCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + WEEKLY_SCHEDULE(2), + SCHEDULE_NOT_SET(0); + private final int value; + + private ScheduleCase(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 ScheduleCase valueOf(int value) { + return forNumber(value); + } + + public static ScheduleCase forNumber(int value) { + switch (value) { + case 2: + return WEEKLY_SCHEDULE; + case 0: + return SCHEDULE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ScheduleCase getScheduleCase() { + return ScheduleCase.forNumber(scheduleCase_); + } + + private int retentionCase_ = 0; + private java.lang.Object retention_; + + public enum RetentionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TIME_BASED_RETENTION(4), + QUANTITY_BASED_RETENTION(5), + RETENTION_NOT_SET(0); + private final int value; + + private RetentionCase(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 RetentionCase valueOf(int value) { + return forNumber(value); + } + + public static RetentionCase forNumber(int value) { + switch (value) { + case 4: + return TIME_BASED_RETENTION; + case 5: + return QUANTITY_BASED_RETENTION; + case 0: + return RETENTION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RetentionCase getRetentionCase() { + return RetentionCase.forNumber(retentionCase_); + } + + public static final int WEEKLY_SCHEDULE_FIELD_NUMBER = 2; + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * @return Whether the weeklySchedule field is set. + */ + @java.lang.Override + public boolean hasWeeklySchedule() { + return scheduleCase_ == 2; + } + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * @return The weeklySchedule. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule getWeeklySchedule() { + if (scheduleCase_ == 2) { + return (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) schedule_; + } + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.getDefaultInstance(); + } + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklyScheduleOrBuilder + getWeeklyScheduleOrBuilder() { + if (scheduleCase_ == 2) { + return (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) schedule_; + } + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.getDefaultInstance(); + } + + public static final int TIME_BASED_RETENTION_FIELD_NUMBER = 4; + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return Whether the timeBasedRetention field is set. + */ + @java.lang.Override + public boolean hasTimeBasedRetention() { + return retentionCase_ == 4; + } + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return The timeBasedRetention. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + getTimeBasedRetention() { + if (retentionCase_ == 4) { + return (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) retention_; + } + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder + getTimeBasedRetentionOrBuilder() { + if (retentionCase_ == 4) { + return (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) retention_; + } + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + + public static final int QUANTITY_BASED_RETENTION_FIELD_NUMBER = 5; + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return Whether the quantityBasedRetention field is set. + */ + @java.lang.Override + public boolean hasQuantityBasedRetention() { + return retentionCase_ == 5; + } + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return The quantityBasedRetention. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + getQuantityBasedRetention() { + if (retentionCase_ == 5) { + return (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) retention_; + } + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder + getQuantityBasedRetentionOrBuilder() { + if (retentionCase_ == 5) { + return (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) retention_; + } + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_ = false; + /** + * + * + *
+   * Whether automated automated backups are enabled. If not set, defaults to
+   * true.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Whether automated automated backups are enabled. If not set, defaults to
+   * true.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + public static final int BACKUP_WINDOW_FIELD_NUMBER = 3; + private com.google.protobuf.Duration backupWindow_; + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return Whether the backupWindow field is set. + */ + @java.lang.Override + public boolean hasBackupWindow() { + return backupWindow_ != null; + } + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return The backupWindow. + */ + @java.lang.Override + public com.google.protobuf.Duration getBackupWindow() { + return backupWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backupWindow_; + } + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getBackupWindowOrBuilder() { + return backupWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backupWindow_; + } + + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 8; + private com.google.cloud.alloydb.v1.EncryptionConfig encryptionConfig_; + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return encryptionConfig_ != null; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + public static final int LOCATION_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + /** + * + * + *
+   * The location where the backup will be stored. Currently, the only supported
+   * option is to store the backup in the same region as the cluster.
+   * If empty, defaults to the region of the cluster.
+   * 
+ * + * string location = 6; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + 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(); + location_ = s; + return s; + } + } + /** + * + * + *
+   * The location where the backup will be stored. Currently, the only supported
+   * option is to store the backup in the same region as the cluster.
+   * If empty, defaults to the region of the cluster.
+   * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 7; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().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 (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, enabled_); + } + if (scheduleCase_ == 2) { + output.writeMessage( + 2, (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) schedule_); + } + if (backupWindow_ != null) { + output.writeMessage(3, getBackupWindow()); + } + if (retentionCase_ == 4) { + output.writeMessage( + 4, (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) retention_); + } + if (retentionCase_ == 5) { + output.writeMessage( + 5, (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) retention_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, location_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 7); + if (encryptionConfig_ != null) { + output.writeMessage(8, getEncryptionConfig()); + } + 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, enabled_); + } + if (scheduleCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) schedule_); + } + if (backupWindow_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBackupWindow()); + } + if (retentionCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) retention_); + } + if (retentionCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, + (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) + retention_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, location_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, labels__); + } + if (encryptionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getEncryptionConfig()); + } + 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.alloydb.v1.AutomatedBackupPolicy)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.AutomatedBackupPolicy other = + (com.google.cloud.alloydb.v1.AutomatedBackupPolicy) obj; + + if (hasEnabled() != other.hasEnabled()) return false; + if (hasEnabled()) { + if (getEnabled() != other.getEnabled()) return false; + } + if (hasBackupWindow() != other.hasBackupWindow()) return false; + if (hasBackupWindow()) { + if (!getBackupWindow().equals(other.getBackupWindow())) return false; + } + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) return false; + } + if (!getLocation().equals(other.getLocation())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getScheduleCase().equals(other.getScheduleCase())) return false; + switch (scheduleCase_) { + case 2: + if (!getWeeklySchedule().equals(other.getWeeklySchedule())) return false; + break; + case 0: + default: + } + if (!getRetentionCase().equals(other.getRetentionCase())) return false; + switch (retentionCase_) { + case 4: + if (!getTimeBasedRetention().equals(other.getTimeBasedRetention())) return false; + break; + case 5: + if (!getQuantityBasedRetention().equals(other.getQuantityBasedRetention())) 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(); + if (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); + } + if (hasBackupWindow()) { + hash = (37 * hash) + BACKUP_WINDOW_FIELD_NUMBER; + hash = (53 * hash) + getBackupWindow().hashCode(); + } + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + switch (scheduleCase_) { + case 2: + hash = (37 * hash) + WEEKLY_SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + getWeeklySchedule().hashCode(); + break; + case 0: + default: + } + switch (retentionCase_) { + case 4: + hash = (37 * hash) + TIME_BASED_RETENTION_FIELD_NUMBER; + hash = (53 * hash) + getTimeBasedRetention().hashCode(); + break; + case 5: + hash = (37 * hash) + QUANTITY_BASED_RETENTION_FIELD_NUMBER; + hash = (53 * hash) + getQuantityBasedRetention().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy 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.alloydb.v1.AutomatedBackupPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy 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.alloydb.v1.AutomatedBackupPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy 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.alloydb.v1.AutomatedBackupPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy 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.alloydb.v1.AutomatedBackupPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy 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.alloydb.v1.AutomatedBackupPolicy 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; + } + /** + * + * + *
+   * Message describing the user-specified automated backup policy.
+   * All fields in the automated backup policy are optional. Defaults for each
+   * field are provided if they are not set.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.AutomatedBackupPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.AutomatedBackupPolicy) + com.google.cloud.alloydb.v1.AutomatedBackupPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.class, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.AutomatedBackupPolicy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (weeklyScheduleBuilder_ != null) { + weeklyScheduleBuilder_.clear(); + } + if (timeBasedRetentionBuilder_ != null) { + timeBasedRetentionBuilder_.clear(); + } + if (quantityBasedRetentionBuilder_ != null) { + quantityBasedRetentionBuilder_.clear(); + } + enabled_ = false; + backupWindow_ = null; + if (backupWindowBuilder_ != null) { + backupWindowBuilder_.dispose(); + backupWindowBuilder_ = null; + } + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + location_ = ""; + internalGetMutableLabels().clear(); + scheduleCase_ = 0; + schedule_ = null; + retentionCase_ = 0; + retention_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy build() { + com.google.cloud.alloydb.v1.AutomatedBackupPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy buildPartial() { + com.google.cloud.alloydb.v1.AutomatedBackupPolicy result = + new com.google.cloud.alloydb.v1.AutomatedBackupPolicy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.AutomatedBackupPolicy result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.enabled_ = enabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.backupWindow_ = + backupWindowBuilder_ == null ? backupWindow_ : backupWindowBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.encryptionConfig_ = + encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.location_ = location_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.alloydb.v1.AutomatedBackupPolicy result) { + result.scheduleCase_ = scheduleCase_; + result.schedule_ = this.schedule_; + if (scheduleCase_ == 2 && weeklyScheduleBuilder_ != null) { + result.schedule_ = weeklyScheduleBuilder_.build(); + } + result.retentionCase_ = retentionCase_; + result.retention_ = this.retention_; + if (retentionCase_ == 4 && timeBasedRetentionBuilder_ != null) { + result.retention_ = timeBasedRetentionBuilder_.build(); + } + if (retentionCase_ == 5 && quantityBasedRetentionBuilder_ != null) { + result.retention_ = quantityBasedRetentionBuilder_.build(); + } + } + + @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.alloydb.v1.AutomatedBackupPolicy) { + return mergeFrom((com.google.cloud.alloydb.v1.AutomatedBackupPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.AutomatedBackupPolicy other) { + if (other == com.google.cloud.alloydb.v1.AutomatedBackupPolicy.getDefaultInstance()) + return this; + if (other.hasEnabled()) { + setEnabled(other.getEnabled()); + } + if (other.hasBackupWindow()) { + mergeBackupWindow(other.getBackupWindow()); + } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000040; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000080; + switch (other.getScheduleCase()) { + case WEEKLY_SCHEDULE: + { + mergeWeeklySchedule(other.getWeeklySchedule()); + break; + } + case SCHEDULE_NOT_SET: + { + break; + } + } + switch (other.getRetentionCase()) { + case TIME_BASED_RETENTION: + { + mergeTimeBasedRetention(other.getTimeBasedRetention()); + break; + } + case QUANTITY_BASED_RETENTION: + { + mergeQuantityBasedRetention(other.getQuantityBasedRetention()); + break; + } + case RETENTION_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 8: + { + enabled_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 8 + case 18: + { + input.readMessage(getWeeklyScheduleFieldBuilder().getBuilder(), extensionRegistry); + scheduleCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getBackupWindowFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 26 + case 34: + { + input.readMessage( + getTimeBasedRetentionFieldBuilder().getBuilder(), extensionRegistry); + retentionCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + getQuantityBasedRetentionFieldBuilder().getBuilder(), extensionRegistry); + retentionCase_ = 5; + break; + } // case 42 + case 50: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 58: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + input.readMessage( + getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 66 + 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 scheduleCase_ = 0; + private java.lang.Object schedule_; + + public ScheduleCase getScheduleCase() { + return ScheduleCase.forNumber(scheduleCase_); + } + + public Builder clearSchedule() { + scheduleCase_ = 0; + schedule_ = null; + onChanged(); + return this; + } + + private int retentionCase_ = 0; + private java.lang.Object retention_; + + public RetentionCase getRetentionCase() { + return RetentionCase.forNumber(retentionCase_); + } + + public Builder clearRetention() { + retentionCase_ = 0; + retention_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.Builder, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklyScheduleOrBuilder> + weeklyScheduleBuilder_; + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * + * @return Whether the weeklySchedule field is set. + */ + @java.lang.Override + public boolean hasWeeklySchedule() { + return scheduleCase_ == 2; + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * + * @return The weeklySchedule. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule getWeeklySchedule() { + if (weeklyScheduleBuilder_ == null) { + if (scheduleCase_ == 2) { + return (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) schedule_; + } + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } else { + if (scheduleCase_ == 2) { + return weeklyScheduleBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + public Builder setWeeklySchedule( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule value) { + if (weeklyScheduleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schedule_ = value; + onChanged(); + } else { + weeklyScheduleBuilder_.setMessage(value); + } + scheduleCase_ = 2; + return this; + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + public Builder setWeeklySchedule( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.Builder builderForValue) { + if (weeklyScheduleBuilder_ == null) { + schedule_ = builderForValue.build(); + onChanged(); + } else { + weeklyScheduleBuilder_.setMessage(builderForValue.build()); + } + scheduleCase_ = 2; + return this; + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + public Builder mergeWeeklySchedule( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule value) { + if (weeklyScheduleBuilder_ == null) { + if (scheduleCase_ == 2 + && schedule_ + != com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance()) { + schedule_ = + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.newBuilder( + (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) schedule_) + .mergeFrom(value) + .buildPartial(); + } else { + schedule_ = value; + } + onChanged(); + } else { + if (scheduleCase_ == 2) { + weeklyScheduleBuilder_.mergeFrom(value); + } else { + weeklyScheduleBuilder_.setMessage(value); + } + } + scheduleCase_ = 2; + return this; + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + public Builder clearWeeklySchedule() { + if (weeklyScheduleBuilder_ == null) { + if (scheduleCase_ == 2) { + scheduleCase_ = 0; + schedule_ = null; + onChanged(); + } + } else { + if (scheduleCase_ == 2) { + scheduleCase_ = 0; + schedule_ = null; + } + weeklyScheduleBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.Builder + getWeeklyScheduleBuilder() { + return getWeeklyScheduleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklyScheduleOrBuilder + getWeeklyScheduleOrBuilder() { + if ((scheduleCase_ == 2) && (weeklyScheduleBuilder_ != null)) { + return weeklyScheduleBuilder_.getMessageOrBuilder(); + } else { + if (scheduleCase_ == 2) { + return (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) schedule_; + } + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.Builder, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklyScheduleOrBuilder> + getWeeklyScheduleFieldBuilder() { + if (weeklyScheduleBuilder_ == null) { + if (!(scheduleCase_ == 2)) { + schedule_ = + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.getDefaultInstance(); + } + weeklyScheduleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.Builder, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklyScheduleOrBuilder>( + (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) schedule_, + getParentForChildren(), + isClean()); + schedule_ = null; + } + scheduleCase_ = 2; + onChanged(); + return weeklyScheduleBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.Builder, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder> + timeBasedRetentionBuilder_; + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return Whether the timeBasedRetention field is set. + */ + @java.lang.Override + public boolean hasTimeBasedRetention() { + return retentionCase_ == 4; + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return The timeBasedRetention. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + getTimeBasedRetention() { + if (timeBasedRetentionBuilder_ == null) { + if (retentionCase_ == 4) { + return (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) retention_; + } + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } else { + if (retentionCase_ == 4) { + return timeBasedRetentionBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + public Builder setTimeBasedRetention( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention value) { + if (timeBasedRetentionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retention_ = value; + onChanged(); + } else { + timeBasedRetentionBuilder_.setMessage(value); + } + retentionCase_ = 4; + return this; + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + public Builder setTimeBasedRetention( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.Builder + builderForValue) { + if (timeBasedRetentionBuilder_ == null) { + retention_ = builderForValue.build(); + onChanged(); + } else { + timeBasedRetentionBuilder_.setMessage(builderForValue.build()); + } + retentionCase_ = 4; + return this; + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + public Builder mergeTimeBasedRetention( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention value) { + if (timeBasedRetentionBuilder_ == null) { + if (retentionCase_ == 4 + && retention_ + != com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance()) { + retention_ = + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.newBuilder( + (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) + retention_) + .mergeFrom(value) + .buildPartial(); + } else { + retention_ = value; + } + onChanged(); + } else { + if (retentionCase_ == 4) { + timeBasedRetentionBuilder_.mergeFrom(value); + } else { + timeBasedRetentionBuilder_.setMessage(value); + } + } + retentionCase_ = 4; + return this; + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + public Builder clearTimeBasedRetention() { + if (timeBasedRetentionBuilder_ == null) { + if (retentionCase_ == 4) { + retentionCase_ = 0; + retention_ = null; + onChanged(); + } + } else { + if (retentionCase_ == 4) { + retentionCase_ = 0; + retention_ = null; + } + timeBasedRetentionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.Builder + getTimeBasedRetentionBuilder() { + return getTimeBasedRetentionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder + getTimeBasedRetentionOrBuilder() { + if ((retentionCase_ == 4) && (timeBasedRetentionBuilder_ != null)) { + return timeBasedRetentionBuilder_.getMessageOrBuilder(); + } else { + if (retentionCase_ == 4) { + return (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) retention_; + } + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.Builder, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder> + getTimeBasedRetentionFieldBuilder() { + if (timeBasedRetentionBuilder_ == null) { + if (!(retentionCase_ == 4)) { + retention_ = + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + timeBasedRetentionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.Builder, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder>( + (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) retention_, + getParentForChildren(), + isClean()); + retention_ = null; + } + retentionCase_ = 4; + onChanged(); + return timeBasedRetentionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.Builder, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder> + quantityBasedRetentionBuilder_; + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return Whether the quantityBasedRetention field is set. + */ + @java.lang.Override + public boolean hasQuantityBasedRetention() { + return retentionCase_ == 5; + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return The quantityBasedRetention. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + getQuantityBasedRetention() { + if (quantityBasedRetentionBuilder_ == null) { + if (retentionCase_ == 5) { + return (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) + retention_; + } + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } else { + if (retentionCase_ == 5) { + return quantityBasedRetentionBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + public Builder setQuantityBasedRetention( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention value) { + if (quantityBasedRetentionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retention_ = value; + onChanged(); + } else { + quantityBasedRetentionBuilder_.setMessage(value); + } + retentionCase_ = 5; + return this; + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + public Builder setQuantityBasedRetention( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.Builder + builderForValue) { + if (quantityBasedRetentionBuilder_ == null) { + retention_ = builderForValue.build(); + onChanged(); + } else { + quantityBasedRetentionBuilder_.setMessage(builderForValue.build()); + } + retentionCase_ = 5; + return this; + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + public Builder mergeQuantityBasedRetention( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention value) { + if (quantityBasedRetentionBuilder_ == null) { + if (retentionCase_ == 5 + && retention_ + != com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance()) { + retention_ = + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.newBuilder( + (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) + retention_) + .mergeFrom(value) + .buildPartial(); + } else { + retention_ = value; + } + onChanged(); + } else { + if (retentionCase_ == 5) { + quantityBasedRetentionBuilder_.mergeFrom(value); + } else { + quantityBasedRetentionBuilder_.setMessage(value); + } + } + retentionCase_ = 5; + return this; + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + public Builder clearQuantityBasedRetention() { + if (quantityBasedRetentionBuilder_ == null) { + if (retentionCase_ == 5) { + retentionCase_ = 0; + retention_ = null; + onChanged(); + } + } else { + if (retentionCase_ == 5) { + retentionCase_ = 0; + retention_ = null; + } + quantityBasedRetentionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.Builder + getQuantityBasedRetentionBuilder() { + return getQuantityBasedRetentionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder + getQuantityBasedRetentionOrBuilder() { + if ((retentionCase_ == 5) && (quantityBasedRetentionBuilder_ != null)) { + return quantityBasedRetentionBuilder_.getMessageOrBuilder(); + } else { + if (retentionCase_ == 5) { + return (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) + retention_; + } + return com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.Builder, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder> + getQuantityBasedRetentionFieldBuilder() { + if (quantityBasedRetentionBuilder_ == null) { + if (!(retentionCase_ == 5)) { + retention_ = + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + quantityBasedRetentionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.Builder, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder>( + (com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) + retention_, + getParentForChildren(), + isClean()); + retention_ = null; + } + retentionCase_ = 5; + onChanged(); + return quantityBasedRetentionBuilder_; + } + + private boolean enabled_; + /** + * + * + *
+     * Whether automated automated backups are enabled. If not set, defaults to
+     * true.
+     * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Whether automated automated backups are enabled. If not set, defaults to
+     * true.
+     * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + /** + * + * + *
+     * Whether automated automated backups are enabled. If not set, defaults to
+     * true.
+     * 
+ * + * optional bool enabled = 1; + * + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether automated automated backups are enabled. If not set, defaults to
+     * true.
+     * 
+ * + * optional bool enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000008); + enabled_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Duration backupWindow_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + backupWindowBuilder_; + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return Whether the backupWindow field is set. + */ + public boolean hasBackupWindow() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return The backupWindow. + */ + public com.google.protobuf.Duration getBackupWindow() { + if (backupWindowBuilder_ == null) { + return backupWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backupWindow_; + } else { + return backupWindowBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public Builder setBackupWindow(com.google.protobuf.Duration value) { + if (backupWindowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupWindow_ = value; + } else { + backupWindowBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public Builder setBackupWindow(com.google.protobuf.Duration.Builder builderForValue) { + if (backupWindowBuilder_ == null) { + backupWindow_ = builderForValue.build(); + } else { + backupWindowBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public Builder mergeBackupWindow(com.google.protobuf.Duration value) { + if (backupWindowBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && backupWindow_ != null + && backupWindow_ != com.google.protobuf.Duration.getDefaultInstance()) { + getBackupWindowBuilder().mergeFrom(value); + } else { + backupWindow_ = value; + } + } else { + backupWindowBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public Builder clearBackupWindow() { + bitField0_ = (bitField0_ & ~0x00000010); + backupWindow_ = null; + if (backupWindowBuilder_ != null) { + backupWindowBuilder_.dispose(); + backupWindowBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public com.google.protobuf.Duration.Builder getBackupWindowBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getBackupWindowFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public com.google.protobuf.DurationOrBuilder getBackupWindowOrBuilder() { + if (backupWindowBuilder_ != null) { + return backupWindowBuilder_.getMessageOrBuilder(); + } else { + return backupWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backupWindow_; + } + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getBackupWindowFieldBuilder() { + if (backupWindowBuilder_ == null) { + backupWindowBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getBackupWindow(), getParentForChildren(), isClean()); + backupWindow_ = null; + } + return backupWindowBuilder_; + } + + private com.google.cloud.alloydb.v1.EncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionConfig, + com.google.cloud.alloydb.v1.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder> + encryptionConfigBuilder_; + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + public com.google.cloud.alloydb.v1.EncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig(com.google.cloud.alloydb.v1.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + } else { + encryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig( + com.google.cloud.alloydb.v1.EncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); + } else { + encryptionConfig_ = value; + } + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEncryptionConfig() { + bitField0_ = (bitField0_ & ~0x00000020); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1.EncryptionConfig.Builder getEncryptionConfigBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getEncryptionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionConfig, + com.google.cloud.alloydb.v1.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder> + getEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionConfig, + com.google.cloud.alloydb.v1.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + + private java.lang.Object location_ = ""; + /** + * + * + *
+     * The location where the backup will be stored. Currently, the only supported
+     * option is to store the backup in the same region as the cluster.
+     * If empty, defaults to the region of the cluster.
+     * 
+ * + * string location = 6; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The location where the backup will be stored. Currently, the only supported
+     * option is to store the backup in the same region as the cluster.
+     * If empty, defaults to the region of the cluster.
+     * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The location where the backup will be stored. Currently, the only supported
+     * option is to store the backup in the same region as the cluster.
+     * If empty, defaults to the region of the cluster.
+     * 
+ * + * string location = 6; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The location where the backup will be stored. Currently, the only supported
+     * option is to store the backup in the same region as the cluster.
+     * If empty, defaults to the region of the cluster.
+     * 
+ * + * string location = 6; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * The location where the backup will be stored. Currently, the only supported
+     * option is to store the backup in the same region as the cluster.
+     * If empty, defaults to the region of the cluster.
+     * 
+ * + * string location = 6; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000080; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000080); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000080; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000080; + return this; + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000080; + 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.alloydb.v1.AutomatedBackupPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.AutomatedBackupPolicy) + private static final com.google.cloud.alloydb.v1.AutomatedBackupPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.AutomatedBackupPolicy(); + } + + public static com.google.cloud.alloydb.v1.AutomatedBackupPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AutomatedBackupPolicy 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.alloydb.v1.AutomatedBackupPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/AutomatedBackupPolicyOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/AutomatedBackupPolicyOrBuilder.java new file mode 100644 index 000000000000..c7f1a06a1901 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/AutomatedBackupPolicyOrBuilder.java @@ -0,0 +1,361 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public interface AutomatedBackupPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.AutomatedBackupPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * @return Whether the weeklySchedule field is set. + */ + boolean hasWeeklySchedule(); + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * @return The weeklySchedule. + */ + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule getWeeklySchedule(); + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + */ + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklyScheduleOrBuilder + getWeeklyScheduleOrBuilder(); + + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return Whether the timeBasedRetention field is set. + */ + boolean hasTimeBasedRetention(); + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return The timeBasedRetention. + */ + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention getTimeBasedRetention(); + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder + getTimeBasedRetentionOrBuilder(); + + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return Whether the quantityBasedRetention field is set. + */ + boolean hasQuantityBasedRetention(); + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return The quantityBasedRetention. + */ + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + getQuantityBasedRetention(); + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder + getQuantityBasedRetentionOrBuilder(); + + /** + * + * + *
+   * Whether automated automated backups are enabled. If not set, defaults to
+   * true.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + boolean hasEnabled(); + /** + * + * + *
+   * Whether automated automated backups are enabled. If not set, defaults to
+   * true.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + boolean getEnabled(); + + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return Whether the backupWindow field is set. + */ + boolean hasBackupWindow(); + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return The backupWindow. + */ + com.google.protobuf.Duration getBackupWindow(); + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + com.google.protobuf.DurationOrBuilder getBackupWindowOrBuilder(); + + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + com.google.cloud.alloydb.v1.EncryptionConfig getEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); + + /** + * + * + *
+   * The location where the backup will be stored. Currently, the only supported
+   * option is to store the backup in the same region as the cluster.
+   * If empty, defaults to the region of the cluster.
+   * 
+ * + * string location = 6; + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+   * The location where the backup will be stored. Currently, the only supported
+   * option is to store the backup in the same region as the cluster.
+   * If empty, defaults to the region of the cluster.
+   * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.ScheduleCase getScheduleCase(); + + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.RetentionCase getRetentionCase(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Backup.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Backup.java new file mode 100644 index 000000000000..a805cf669559 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Backup.java @@ -0,0 +1,5133 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message describing Backup object
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Backup} + */ +public final class Backup extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.Backup) + BackupOrBuilder { + private static final long serialVersionUID = 0L; + // Use Backup.newBuilder() to construct. + private Backup(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Backup() { + name_ = ""; + displayName_ = ""; + uid_ = ""; + state_ = 0; + type_ = 0; + description_ = ""; + clusterUid_ = ""; + clusterName_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Backup(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Backup_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetLabels(); + case 16: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Backup.class, + com.google.cloud.alloydb.v1.Backup.Builder.class); + } + + /** + * + * + *
+   * Backup State
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.Backup.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the backup is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The backup is ready.
+     * 
+ * + * READY = 1; + */ + READY(1), + /** + * + * + *
+     * The backup is creating.
+     * 
+ * + * CREATING = 2; + */ + CREATING(2), + /** + * + * + *
+     * The backup failed.
+     * 
+ * + * FAILED = 3; + */ + FAILED(3), + /** + * + * + *
+     * The backup is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The state of the backup is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The backup is ready.
+     * 
+ * + * READY = 1; + */ + public static final int READY_VALUE = 1; + /** + * + * + *
+     * The backup is creating.
+     * 
+ * + * CREATING = 2; + */ + public static final int CREATING_VALUE = 2; + /** + * + * + *
+     * The backup failed.
+     * 
+ * + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + /** + * + * + *
+     * The backup is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_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 STATE_UNSPECIFIED; + case 1: + return READY; + case 2: + return CREATING; + case 3: + return FAILED; + case 4: + return DELETING; + 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.alloydb.v1.Backup.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.alloydb.v1.Backup.State) + } + + /** + * + * + *
+   * Backup Type
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.Backup.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Backup Type is unknown.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * ON_DEMAND backups that were triggered by the customer (e.g., not
+     * AUTOMATED).
+     * 
+ * + * ON_DEMAND = 1; + */ + ON_DEMAND(1), + /** + * + * + *
+     * AUTOMATED backups triggered by the automated backups scheduler pursuant
+     * to an automated backup policy.
+     * 
+ * + * AUTOMATED = 2; + */ + AUTOMATED(2), + /** + * + * + *
+     * CONTINUOUS backups triggered by the automated backups scheduler
+     * due to a continuous backup policy.
+     * 
+ * + * CONTINUOUS = 3; + */ + CONTINUOUS(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Backup Type is unknown.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * ON_DEMAND backups that were triggered by the customer (e.g., not
+     * AUTOMATED).
+     * 
+ * + * ON_DEMAND = 1; + */ + public static final int ON_DEMAND_VALUE = 1; + /** + * + * + *
+     * AUTOMATED backups triggered by the automated backups scheduler pursuant
+     * to an automated backup policy.
+     * 
+ * + * AUTOMATED = 2; + */ + public static final int AUTOMATED_VALUE = 2; + /** + * + * + *
+     * CONTINUOUS backups triggered by the automated backups scheduler
+     * due to a continuous backup policy.
+     * 
+ * + * CONTINUOUS = 3; + */ + public static final int CONTINUOUS_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 Type 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 Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return ON_DEMAND; + case 2: + return AUTOMATED; + case 3: + return CONTINUOUS; + 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 Type findValueByNumber(int number) { + return Type.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.alloydb.v1.Backup.getDescriptor().getEnumTypes().get(1); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1.Backup.Type) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * where the cluster and backup ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the backup resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * where the cluster and backup ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the backup resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * User-settable and human-readable display name for the Backup.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * User-settable and human-readable display name for the Backup.
+   * 
+ * + * 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 UID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + 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(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int DELETE_TIME_FIELD_NUMBER = 15; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.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. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + + public static final int LABELS_FIELD_NUMBER = 6; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Backup_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATE_FIELD_NUMBER = 7; + private int state_ = 0; + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Backup.State getState() { + com.google.cloud.alloydb.v1.Backup.State result = + com.google.cloud.alloydb.v1.Backup.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1.Backup.State.UNRECOGNIZED : result; + } + + public static final int TYPE_FIELD_NUMBER = 8; + private int type_ = 0; + /** + * + * + *
+   * The backup type, which suggests the trigger for the backup.
+   * 
+ * + * .google.cloud.alloydb.v1.Backup.Type type = 8; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * The backup type, which suggests the trigger for the backup.
+   * 
+ * + * .google.cloud.alloydb.v1.Backup.Type type = 8; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Backup.Type getType() { + com.google.cloud.alloydb.v1.Backup.Type result = + com.google.cloud.alloydb.v1.Backup.Type.forNumber(type_); + return result == null ? com.google.cloud.alloydb.v1.Backup.Type.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * User-provided description of the backup.
+   * 
+ * + * string description = 9; + * + * @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; + } + } + /** + * + * + *
+   * User-provided description of the backup.
+   * 
+ * + * string description = 9; + * + * @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 CLUSTER_UID_FIELD_NUMBER = 18; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterUid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UID of the cluster which was used to
+   * create this resource.
+   * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clusterUid. + */ + @java.lang.Override + public java.lang.String getClusterUid() { + java.lang.Object ref = clusterUid_; + 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(); + clusterUid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UID of the cluster which was used to
+   * create this resource.
+   * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clusterUid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterUidBytes() { + java.lang.Object ref = clusterUid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_NAME_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterName_ = ""; + /** + * + * + *
+   * Required. The full resource name of the backup source cluster
+   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The clusterName. + */ + @java.lang.Override + public java.lang.String getClusterName() { + java.lang.Object ref = clusterName_; + 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(); + clusterName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The full resource name of the backup source cluster
+   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for clusterName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterNameBytes() { + java.lang.Object ref = clusterName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECONCILING_FIELD_NUMBER = 11; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
+   * true, indicates that the service is actively updating the resource. This
+   * can happen due to user-triggered updates or system actions like failover or
+   * maintenance.
+   * 
+ * + * bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 12; + private com.google.cloud.alloydb.v1.EncryptionConfig encryptionConfig_; + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return encryptionConfig_ != null; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + public static final int ENCRYPTION_INFO_FIELD_NUMBER = 13; + private com.google.cloud.alloydb.v1.EncryptionInfo encryptionInfo_; + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + @java.lang.Override + public boolean hasEncryptionInfo() { + return encryptionInfo_ != null; + } + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionInfo getEncryptionInfo() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + + public static final int ETAG_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 14; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 14; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 16; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Backup_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SIZE_BYTES_FIELD_NUMBER = 17; + private long sizeBytes_ = 0L; + /** + * + * + *
+   * Output only. The size of the backup in bytes.
+   * 
+ * + * int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + @java.lang.Override + public long getSizeBytes() { + return sizeBytes_; + } + + public static final int EXPIRY_TIME_FIELD_NUMBER = 19; + private com.google.protobuf.Timestamp expiryTime_; + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expiryTime field is set. + */ + @java.lang.Override + public boolean hasExpiryTime() { + return expiryTime_ != null; + } + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expiryTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpiryTime() { + return expiryTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expiryTime_; + } + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder() { + return expiryTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expiryTime_; + } + + 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(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uid_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 6); + if (state_ != com.google.cloud.alloydb.v1.Backup.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(7, state_); + } + if (type_ != com.google.cloud.alloydb.v1.Backup.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, clusterName_); + } + if (reconciling_ != false) { + output.writeBool(11, reconciling_); + } + if (encryptionConfig_ != null) { + output.writeMessage(12, getEncryptionConfig()); + } + if (encryptionInfo_ != null) { + output.writeMessage(13, getEncryptionInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, etag_); + } + if (deleteTime_ != null) { + output.writeMessage(15, getDeleteTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 16); + if (sizeBytes_ != 0L) { + output.writeInt64(17, sizeBytes_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterUid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 18, clusterUid_); + } + if (expiryTime_ != null) { + output.writeMessage(19, getExpiryTime()); + } + 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(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uid_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, labels__); + } + if (state_ != com.google.cloud.alloydb.v1.Backup.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, state_); + } + if (type_ != com.google.cloud.alloydb.v1.Backup.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, clusterName_); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, reconciling_); + } + if (encryptionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getEncryptionConfig()); + } + if (encryptionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getEncryptionInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, etag_); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getDeleteTime()); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, annotations__); + } + if (sizeBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(17, sizeBytes_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterUid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, clusterUid_); + } + if (expiryTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getExpiryTime()); + } + 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.alloydb.v1.Backup)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.Backup other = (com.google.cloud.alloydb.v1.Backup) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (state_ != other.state_) return false; + if (type_ != other.type_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getClusterUid().equals(other.getClusterUid())) return false; + if (!getClusterName().equals(other.getClusterName())) return false; + if (getReconciling() != other.getReconciling()) return false; + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) return false; + } + if (hasEncryptionInfo() != other.hasEncryptionInfo()) return false; + if (hasEncryptionInfo()) { + if (!getEncryptionInfo().equals(other.getEncryptionInfo())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (getSizeBytes() != other.getSizeBytes()) return false; + if (hasExpiryTime() != other.hasExpiryTime()) return false; + if (hasExpiryTime()) { + if (!getExpiryTime().equals(other.getExpiryTime())) 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(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + CLUSTER_UID_FIELD_NUMBER; + hash = (53 * hash) + getClusterUid().hashCode(); + hash = (37 * hash) + CLUSTER_NAME_FIELD_NUMBER; + hash = (53 * hash) + getClusterName().hashCode(); + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } + if (hasEncryptionInfo()) { + hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionInfo().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (37 * hash) + SIZE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSizeBytes()); + if (hasExpiryTime()) { + hash = (37 * hash) + EXPIRY_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpiryTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.Backup parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Backup 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.alloydb.v1.Backup parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Backup 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.alloydb.v1.Backup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Backup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.Backup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Backup 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.alloydb.v1.Backup parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Backup 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.alloydb.v1.Backup parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Backup 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.alloydb.v1.Backup 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; + } + /** + * + * + *
+   * Message describing Backup object
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Backup} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.Backup) + com.google.cloud.alloydb.v1.BackupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Backup_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetLabels(); + case 16: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 6: + return internalGetMutableLabels(); + case 16: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Backup.class, + com.google.cloud.alloydb.v1.Backup.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.Backup.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + uid_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + state_ = 0; + type_ = 0; + description_ = ""; + clusterUid_ = ""; + clusterName_ = ""; + reconciling_ = false; + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + etag_ = ""; + internalGetMutableAnnotations().clear(); + sizeBytes_ = 0L; + expiryTime_ = null; + if (expiryTimeBuilder_ != null) { + expiryTimeBuilder_.dispose(); + expiryTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Backup_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Backup getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.Backup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Backup build() { + com.google.cloud.alloydb.v1.Backup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Backup buildPartial() { + com.google.cloud.alloydb.v1.Backup result = new com.google.cloud.alloydb.v1.Backup(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.Backup result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.clusterUid_ = clusterUid_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.clusterName_ = clusterName_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.encryptionConfig_ = + encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.encryptionInfo_ = + encryptionInfoBuilder_ == null ? encryptionInfo_ : encryptionInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.sizeBytes_ = sizeBytes_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.expiryTime_ = expiryTimeBuilder_ == null ? expiryTime_ : expiryTimeBuilder_.build(); + } + } + + @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.alloydb.v1.Backup) { + return mergeFrom((com.google.cloud.alloydb.v1.Backup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.Backup other) { + if (other == com.google.cloud.alloydb.v1.Backup.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000040; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (!other.getClusterUid().isEmpty()) { + clusterUid_ = other.clusterUid_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (!other.getClusterName().isEmpty()) { + clusterName_ = other.clusterName_; + bitField0_ |= 0x00000800; + onChanged(); + } + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } + if (other.hasEncryptionInfo()) { + mergeEncryptionInfo(other.getEncryptionInfo()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00008000; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00010000; + if (other.getSizeBytes() != 0L) { + setSizeBytes(other.getSizeBytes()); + } + if (other.hasExpiryTime()) { + mergeExpiryTime(other.getExpiryTime()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 56: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 56 + case 64: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 64 + case 74: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 74 + case 82: + { + clusterName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 82 + case 88: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00001000; + break; + } // case 88 + case 98: + { + input.readMessage( + getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 98 + case 106: + { + input.readMessage(getEncryptionInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00004000; + break; + } // case 106 + case 114: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 114 + case 122: + { + input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 122 + case 130: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00010000; + break; + } // case 130 + case 136: + { + sizeBytes_ = input.readInt64(); + bitField0_ |= 0x00020000; + break; + } // case 136 + case 146: + { + clusterUid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 146 + case 154: + { + input.readMessage(getExpiryTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 154 + 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_ = ""; + /** + * + * + *
+     * Output only. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * where the cluster and backup ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the backup resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * where the cluster and backup ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the backup resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * where the cluster and backup ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the backup resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * where the cluster and backup ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the backup resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * where the cluster and backup ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the backup resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * User-settable and human-readable display name for the Backup.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Backup.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Backup.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Backup.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Backup.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + 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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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 deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.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; + } else { + deleteTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); + } else { + deleteTime_ = value; + } + } else { + deleteTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + bitField0_ = (bitField0_ & ~0x00000020); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.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_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000040; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000040; + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Backup.State getState() { + com.google.cloud.alloydb.v1.Backup.State result = + com.google.cloud.alloydb.v1.Backup.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1.Backup.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.alloydb.v1.Backup.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000080); + state_ = 0; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * The backup type, which suggests the trigger for the backup.
+     * 
+ * + * .google.cloud.alloydb.v1.Backup.Type type = 8; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * The backup type, which suggests the trigger for the backup.
+     * 
+ * + * .google.cloud.alloydb.v1.Backup.Type type = 8; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The backup type, which suggests the trigger for the backup.
+     * 
+ * + * .google.cloud.alloydb.v1.Backup.Type type = 8; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Backup.Type getType() { + com.google.cloud.alloydb.v1.Backup.Type result = + com.google.cloud.alloydb.v1.Backup.Type.forNumber(type_); + return result == null ? com.google.cloud.alloydb.v1.Backup.Type.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The backup type, which suggests the trigger for the backup.
+     * 
+ * + * .google.cloud.alloydb.v1.Backup.Type type = 8; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.alloydb.v1.Backup.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The backup type, which suggests the trigger for the backup.
+     * 
+ * + * .google.cloud.alloydb.v1.Backup.Type type = 8; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000100); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * User-provided description of the backup.
+     * 
+ * + * string description = 9; + * + * @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; + } + } + /** + * + * + *
+     * User-provided description of the backup.
+     * 
+ * + * string description = 9; + * + * @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; + } + } + /** + * + * + *
+     * User-provided description of the backup.
+     * 
+ * + * string description = 9; + * + * @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; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * User-provided description of the backup.
+     * 
+ * + * string description = 9; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * User-provided description of the backup.
+     * 
+ * + * string description = 9; + * + * @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; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.lang.Object clusterUid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UID of the cluster which was used to
+     * create this resource.
+     * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clusterUid. + */ + public java.lang.String getClusterUid() { + java.lang.Object ref = clusterUid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterUid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the cluster which was used to
+     * create this resource.
+     * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clusterUid. + */ + public com.google.protobuf.ByteString getClusterUidBytes() { + java.lang.Object ref = clusterUid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the cluster which was used to
+     * create this resource.
+     * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The clusterUid to set. + * @return This builder for chaining. + */ + public Builder setClusterUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterUid_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the cluster which was used to
+     * create this resource.
+     * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearClusterUid() { + clusterUid_ = getDefaultInstance().getClusterUid(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the cluster which was used to
+     * create this resource.
+     * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for clusterUid to set. + * @return This builder for chaining. + */ + public Builder setClusterUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterUid_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.lang.Object clusterName_ = ""; + /** + * + * + *
+     * Required. The full resource name of the backup source cluster
+     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The clusterName. + */ + public java.lang.String getClusterName() { + java.lang.Object ref = clusterName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The full resource name of the backup source cluster
+     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for clusterName. + */ + public com.google.protobuf.ByteString getClusterNameBytes() { + java.lang.Object ref = clusterName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The full resource name of the backup source cluster
+     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The clusterName to set. + * @return This builder for chaining. + */ + public Builder setClusterName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterName_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource name of the backup source cluster
+     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearClusterName() { + clusterName_ = getDefaultInstance().getClusterName(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource name of the backup source cluster
+     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for clusterName to set. + * @return This builder for chaining. + */ + public Builder setClusterNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterName_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
+     * true, indicates that the service is actively updating the resource. This
+     * can happen due to user-triggered updates or system actions like failover or
+     * maintenance.
+     * 
+ * + * bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
+     * true, indicates that the service is actively updating the resource. This
+     * can happen due to user-triggered updates or system actions like failover or
+     * maintenance.
+     * 
+ * + * bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
+     * true, indicates that the service is actively updating the resource. This
+     * can happen due to user-triggered updates or system actions like failover or
+     * maintenance.
+     * 
+ * + * bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00001000); + reconciling_ = false; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1.EncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionConfig, + com.google.cloud.alloydb.v1.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder> + encryptionConfigBuilder_; + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + public com.google.cloud.alloydb.v1.EncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig(com.google.cloud.alloydb.v1.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + } else { + encryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig( + com.google.cloud.alloydb.v1.EncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); + } else { + encryptionConfig_ = value; + } + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEncryptionConfig() { + bitField0_ = (bitField0_ & ~0x00002000); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1.EncryptionConfig.Builder getEncryptionConfigBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getEncryptionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionConfig, + com.google.cloud.alloydb.v1.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder> + getEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionConfig, + com.google.cloud.alloydb.v1.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + + private com.google.cloud.alloydb.v1.EncryptionInfo encryptionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionInfo, + com.google.cloud.alloydb.v1.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder> + encryptionInfoBuilder_; + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + public boolean hasEncryptionInfo() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + public com.google.cloud.alloydb.v1.EncryptionInfo getEncryptionInfo() { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } else { + return encryptionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo(com.google.cloud.alloydb.v1.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionInfo_ = value; + } else { + encryptionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo( + com.google.cloud.alloydb.v1.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = builderForValue.build(); + } else { + encryptionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEncryptionInfo(com.google.cloud.alloydb.v1.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0) + && encryptionInfo_ != null + && encryptionInfo_ != com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance()) { + getEncryptionInfoBuilder().mergeFrom(value); + } else { + encryptionInfo_ = value; + } + } else { + encryptionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEncryptionInfo() { + bitField0_ = (bitField0_ & ~0x00004000); + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.EncryptionInfo.Builder getEncryptionInfoBuilder() { + bitField0_ |= 0x00004000; + onChanged(); + return getEncryptionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + if (encryptionInfoBuilder_ != null) { + return encryptionInfoBuilder_.getMessageOrBuilder(); + } else { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionInfo, + com.google.cloud.alloydb.v1.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder> + getEncryptionInfoFieldBuilder() { + if (encryptionInfoBuilder_ == null) { + encryptionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionInfo, + com.google.cloud.alloydb.v1.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder>( + getEncryptionInfo(), getParentForChildren(), isClean()); + encryptionInfo_ = null; + } + return encryptionInfoBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 14; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 14; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 14; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 14; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 14; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00010000; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00010000); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00010000; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00010000; + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00010000; + return this; + } + + private long sizeBytes_; + /** + * + * + *
+     * Output only. The size of the backup in bytes.
+     * 
+ * + * int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + @java.lang.Override + public long getSizeBytes() { + return sizeBytes_; + } + /** + * + * + *
+     * Output only. The size of the backup in bytes.
+     * 
+ * + * int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sizeBytes to set. + * @return This builder for chaining. + */ + public Builder setSizeBytes(long value) { + + sizeBytes_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The size of the backup in bytes.
+     * 
+ * + * int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSizeBytes() { + bitField0_ = (bitField0_ & ~0x00020000); + sizeBytes_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expiryTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expiryTimeBuilder_; + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expiryTime field is set. + */ + public boolean hasExpiryTime() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expiryTime. + */ + public com.google.protobuf.Timestamp getExpiryTime() { + if (expiryTimeBuilder_ == null) { + return expiryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expiryTime_; + } else { + return expiryTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpiryTime(com.google.protobuf.Timestamp value) { + if (expiryTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiryTime_ = value; + } else { + expiryTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpiryTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expiryTimeBuilder_ == null) { + expiryTime_ = builderForValue.build(); + } else { + expiryTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeExpiryTime(com.google.protobuf.Timestamp value) { + if (expiryTimeBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) + && expiryTime_ != null + && expiryTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpiryTimeBuilder().mergeFrom(value); + } else { + expiryTime_ = value; + } + } else { + expiryTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearExpiryTime() { + bitField0_ = (bitField0_ & ~0x00040000); + expiryTime_ = null; + if (expiryTimeBuilder_ != null) { + expiryTimeBuilder_.dispose(); + expiryTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getExpiryTimeBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return getExpiryTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder() { + if (expiryTimeBuilder_ != null) { + return expiryTimeBuilder_.getMessageOrBuilder(); + } else { + return expiryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expiryTime_; + } + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpiryTimeFieldBuilder() { + if (expiryTimeBuilder_ == null) { + expiryTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpiryTime(), getParentForChildren(), isClean()); + expiryTime_ = null; + } + return expiryTimeBuilder_; + } + + @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.alloydb.v1.Backup) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.Backup) + private static final com.google.cloud.alloydb.v1.Backup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.Backup(); + } + + public static com.google.cloud.alloydb.v1.Backup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Backup 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.alloydb.v1.Backup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupName.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupName.java new file mode 100644 index 000000000000..4c485963b391 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupName.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.alloydb.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 BackupName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_BACKUP = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/backups/{backup}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String backup; + + @Deprecated + protected BackupName() { + project = null; + location = null; + backup = null; + } + + private BackupName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + backup = Preconditions.checkNotNull(builder.getBackup()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBackup() { + return backup; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BackupName of(String project, String location, String backup) { + return newBuilder().setProject(project).setLocation(location).setBackup(backup).build(); + } + + public static String format(String project, String location, String backup) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBackup(backup) + .build() + .toString(); + } + + public static BackupName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_BACKUP.validatedMatch( + formattedString, "BackupName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("backup")); + } + + 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 (BackupName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_BACKUP.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 (backup != null) { + fieldMapBuilder.put("backup", backup); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_BACKUP.instantiate( + "project", project, "location", location, "backup", backup); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + BackupName that = ((BackupName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.backup, that.backup); + } + 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(backup); + return h; + } + + /** Builder for projects/{project}/locations/{location}/backups/{backup}. */ + public static class Builder { + private String project; + private String location; + private String backup; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBackup() { + return backup; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setBackup(String backup) { + this.backup = backup; + return this; + } + + private Builder(BackupName backupName) { + this.project = backupName.project; + this.location = backupName.location; + this.backup = backupName.backup; + } + + public BackupName build() { + return new BackupName(this); + } + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupOrBuilder.java new file mode 100644 index 000000000000..89be857a4263 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupOrBuilder.java @@ -0,0 +1,684 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public interface BackupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.Backup) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * where the cluster and backup ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the backup resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * where the cluster and backup ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the backup resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * User-settable and human-readable display name for the Backup.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * User-settable and human-readable display name for the Backup.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.alloydb.v1.Backup.State getState(); + + /** + * + * + *
+   * The backup type, which suggests the trigger for the backup.
+   * 
+ * + * .google.cloud.alloydb.v1.Backup.Type type = 8; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * The backup type, which suggests the trigger for the backup.
+   * 
+ * + * .google.cloud.alloydb.v1.Backup.Type type = 8; + * + * @return The type. + */ + com.google.cloud.alloydb.v1.Backup.Type getType(); + + /** + * + * + *
+   * User-provided description of the backup.
+   * 
+ * + * string description = 9; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * User-provided description of the backup.
+   * 
+ * + * string description = 9; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The system-generated UID of the cluster which was used to
+   * create this resource.
+   * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clusterUid. + */ + java.lang.String getClusterUid(); + /** + * + * + *
+   * Output only. The system-generated UID of the cluster which was used to
+   * create this resource.
+   * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clusterUid. + */ + com.google.protobuf.ByteString getClusterUidBytes(); + + /** + * + * + *
+   * Required. The full resource name of the backup source cluster
+   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The clusterName. + */ + java.lang.String getClusterName(); + /** + * + * + *
+   * Required. The full resource name of the backup source cluster
+   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for clusterName. + */ + com.google.protobuf.ByteString getClusterNameBytes(); + + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
+   * true, indicates that the service is actively updating the resource. This
+   * can happen due to user-triggered updates or system actions like failover or
+   * maintenance.
+   * 
+ * + * bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + com.google.cloud.alloydb.v1.EncryptionConfig getEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); + + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + boolean hasEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + com.google.cloud.alloydb.v1.EncryptionInfo getEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(); + + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 14; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 14; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The size of the backup in bytes.
+   * 
+ * + * int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + long getSizeBytes(); + + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expiryTime field is set. + */ + boolean hasExpiryTime(); + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expiryTime. + */ + com.google.protobuf.Timestamp getExpiryTime(); + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupSource.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupSource.java new file mode 100644 index 000000000000..5e83cb588f2d --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupSource.java @@ -0,0 +1,844 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message describing a BackupSource.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.BackupSource} + */ +public final class BackupSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.BackupSource) + BackupSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use BackupSource.newBuilder() to construct. + private BackupSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BackupSource() { + backupUid_ = ""; + backupName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BackupSource(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_BackupSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_BackupSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.BackupSource.class, + com.google.cloud.alloydb.v1.BackupSource.Builder.class); + } + + public static final int BACKUP_UID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupUid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UID of the backup which was used to
+   * create this resource. The UID is generated when the backup is created, and
+   * it is retained until the backup is deleted.
+   * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backupUid. + */ + @java.lang.Override + public java.lang.String getBackupUid() { + java.lang.Object ref = backupUid_; + 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(); + backupUid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UID of the backup which was used to
+   * create this resource. The UID is generated when the backup is created, and
+   * it is retained until the backup is deleted.
+   * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backupUid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupUidBytes() { + java.lang.Object ref = backupUid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupName_ = ""; + /** + * + * + *
+   * Required. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The backupName. + */ + @java.lang.Override + public java.lang.String getBackupName() { + java.lang.Object ref = backupName_; + 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(); + backupName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for backupName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupNameBytes() { + java.lang.Object ref = backupName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupName_ = 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(backupName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, backupName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupUid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, backupUid_); + } + 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(backupName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, backupName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupUid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, backupUid_); + } + 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.alloydb.v1.BackupSource)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.BackupSource other = (com.google.cloud.alloydb.v1.BackupSource) obj; + + if (!getBackupUid().equals(other.getBackupUid())) return false; + if (!getBackupName().equals(other.getBackupName())) 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) + BACKUP_UID_FIELD_NUMBER; + hash = (53 * hash) + getBackupUid().hashCode(); + hash = (37 * hash) + BACKUP_NAME_FIELD_NUMBER; + hash = (53 * hash) + getBackupName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.BackupSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.BackupSource 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.alloydb.v1.BackupSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.BackupSource 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.alloydb.v1.BackupSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.BackupSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.BackupSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.BackupSource 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.alloydb.v1.BackupSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.BackupSource 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.alloydb.v1.BackupSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.BackupSource 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.alloydb.v1.BackupSource 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; + } + /** + * + * + *
+   * Message describing a BackupSource.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.BackupSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.BackupSource) + com.google.cloud.alloydb.v1.BackupSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_BackupSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_BackupSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.BackupSource.class, + com.google.cloud.alloydb.v1.BackupSource.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.BackupSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backupUid_ = ""; + backupName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_BackupSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.BackupSource getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.BackupSource build() { + com.google.cloud.alloydb.v1.BackupSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.BackupSource buildPartial() { + com.google.cloud.alloydb.v1.BackupSource result = + new com.google.cloud.alloydb.v1.BackupSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.BackupSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backupUid_ = backupUid_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backupName_ = backupName_; + } + } + + @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.alloydb.v1.BackupSource) { + return mergeFrom((com.google.cloud.alloydb.v1.BackupSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.BackupSource other) { + if (other == com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance()) return this; + if (!other.getBackupUid().isEmpty()) { + backupUid_ = other.backupUid_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getBackupName().isEmpty()) { + backupName_ = other.backupName_; + bitField0_ |= 0x00000002; + 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: + { + backupName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + backupUid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + 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 backupUid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UID of the backup which was used to
+     * create this resource. The UID is generated when the backup is created, and
+     * it is retained until the backup is deleted.
+     * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backupUid. + */ + public java.lang.String getBackupUid() { + java.lang.Object ref = backupUid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupUid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the backup which was used to
+     * create this resource. The UID is generated when the backup is created, and
+     * it is retained until the backup is deleted.
+     * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backupUid. + */ + public com.google.protobuf.ByteString getBackupUidBytes() { + java.lang.Object ref = backupUid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the backup which was used to
+     * create this resource. The UID is generated when the backup is created, and
+     * it is retained until the backup is deleted.
+     * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The backupUid to set. + * @return This builder for chaining. + */ + public Builder setBackupUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupUid_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the backup which was used to
+     * create this resource. The UID is generated when the backup is created, and
+     * it is retained until the backup is deleted.
+     * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearBackupUid() { + backupUid_ = getDefaultInstance().getBackupUid(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the backup which was used to
+     * create this resource. The UID is generated when the backup is created, and
+     * it is retained until the backup is deleted.
+     * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for backupUid to set. + * @return This builder for chaining. + */ + public Builder setBackupUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupUid_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object backupName_ = ""; + /** + * + * + *
+     * Required. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The backupName. + */ + public java.lang.String getBackupName() { + java.lang.Object ref = backupName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for backupName. + */ + public com.google.protobuf.ByteString getBackupNameBytes() { + java.lang.Object ref = backupName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The backupName to set. + * @return This builder for chaining. + */ + public Builder setBackupName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearBackupName() { + backupName_ = getDefaultInstance().getBackupName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for backupName to set. + * @return This builder for chaining. + */ + public Builder setBackupNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupName_ = value; + bitField0_ |= 0x00000002; + 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.alloydb.v1.BackupSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.BackupSource) + private static final com.google.cloud.alloydb.v1.BackupSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.BackupSource(); + } + + public static com.google.cloud.alloydb.v1.BackupSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupSource 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.alloydb.v1.BackupSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupSourceOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupSourceOrBuilder.java new file mode 100644 index 000000000000..029310eff164 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupSourceOrBuilder.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/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public interface BackupSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.BackupSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The system-generated UID of the backup which was used to
+   * create this resource. The UID is generated when the backup is created, and
+   * it is retained until the backup is deleted.
+   * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backupUid. + */ + java.lang.String getBackupUid(); + /** + * + * + *
+   * Output only. The system-generated UID of the backup which was used to
+   * create this resource. The UID is generated when the backup is created, and
+   * it is retained until the backup is deleted.
+   * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backupUid. + */ + com.google.protobuf.ByteString getBackupUidBytes(); + + /** + * + * + *
+   * Required. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The backupName. + */ + java.lang.String getBackupName(); + /** + * + * + *
+   * Required. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for backupName. + */ + com.google.protobuf.ByteString getBackupNameBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstanceStatus.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstanceStatus.java new file mode 100644 index 000000000000..285a376c9189 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstanceStatus.java @@ -0,0 +1,1498 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for current status of an instance in the BatchCreateInstances
+ * operation.
+ * For example, lets say a BatchCreateInstances workflow has 4 instances,
+ * Instance1 through Instance4. Lets also assume that 2 instances succeeded
+ * but the third failed to create and the 4th was never picked up for creation
+ * because of failure of the previous one. Then, resulting states would look
+ * something like:
+ *   1. Instance1 = ROLLED_BACK
+ *   2. Instance2 = ROLLED_BACK
+ *   3. Instance3 = FAILED
+ *   4. Instance4 = FAILED
+ * However, while the operation is running, the instance might be in other
+ * states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states
+ * / do not get further updated once the operation is done.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.BatchCreateInstanceStatus} + */ +public final class BatchCreateInstanceStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.BatchCreateInstanceStatus) + BatchCreateInstanceStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchCreateInstanceStatus.newBuilder() to construct. + private BatchCreateInstanceStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchCreateInstanceStatus() { + state_ = 0; + errorMsg_ = ""; + type_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateInstanceStatus(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstanceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstanceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.class, + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.Builder.class); + } + + /** + * + * + *
+   * State contains all valid instance states for the BatchCreateInstances
+   * operation. This is mainly used for status reporting through the LRO
+   * metadata.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.BatchCreateInstanceStatus.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Instance is pending creation and has not yet been picked up for
+     * processsing in the backend.
+     * 
+ * + * PENDING_CREATE = 1; + */ + PENDING_CREATE(1), + /** + * + * + *
+     * The instance is active and running.
+     * 
+ * + * READY = 2; + */ + READY(2), + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 3; + */ + CREATING(3), + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * an operation on the instance or a batch of instances.
+     * 
+ * + * FAILED = 5; + */ + FAILED(5), + /** + * + * + *
+     * The instance was created successfully, but was rolled back and deleted
+     * due to some other failure during BatchCreateInstances operation.
+     * 
+ * + * ROLLED_BACK = 6; + */ + ROLLED_BACK(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Instance is pending creation and has not yet been picked up for
+     * processsing in the backend.
+     * 
+ * + * PENDING_CREATE = 1; + */ + public static final int PENDING_CREATE_VALUE = 1; + /** + * + * + *
+     * The instance is active and running.
+     * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 3; + */ + public static final int CREATING_VALUE = 3; + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * an operation on the instance or a batch of instances.
+     * 
+ * + * FAILED = 5; + */ + public static final int FAILED_VALUE = 5; + /** + * + * + *
+     * The instance was created successfully, but was rolled back and deleted
+     * due to some other failure during BatchCreateInstances operation.
+     * 
+ * + * ROLLED_BACK = 6; + */ + public static final int ROLLED_BACK_VALUE = 6; + + 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 PENDING_CREATE; + case 2: + return READY; + case 3: + return CREATING; + case 4: + return DELETING; + case 5: + return FAILED; + case 6: + return ROLLED_BACK; + 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.alloydb.v1.BatchCreateInstanceStatus.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.alloydb.v1.BatchCreateInstanceStatus.State) + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_ = 0; + /** + * + * + *
+   * The current state of an instance involved in the batch create operation.
+   * Once the operation is complete, the final state of the instances in the
+   * LRO can be one of:
+   *   1. ACTIVE, indicating that instances were created successfully
+   *   2. FAILED, indicating that a particular instance failed creation
+   *   3. ROLLED_BACK indicating that although the instance was created
+   *      successfully, it had to be rolled back and deleted due to failure in
+   *      other steps of the workflow.
+   * 
+ * + * .google.cloud.alloydb.v1.BatchCreateInstanceStatus.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The current state of an instance involved in the batch create operation.
+   * Once the operation is complete, the final state of the instances in the
+   * LRO can be one of:
+   *   1. ACTIVE, indicating that instances were created successfully
+   *   2. FAILED, indicating that a particular instance failed creation
+   *   3. ROLLED_BACK indicating that although the instance was created
+   *      successfully, it had to be rolled back and deleted due to failure in
+   *      other steps of the workflow.
+   * 
+ * + * .google.cloud.alloydb.v1.BatchCreateInstanceStatus.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State getState() { + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State result = + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State.forNumber(state_); + return result == null + ? com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State.UNRECOGNIZED + : result; + } + + public static final int ERROR_MSG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object errorMsg_ = ""; + /** + * + * + *
+   * DEPRECATED - Use the error field instead.
+   * Error, if any error occurred and is available, during instance creation.
+   * 
+ * + * string error_msg = 2; + * + * @return The errorMsg. + */ + @java.lang.Override + public java.lang.String getErrorMsg() { + java.lang.Object ref = errorMsg_; + 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(); + errorMsg_ = s; + return s; + } + } + /** + * + * + *
+   * DEPRECATED - Use the error field instead.
+   * Error, if any error occurred and is available, during instance creation.
+   * 
+ * + * string error_msg = 2; + * + * @return The bytes for errorMsg. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorMsgBytes() { + java.lang.Object ref = errorMsg_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMsg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_FIELD_NUMBER = 4; + private com.google.rpc.Status error_; + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + + public static final int TYPE_FIELD_NUMBER = 3; + private int type_ = 0; + /** + * .google.cloud.alloydb.v1.Instance.InstanceType type = 3; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * .google.cloud.alloydb.v1.Instance.InstanceType type = 3; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.InstanceType getType() { + com.google.cloud.alloydb.v1.Instance.InstanceType result = + com.google.cloud.alloydb.v1.Instance.InstanceType.forNumber(type_); + return result == null ? com.google.cloud.alloydb.v1.Instance.InstanceType.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 (state_ + != com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMsg_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errorMsg_); + } + if (type_ + != com.google.cloud.alloydb.v1.Instance.InstanceType.INSTANCE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, type_); + } + if (error_ != null) { + output.writeMessage(4, getError()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ + != com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMsg_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errorMsg_); + } + if (type_ + != com.google.cloud.alloydb.v1.Instance.InstanceType.INSTANCE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_); + } + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getError()); + } + 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.alloydb.v1.BatchCreateInstanceStatus)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus other = + (com.google.cloud.alloydb.v1.BatchCreateInstanceStatus) obj; + + if (state_ != other.state_) return false; + if (!getErrorMsg().equals(other.getErrorMsg())) return false; + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (type_ != other.type_) 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) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + ERROR_MSG_FIELD_NUMBER; + hash = (53 * hash) + getErrorMsg().hashCode(); + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstanceStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstanceStatus 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.alloydb.v1.BatchCreateInstanceStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstanceStatus 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.alloydb.v1.BatchCreateInstanceStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstanceStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstanceStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstanceStatus 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.alloydb.v1.BatchCreateInstanceStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstanceStatus 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.alloydb.v1.BatchCreateInstanceStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstanceStatus 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.alloydb.v1.BatchCreateInstanceStatus 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; + } + /** + * + * + *
+   * Message for current status of an instance in the BatchCreateInstances
+   * operation.
+   * For example, lets say a BatchCreateInstances workflow has 4 instances,
+   * Instance1 through Instance4. Lets also assume that 2 instances succeeded
+   * but the third failed to create and the 4th was never picked up for creation
+   * because of failure of the previous one. Then, resulting states would look
+   * something like:
+   *   1. Instance1 = ROLLED_BACK
+   *   2. Instance2 = ROLLED_BACK
+   *   3. Instance3 = FAILED
+   *   4. Instance4 = FAILED
+   * However, while the operation is running, the instance might be in other
+   * states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states
+   * / do not get further updated once the operation is done.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.BatchCreateInstanceStatus} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.BatchCreateInstanceStatus) + com.google.cloud.alloydb.v1.BatchCreateInstanceStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstanceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstanceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.class, + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + state_ = 0; + errorMsg_ = ""; + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + type_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstanceStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstanceStatus getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstanceStatus build() { + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstanceStatus buildPartial() { + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus result = + new com.google.cloud.alloydb.v1.BatchCreateInstanceStatus(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.BatchCreateInstanceStatus result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.errorMsg_ = errorMsg_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.type_ = type_; + } + } + + @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.alloydb.v1.BatchCreateInstanceStatus) { + return mergeFrom((com.google.cloud.alloydb.v1.BatchCreateInstanceStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.BatchCreateInstanceStatus other) { + if (other == com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.getDefaultInstance()) + return this; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getErrorMsg().isEmpty()) { + errorMsg_ = other.errorMsg_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasError()) { + mergeError(other.getError()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + 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: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + errorMsg_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 24 + case 34: + { + input.readMessage(getErrorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + 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 int bitField0_; + + private int state_ = 0; + /** + * + * + *
+     * The current state of an instance involved in the batch create operation.
+     * Once the operation is complete, the final state of the instances in the
+     * LRO can be one of:
+     *   1. ACTIVE, indicating that instances were created successfully
+     *   2. FAILED, indicating that a particular instance failed creation
+     *   3. ROLLED_BACK indicating that although the instance was created
+     *      successfully, it had to be rolled back and deleted due to failure in
+     *      other steps of the workflow.
+     * 
+ * + * .google.cloud.alloydb.v1.BatchCreateInstanceStatus.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The current state of an instance involved in the batch create operation.
+     * Once the operation is complete, the final state of the instances in the
+     * LRO can be one of:
+     *   1. ACTIVE, indicating that instances were created successfully
+     *   2. FAILED, indicating that a particular instance failed creation
+     *   3. ROLLED_BACK indicating that although the instance was created
+     *      successfully, it had to be rolled back and deleted due to failure in
+     *      other steps of the workflow.
+     * 
+ * + * .google.cloud.alloydb.v1.BatchCreateInstanceStatus.State state = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The current state of an instance involved in the batch create operation.
+     * Once the operation is complete, the final state of the instances in the
+     * LRO can be one of:
+     *   1. ACTIVE, indicating that instances were created successfully
+     *   2. FAILED, indicating that a particular instance failed creation
+     *   3. ROLLED_BACK indicating that although the instance was created
+     *      successfully, it had to be rolled back and deleted due to failure in
+     *      other steps of the workflow.
+     * 
+ * + * .google.cloud.alloydb.v1.BatchCreateInstanceStatus.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State getState() { + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State result = + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State.forNumber(state_); + return result == null + ? com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The current state of an instance involved in the batch create operation.
+     * Once the operation is complete, the final state of the instances in the
+     * LRO can be one of:
+     *   1. ACTIVE, indicating that instances were created successfully
+     *   2. FAILED, indicating that a particular instance failed creation
+     *   3. ROLLED_BACK indicating that although the instance was created
+     *      successfully, it had to be rolled back and deleted due to failure in
+     *      other steps of the workflow.
+     * 
+ * + * .google.cloud.alloydb.v1.BatchCreateInstanceStatus.State state = 1; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The current state of an instance involved in the batch create operation.
+     * Once the operation is complete, the final state of the instances in the
+     * LRO can be one of:
+     *   1. ACTIVE, indicating that instances were created successfully
+     *   2. FAILED, indicating that a particular instance failed creation
+     *   3. ROLLED_BACK indicating that although the instance was created
+     *      successfully, it had to be rolled back and deleted due to failure in
+     *      other steps of the workflow.
+     * 
+ * + * .google.cloud.alloydb.v1.BatchCreateInstanceStatus.State state = 1; + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000001); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object errorMsg_ = ""; + /** + * + * + *
+     * DEPRECATED - Use the error field instead.
+     * Error, if any error occurred and is available, during instance creation.
+     * 
+ * + * string error_msg = 2; + * + * @return The errorMsg. + */ + public java.lang.String getErrorMsg() { + java.lang.Object ref = errorMsg_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMsg_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * DEPRECATED - Use the error field instead.
+     * Error, if any error occurred and is available, during instance creation.
+     * 
+ * + * string error_msg = 2; + * + * @return The bytes for errorMsg. + */ + public com.google.protobuf.ByteString getErrorMsgBytes() { + java.lang.Object ref = errorMsg_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMsg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * DEPRECATED - Use the error field instead.
+     * Error, if any error occurred and is available, during instance creation.
+     * 
+ * + * string error_msg = 2; + * + * @param value The errorMsg to set. + * @return This builder for chaining. + */ + public Builder setErrorMsg(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + errorMsg_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * DEPRECATED - Use the error field instead.
+     * Error, if any error occurred and is available, during instance creation.
+     * 
+ * + * string error_msg = 2; + * + * @return This builder for chaining. + */ + public Builder clearErrorMsg() { + errorMsg_ = getDefaultInstance().getErrorMsg(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * DEPRECATED - Use the error field instead.
+     * Error, if any error occurred and is available, during instance creation.
+     * 
+ * + * string error_msg = 2; + * + * @param value The bytes for errorMsg to set. + * @return This builder for chaining. + */ + public Builder setErrorMsgBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + errorMsg_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.rpc.Status error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + * + * @return The error. + */ + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } else { + return errorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && error_ != null + && error_ != com.google.rpc.Status.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000004); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + private int type_ = 0; + /** + * .google.cloud.alloydb.v1.Instance.InstanceType type = 3; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * .google.cloud.alloydb.v1.Instance.InstanceType type = 3; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .google.cloud.alloydb.v1.Instance.InstanceType type = 3; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.InstanceType getType() { + com.google.cloud.alloydb.v1.Instance.InstanceType result = + com.google.cloud.alloydb.v1.Instance.InstanceType.forNumber(type_); + return result == null + ? com.google.cloud.alloydb.v1.Instance.InstanceType.UNRECOGNIZED + : result; + } + /** + * .google.cloud.alloydb.v1.Instance.InstanceType type = 3; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.alloydb.v1.Instance.InstanceType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .google.cloud.alloydb.v1.Instance.InstanceType type = 3; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000008); + type_ = 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.alloydb.v1.BatchCreateInstanceStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.BatchCreateInstanceStatus) + private static final com.google.cloud.alloydb.v1.BatchCreateInstanceStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.BatchCreateInstanceStatus(); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstanceStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateInstanceStatus 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.alloydb.v1.BatchCreateInstanceStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstanceStatusOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstanceStatusOrBuilder.java new file mode 100644 index 000000000000..9fb7091dbfc5 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstanceStatusOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface BatchCreateInstanceStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.BatchCreateInstanceStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The current state of an instance involved in the batch create operation.
+   * Once the operation is complete, the final state of the instances in the
+   * LRO can be one of:
+   *   1. ACTIVE, indicating that instances were created successfully
+   *   2. FAILED, indicating that a particular instance failed creation
+   *   3. ROLLED_BACK indicating that although the instance was created
+   *      successfully, it had to be rolled back and deleted due to failure in
+   *      other steps of the workflow.
+   * 
+ * + * .google.cloud.alloydb.v1.BatchCreateInstanceStatus.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The current state of an instance involved in the batch create operation.
+   * Once the operation is complete, the final state of the instances in the
+   * LRO can be one of:
+   *   1. ACTIVE, indicating that instances were created successfully
+   *   2. FAILED, indicating that a particular instance failed creation
+   *   3. ROLLED_BACK indicating that although the instance was created
+   *      successfully, it had to be rolled back and deleted due to failure in
+   *      other steps of the workflow.
+   * 
+ * + * .google.cloud.alloydb.v1.BatchCreateInstanceStatus.State state = 1; + * + * @return The state. + */ + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State getState(); + + /** + * + * + *
+   * DEPRECATED - Use the error field instead.
+   * Error, if any error occurred and is available, during instance creation.
+   * 
+ * + * string error_msg = 2; + * + * @return The errorMsg. + */ + java.lang.String getErrorMsg(); + /** + * + * + *
+   * DEPRECATED - Use the error field instead.
+   * Error, if any error occurred and is available, during instance creation.
+   * 
+ * + * string error_msg = 2; + * + * @return The bytes for errorMsg. + */ + com.google.protobuf.ByteString getErrorMsgBytes(); + + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + * + * @return Whether the error field is set. + */ + boolean hasError(); + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + * + * @return The error. + */ + com.google.rpc.Status getError(); + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + * .google.cloud.alloydb.v1.Instance.InstanceType type = 3; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * .google.cloud.alloydb.v1.Instance.InstanceType type = 3; + * + * @return The type. + */ + com.google.cloud.alloydb.v1.Instance.InstanceType getType(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesMetadata.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesMetadata.java new file mode 100644 index 000000000000..8ead77428820 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesMetadata.java @@ -0,0 +1,1211 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for metadata that is specific to BatchCreateInstances API.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.BatchCreateInstancesMetadata} + */ +public final class BatchCreateInstancesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.BatchCreateInstancesMetadata) + BatchCreateInstancesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchCreateInstancesMetadata.newBuilder() to construct. + private BatchCreateInstancesMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchCreateInstancesMetadata() { + instanceTargets_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateInstancesMetadata(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetInstanceStatuses(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.class, + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.Builder.class); + } + + public static final int INSTANCE_TARGETS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList instanceTargets_; + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @return A list containing the instanceTargets. + */ + public com.google.protobuf.ProtocolStringList getInstanceTargetsList() { + return instanceTargets_; + } + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @return The count of instanceTargets. + */ + public int getInstanceTargetsCount() { + return instanceTargets_.size(); + } + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the element to return. + * @return The instanceTargets at the given index. + */ + public java.lang.String getInstanceTargets(int index) { + return instanceTargets_.get(index); + } + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the value to return. + * @return The bytes of the instanceTargets at the given index. + */ + public com.google.protobuf.ByteString getInstanceTargetsBytes(int index) { + return instanceTargets_.getByteString(index); + } + + public static final int INSTANCE_STATUSES_FIELD_NUMBER = 2; + + private static final class InstanceStatusesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.alloydb.v1.BatchCreateInstanceStatus> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_InstanceStatusesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.alloydb.v1.BatchCreateInstanceStatus> + instanceStatuses_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.alloydb.v1.BatchCreateInstanceStatus> + internalGetInstanceStatuses() { + if (instanceStatuses_ == null) { + return com.google.protobuf.MapField.emptyMapField( + InstanceStatusesDefaultEntryHolder.defaultEntry); + } + return instanceStatuses_; + } + + public int getInstanceStatusesCount() { + return internalGetInstanceStatuses().getMap().size(); + } + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public boolean containsInstanceStatuses(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetInstanceStatuses().getMap().containsKey(key); + } + /** Use {@link #getInstanceStatusesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getInstanceStatuses() { + return getInstanceStatusesMap(); + } + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public java.util.Map + getInstanceStatusesMap() { + return internalGetInstanceStatuses().getMap(); + } + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.alloydb.v1.BatchCreateInstanceStatus + getInstanceStatusesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetInstanceStatuses().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstanceStatus getInstanceStatusesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetInstanceStatuses().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 { + for (int i = 0; i < instanceTargets_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, instanceTargets_.getRaw(i)); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetInstanceStatuses(), InstanceStatusesDefaultEntryHolder.defaultEntry, 2); + 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 < instanceTargets_.size(); i++) { + dataSize += computeStringSizeNoTag(instanceTargets_.getRaw(i)); + } + size += dataSize; + size += 1 * getInstanceTargetsList().size(); + } + for (java.util.Map.Entry< + java.lang.String, com.google.cloud.alloydb.v1.BatchCreateInstanceStatus> + entry : internalGetInstanceStatuses().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.alloydb.v1.BatchCreateInstanceStatus> + instanceStatuses__ = + InstanceStatusesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, instanceStatuses__); + } + 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.alloydb.v1.BatchCreateInstancesMetadata)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata other = + (com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) obj; + + if (!getInstanceTargetsList().equals(other.getInstanceTargetsList())) return false; + if (!internalGetInstanceStatuses().equals(other.internalGetInstanceStatuses())) 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 (getInstanceTargetsCount() > 0) { + hash = (37 * hash) + INSTANCE_TARGETS_FIELD_NUMBER; + hash = (53 * hash) + getInstanceTargetsList().hashCode(); + } + if (!internalGetInstanceStatuses().getMap().isEmpty()) { + hash = (37 * hash) + INSTANCE_STATUSES_FIELD_NUMBER; + hash = (53 * hash) + internalGetInstanceStatuses().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata 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.alloydb.v1.BatchCreateInstancesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata 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.alloydb.v1.BatchCreateInstancesMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata 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.alloydb.v1.BatchCreateInstancesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata 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.alloydb.v1.BatchCreateInstancesMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata 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.alloydb.v1.BatchCreateInstancesMetadata 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; + } + /** + * + * + *
+   * Message for metadata that is specific to BatchCreateInstances API.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.BatchCreateInstancesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.BatchCreateInstancesMetadata) + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetInstanceStatuses(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableInstanceStatuses(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.class, + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instanceTargets_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableInstanceStatuses().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata build() { + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata buildPartial() { + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata result = + new com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata result) { + if (((bitField0_ & 0x00000001) != 0)) { + instanceTargets_ = instanceTargets_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instanceTargets_ = instanceTargets_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceStatuses_ = internalGetInstanceStatuses(); + result.instanceStatuses_.makeImmutable(); + } + } + + @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.alloydb.v1.BatchCreateInstancesMetadata) { + return mergeFrom((com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata other) { + if (other == com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.getDefaultInstance()) + return this; + if (!other.instanceTargets_.isEmpty()) { + if (instanceTargets_.isEmpty()) { + instanceTargets_ = other.instanceTargets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstanceTargetsIsMutable(); + instanceTargets_.addAll(other.instanceTargets_); + } + onChanged(); + } + internalGetMutableInstanceStatuses().mergeFrom(other.internalGetInstanceStatuses()); + bitField0_ |= 0x00000002; + 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(); + ensureInstanceTargetsIsMutable(); + instanceTargets_.add(s); + break; + } // case 10 + case 18: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.alloydb.v1.BatchCreateInstanceStatus> + instanceStatuses__ = + input.readMessage( + InstanceStatusesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableInstanceStatuses() + .getMutableMap() + .put(instanceStatuses__.getKey(), instanceStatuses__.getValue()); + bitField0_ |= 0x00000002; + 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.protobuf.LazyStringList instanceTargets_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureInstanceTargetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instanceTargets_ = new com.google.protobuf.LazyStringArrayList(instanceTargets_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @return A list containing the instanceTargets. + */ + public com.google.protobuf.ProtocolStringList getInstanceTargetsList() { + return instanceTargets_.getUnmodifiableView(); + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @return The count of instanceTargets. + */ + public int getInstanceTargetsCount() { + return instanceTargets_.size(); + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the element to return. + * @return The instanceTargets at the given index. + */ + public java.lang.String getInstanceTargets(int index) { + return instanceTargets_.get(index); + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the value to return. + * @return The bytes of the instanceTargets at the given index. + */ + public com.google.protobuf.ByteString getInstanceTargetsBytes(int index) { + return instanceTargets_.getByteString(index); + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index to set the value at. + * @param value The instanceTargets to set. + * @return This builder for chaining. + */ + public Builder setInstanceTargets(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstanceTargetsIsMutable(); + instanceTargets_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param value The instanceTargets to add. + * @return This builder for chaining. + */ + public Builder addInstanceTargets(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstanceTargetsIsMutable(); + instanceTargets_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param values The instanceTargets to add. + * @return This builder for chaining. + */ + public Builder addAllInstanceTargets(java.lang.Iterable values) { + ensureInstanceTargetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instanceTargets_); + onChanged(); + return this; + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstanceTargets() { + instanceTargets_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param value The bytes of the instanceTargets to add. + * @return This builder for chaining. + */ + public Builder addInstanceTargetsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureInstanceTargetsIsMutable(); + instanceTargets_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.alloydb.v1.BatchCreateInstanceStatus> + instanceStatuses_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.alloydb.v1.BatchCreateInstanceStatus> + internalGetInstanceStatuses() { + if (instanceStatuses_ == null) { + return com.google.protobuf.MapField.emptyMapField( + InstanceStatusesDefaultEntryHolder.defaultEntry); + } + return instanceStatuses_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.alloydb.v1.BatchCreateInstanceStatus> + internalGetMutableInstanceStatuses() { + if (instanceStatuses_ == null) { + instanceStatuses_ = + com.google.protobuf.MapField.newMapField( + InstanceStatusesDefaultEntryHolder.defaultEntry); + } + if (!instanceStatuses_.isMutable()) { + instanceStatuses_ = instanceStatuses_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + return instanceStatuses_; + } + + public int getInstanceStatusesCount() { + return internalGetInstanceStatuses().getMap().size(); + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public boolean containsInstanceStatuses(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetInstanceStatuses().getMap().containsKey(key); + } + /** Use {@link #getInstanceStatusesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getInstanceStatuses() { + return getInstanceStatusesMap(); + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public java.util.Map + getInstanceStatusesMap() { + return internalGetInstanceStatuses().getMap(); + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.alloydb.v1.BatchCreateInstanceStatus + getInstanceStatusesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetInstanceStatuses().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstanceStatus getInstanceStatusesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetInstanceStatuses().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearInstanceStatuses() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableInstanceStatuses().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + public Builder removeInstanceStatuses(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableInstanceStatuses().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableInstanceStatuses() { + bitField0_ |= 0x00000002; + return internalGetMutableInstanceStatuses().getMutableMap(); + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + public Builder putInstanceStatuses( + java.lang.String key, com.google.cloud.alloydb.v1.BatchCreateInstanceStatus value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableInstanceStatuses().getMutableMap().put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + public Builder putAllInstanceStatuses( + java.util.Map + values) { + internalGetMutableInstanceStatuses().getMutableMap().putAll(values); + bitField0_ |= 0x00000002; + 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.alloydb.v1.BatchCreateInstancesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.BatchCreateInstancesMetadata) + private static final com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata(); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateInstancesMetadata 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.alloydb.v1.BatchCreateInstancesMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesMetadataOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesMetadataOrBuilder.java new file mode 100644 index 000000000000..1b7985ce6f9d --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesMetadataOrBuilder.java @@ -0,0 +1,184 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface BatchCreateInstancesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.BatchCreateInstancesMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @return A list containing the instanceTargets. + */ + java.util.List getInstanceTargetsList(); + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @return The count of instanceTargets. + */ + int getInstanceTargetsCount(); + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the element to return. + * @return The instanceTargets at the given index. + */ + java.lang.String getInstanceTargets(int index); + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the value to return. + * @return The bytes of the instanceTargets at the given index. + */ + com.google.protobuf.ByteString getInstanceTargetsBytes(int index); + + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + int getInstanceStatusesCount(); + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + boolean containsInstanceStatuses(java.lang.String key); + /** Use {@link #getInstanceStatusesMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getInstanceStatuses(); + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + java.util.Map + getInstanceStatusesMap(); + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + /* nullable */ + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus getInstanceStatusesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus defaultValue); + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + com.google.cloud.alloydb.v1.BatchCreateInstanceStatus getInstanceStatusesOrThrow( + java.lang.String key); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesRequest.java new file mode 100644 index 000000000000..0d466ea650f6 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesRequest.java @@ -0,0 +1,1186 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for creating a batch of instances under the specified cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.BatchCreateInstancesRequest} + */ +public final class BatchCreateInstancesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.BatchCreateInstancesRequest) + BatchCreateInstancesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchCreateInstancesRequest.newBuilder() to construct. + private BatchCreateInstancesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchCreateInstancesRequest() { + parent_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateInstancesRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.BatchCreateInstancesRequest.class, + com.google.cloud.alloydb.v1.BatchCreateInstancesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource.
+   * 
+ * + * + * 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 parent resource.
+   * 
+ * + * + * 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 REQUESTS_FIELD_NUMBER = 2; + private com.google.cloud.alloydb.v1.CreateInstanceRequests requests_; + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the requests field is set. + */ + @java.lang.Override + public boolean hasRequests() { + return requests_ != null; + } + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The requests. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateInstanceRequests getRequests() { + return requests_ == null + ? com.google.cloud.alloydb.v1.CreateInstanceRequests.getDefaultInstance() + : requests_; + } + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateInstanceRequestsOrBuilder getRequestsOrBuilder() { + return requests_ == null + ? com.google.cloud.alloydb.v1.CreateInstanceRequests.getDefaultInstance() + : requests_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (requests_ != null) { + output.writeMessage(2, getRequests()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, 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(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (requests_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequests()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, 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.alloydb.v1.BatchCreateInstancesRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.BatchCreateInstancesRequest other = + (com.google.cloud.alloydb.v1.BatchCreateInstancesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasRequests() != other.hasRequests()) return false; + if (hasRequests()) { + if (!getRequests().equals(other.getRequests())) return false; + } + 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasRequests()) { + hash = (37 * hash) + REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getRequests().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.alloydb.v1.BatchCreateInstancesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesRequest 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.alloydb.v1.BatchCreateInstancesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesRequest 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.alloydb.v1.BatchCreateInstancesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesRequest 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.alloydb.v1.BatchCreateInstancesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesRequest 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.alloydb.v1.BatchCreateInstancesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesRequest 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.alloydb.v1.BatchCreateInstancesRequest 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; + } + /** + * + * + *
+   * Message for creating a batch of instances under the specified cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.BatchCreateInstancesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.BatchCreateInstancesRequest) + com.google.cloud.alloydb.v1.BatchCreateInstancesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.BatchCreateInstancesRequest.class, + com.google.cloud.alloydb.v1.BatchCreateInstancesRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.BatchCreateInstancesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + requests_ = null; + if (requestsBuilder_ != null) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + } + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstancesRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.BatchCreateInstancesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstancesRequest build() { + com.google.cloud.alloydb.v1.BatchCreateInstancesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstancesRequest buildPartial() { + com.google.cloud.alloydb.v1.BatchCreateInstancesRequest result = + new com.google.cloud.alloydb.v1.BatchCreateInstancesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.BatchCreateInstancesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requests_ = requestsBuilder_ == null ? requests_ : requestsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + } + + @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.alloydb.v1.BatchCreateInstancesRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.BatchCreateInstancesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.BatchCreateInstancesRequest other) { + if (other == com.google.cloud.alloydb.v1.BatchCreateInstancesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasRequests()) { + mergeRequests(other.getRequests()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getRequestsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + 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 parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource.
+     * 
+ * + * + * 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 parent resource.
+     * 
+ * + * + * 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 parent resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1.CreateInstanceRequests requests_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.CreateInstanceRequests, + com.google.cloud.alloydb.v1.CreateInstanceRequests.Builder, + com.google.cloud.alloydb.v1.CreateInstanceRequestsOrBuilder> + requestsBuilder_; + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the requests field is set. + */ + public boolean hasRequests() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The requests. + */ + public com.google.cloud.alloydb.v1.CreateInstanceRequests getRequests() { + if (requestsBuilder_ == null) { + return requests_ == null + ? com.google.cloud.alloydb.v1.CreateInstanceRequests.getDefaultInstance() + : requests_; + } else { + return requestsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRequests(com.google.cloud.alloydb.v1.CreateInstanceRequests value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requests_ = value; + } else { + requestsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRequests( + com.google.cloud.alloydb.v1.CreateInstanceRequests.Builder builderForValue) { + if (requestsBuilder_ == null) { + requests_ = builderForValue.build(); + } else { + requestsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeRequests(com.google.cloud.alloydb.v1.CreateInstanceRequests value) { + if (requestsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && requests_ != null + && requests_ + != com.google.cloud.alloydb.v1.CreateInstanceRequests.getDefaultInstance()) { + getRequestsBuilder().mergeFrom(value); + } else { + requests_ = value; + } + } else { + requestsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRequests() { + bitField0_ = (bitField0_ & ~0x00000002); + requests_ = null; + if (requestsBuilder_ != null) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.CreateInstanceRequests.Builder getRequestsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getRequestsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.CreateInstanceRequestsOrBuilder getRequestsOrBuilder() { + if (requestsBuilder_ != null) { + return requestsBuilder_.getMessageOrBuilder(); + } else { + return requests_ == null + ? com.google.cloud.alloydb.v1.CreateInstanceRequests.getDefaultInstance() + : requests_; + } + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.CreateInstanceRequests, + com.google.cloud.alloydb.v1.CreateInstanceRequests.Builder, + com.google.cloud.alloydb.v1.CreateInstanceRequestsOrBuilder> + getRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.CreateInstanceRequests, + com.google.cloud.alloydb.v1.CreateInstanceRequests.Builder, + com.google.cloud.alloydb.v1.CreateInstanceRequestsOrBuilder>( + getRequests(), getParentForChildren(), isClean()); + requests_ = null; + } + return requestsBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + 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.alloydb.v1.BatchCreateInstancesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.BatchCreateInstancesRequest) + private static final com.google.cloud.alloydb.v1.BatchCreateInstancesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.BatchCreateInstancesRequest(); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateInstancesRequest 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.alloydb.v1.BatchCreateInstancesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesRequestOrBuilder.java new file mode 100644 index 000000000000..b583babb0729 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesRequestOrBuilder.java @@ -0,0 +1,140 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface BatchCreateInstancesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.BatchCreateInstancesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the requests field is set. + */ + boolean hasRequests(); + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The requests. + */ + com.google.cloud.alloydb.v1.CreateInstanceRequests getRequests(); + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1.CreateInstanceRequestsOrBuilder getRequestsOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesResponse.java new file mode 100644 index 000000000000..0a4c8d982eb0 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesResponse.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/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for creating batches of instances in a cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.BatchCreateInstancesResponse} + */ +public final class BatchCreateInstancesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.BatchCreateInstancesResponse) + BatchCreateInstancesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchCreateInstancesResponse.newBuilder() to construct. + private BatchCreateInstancesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchCreateInstancesResponse() { + instances_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateInstancesResponse(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.BatchCreateInstancesResponse.class, + com.google.cloud.alloydb.v1.BatchCreateInstancesResponse.Builder.class); + } + + public static final int INSTANCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List instances_; + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + @java.lang.Override + public java.util.List getInstancesList() { + return instances_; + } + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + @java.lang.Override + public java.util.List + getInstancesOrBuilderList() { + return instances_; + } + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance getInstances(int index) { + return instances_.get(index); + } + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.InstanceOrBuilder getInstancesOrBuilder(int index) { + return instances_.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 < instances_.size(); i++) { + output.writeMessage(1, instances_.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 < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, instances_.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.alloydb.v1.BatchCreateInstancesResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.BatchCreateInstancesResponse other = + (com.google.cloud.alloydb.v1.BatchCreateInstancesResponse) obj; + + if (!getInstancesList().equals(other.getInstancesList())) 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 (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesResponse 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.alloydb.v1.BatchCreateInstancesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesResponse 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.alloydb.v1.BatchCreateInstancesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesResponse 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.alloydb.v1.BatchCreateInstancesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesResponse 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.alloydb.v1.BatchCreateInstancesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesResponse 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.alloydb.v1.BatchCreateInstancesResponse 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; + } + /** + * + * + *
+   * Message for creating batches of instances in a cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.BatchCreateInstancesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.BatchCreateInstancesResponse) + com.google.cloud.alloydb.v1.BatchCreateInstancesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.BatchCreateInstancesResponse.class, + com.google.cloud.alloydb.v1.BatchCreateInstancesResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.BatchCreateInstancesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + } else { + instances_ = null; + instancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_BatchCreateInstancesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstancesResponse getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.BatchCreateInstancesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstancesResponse build() { + com.google.cloud.alloydb.v1.BatchCreateInstancesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstancesResponse buildPartial() { + com.google.cloud.alloydb.v1.BatchCreateInstancesResponse result = + new com.google.cloud.alloydb.v1.BatchCreateInstancesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1.BatchCreateInstancesResponse result) { + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.alloydb.v1.BatchCreateInstancesResponse result) { + int from_bitField0_ = bitField0_; + } + + @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.alloydb.v1.BatchCreateInstancesResponse) { + return mergeFrom((com.google.cloud.alloydb.v1.BatchCreateInstancesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.BatchCreateInstancesResponse other) { + if (other == com.google.cloud.alloydb.v1.BatchCreateInstancesResponse.getDefaultInstance()) + return this; + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + 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.alloydb.v1.Instance m = + input.readMessage( + com.google.cloud.alloydb.v1.Instance.parser(), extensionRegistry); + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(m); + } else { + instancesBuilder_.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 instances_ = + java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instances_ = new java.util.ArrayList(instances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance, + com.google.cloud.alloydb.v1.Instance.Builder, + com.google.cloud.alloydb.v1.InstanceOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public java.util.List getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1.Instance getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder setInstances(int index, com.google.cloud.alloydb.v1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder setInstances( + int index, com.google.cloud.alloydb.v1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.alloydb.v1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder addInstances(int index, com.google.cloud.alloydb.v1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.alloydb.v1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder addInstances( + int index, com.google.cloud.alloydb.v1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder addAllInstances( + java.lang.Iterable values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1.Instance.Builder getInstancesBuilder(int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1.InstanceOrBuilder getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public java.util.List + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1.Instance.Builder addInstancesBuilder() { + return getInstancesFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1.Instance.Builder addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public java.util.List getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance, + com.google.cloud.alloydb.v1.Instance.Builder, + com.google.cloud.alloydb.v1.InstanceOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance, + com.google.cloud.alloydb.v1.Instance.Builder, + com.google.cloud.alloydb.v1.InstanceOrBuilder>( + instances_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + @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.alloydb.v1.BatchCreateInstancesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.BatchCreateInstancesResponse) + private static final com.google.cloud.alloydb.v1.BatchCreateInstancesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.BatchCreateInstancesResponse(); + } + + public static com.google.cloud.alloydb.v1.BatchCreateInstancesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateInstancesResponse 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.alloydb.v1.BatchCreateInstancesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesResponseOrBuilder.java new file mode 100644 index 000000000000..cfcfcf9ad588 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesResponseOrBuilder.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/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface BatchCreateInstancesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.BatchCreateInstancesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + java.util.List getInstancesList(); + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + com.google.cloud.alloydb.v1.Instance getInstances(int index); + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + int getInstancesCount(); + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + java.util.List + getInstancesOrBuilderList(); + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + com.google.cloud.alloydb.v1.InstanceOrBuilder getInstancesOrBuilder(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Cluster.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Cluster.java new file mode 100644 index 000000000000..91f5e215c2f6 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Cluster.java @@ -0,0 +1,8360 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * A cluster is a collection of regional AlloyDB resources. It can include a
+ * primary instance and one or more read pool instances.
+ * All cluster resources share a storage layer, which scales as needed.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Cluster} + */ +public final class Cluster extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.Cluster) + ClusterOrBuilder { + private static final long serialVersionUID = 0L; + // Use Cluster.newBuilder() to construct. + private Cluster(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Cluster() { + name_ = ""; + displayName_ = ""; + uid_ = ""; + state_ = 0; + clusterType_ = 0; + databaseVersion_ = 0; + network_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Cluster(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + case 12: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Cluster.class, + com.google.cloud.alloydb.v1.Cluster.Builder.class); + } + + /** + * + * + *
+   * Cluster State
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.Cluster.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the cluster is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The cluster is active and running.
+     * 
+ * + * READY = 1; + */ + READY(1), + /** + * + * + *
+     * The cluster is stopped. All instances in the cluster are stopped.
+     * Customers can start a stopped cluster at any point and all their
+     * instances will come back to life with same names and IP resources. In
+     * this state, customer pays for storage.
+     * Associated backups could also be present in a stopped cluster.
+     * 
+ * + * STOPPED = 2; + */ + STOPPED(2), + /** + * + * + *
+     * The cluster is empty and has no associated resources.
+     * All instances, associated storage and backups have been deleted.
+     * 
+ * + * EMPTY = 3; + */ + EMPTY(3), + /** + * + * + *
+     * The cluster is being created.
+     * 
+ * + * CREATING = 4; + */ + CREATING(4), + /** + * + * + *
+     * The cluster is being deleted.
+     * 
+ * + * DELETING = 5; + */ + DELETING(5), + /** + * + * + *
+     * The creation of the cluster failed.
+     * 
+ * + * FAILED = 6; + */ + FAILED(6), + /** + * + * + *
+     * The cluster is bootstrapping with data from some other source.
+     * Direct mutations to the cluster (e.g. adding read pool) are not allowed.
+     * 
+ * + * BOOTSTRAPPING = 7; + */ + BOOTSTRAPPING(7), + /** + * + * + *
+     * The cluster is under maintenance. AlloyDB regularly performs maintenance
+     * and upgrades on customer clusters. Updates on the cluster are
+     * not allowed while the cluster is in this state.
+     * 
+ * + * MAINTENANCE = 8; + */ + MAINTENANCE(8), + /** + * + * + *
+     * The cluster is being promoted.
+     * 
+ * + * PROMOTING = 9; + */ + PROMOTING(9), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The state of the cluster is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The cluster is active and running.
+     * 
+ * + * READY = 1; + */ + public static final int READY_VALUE = 1; + /** + * + * + *
+     * The cluster is stopped. All instances in the cluster are stopped.
+     * Customers can start a stopped cluster at any point and all their
+     * instances will come back to life with same names and IP resources. In
+     * this state, customer pays for storage.
+     * Associated backups could also be present in a stopped cluster.
+     * 
+ * + * STOPPED = 2; + */ + public static final int STOPPED_VALUE = 2; + /** + * + * + *
+     * The cluster is empty and has no associated resources.
+     * All instances, associated storage and backups have been deleted.
+     * 
+ * + * EMPTY = 3; + */ + public static final int EMPTY_VALUE = 3; + /** + * + * + *
+     * The cluster is being created.
+     * 
+ * + * CREATING = 4; + */ + public static final int CREATING_VALUE = 4; + /** + * + * + *
+     * The cluster is being deleted.
+     * 
+ * + * DELETING = 5; + */ + public static final int DELETING_VALUE = 5; + /** + * + * + *
+     * The creation of the cluster failed.
+     * 
+ * + * FAILED = 6; + */ + public static final int FAILED_VALUE = 6; + /** + * + * + *
+     * The cluster is bootstrapping with data from some other source.
+     * Direct mutations to the cluster (e.g. adding read pool) are not allowed.
+     * 
+ * + * BOOTSTRAPPING = 7; + */ + public static final int BOOTSTRAPPING_VALUE = 7; + /** + * + * + *
+     * The cluster is under maintenance. AlloyDB regularly performs maintenance
+     * and upgrades on customer clusters. Updates on the cluster are
+     * not allowed while the cluster is in this state.
+     * 
+ * + * MAINTENANCE = 8; + */ + public static final int MAINTENANCE_VALUE = 8; + /** + * + * + *
+     * The cluster is being promoted.
+     * 
+ * + * PROMOTING = 9; + */ + public static final int PROMOTING_VALUE = 9; + + 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 READY; + case 2: + return STOPPED; + case 3: + return EMPTY; + case 4: + return CREATING; + case 5: + return DELETING; + case 6: + return FAILED; + case 7: + return BOOTSTRAPPING; + case 8: + return MAINTENANCE; + case 9: + return PROMOTING; + 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.alloydb.v1.Cluster.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.alloydb.v1.Cluster.State) + } + + /** + * + * + *
+   * Type of Cluster
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.Cluster.ClusterType} + */ + public enum ClusterType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The type of the cluster is unknown.
+     * 
+ * + * CLUSTER_TYPE_UNSPECIFIED = 0; + */ + CLUSTER_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Primary cluster that support read and write operations.
+     * 
+ * + * PRIMARY = 1; + */ + PRIMARY(1), + /** + * + * + *
+     * Secondary cluster that is replicating from another region.
+     * This only supports read.
+     * 
+ * + * SECONDARY = 2; + */ + SECONDARY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The type of the cluster is unknown.
+     * 
+ * + * CLUSTER_TYPE_UNSPECIFIED = 0; + */ + public static final int CLUSTER_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Primary cluster that support read and write operations.
+     * 
+ * + * PRIMARY = 1; + */ + public static final int PRIMARY_VALUE = 1; + /** + * + * + *
+     * Secondary cluster that is replicating from another region.
+     * This only supports read.
+     * 
+ * + * SECONDARY = 2; + */ + public static final int SECONDARY_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 ClusterType 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 ClusterType forNumber(int value) { + switch (value) { + case 0: + return CLUSTER_TYPE_UNSPECIFIED; + case 1: + return PRIMARY; + case 2: + return SECONDARY; + 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 ClusterType findValueByNumber(int number) { + return ClusterType.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.alloydb.v1.Cluster.getDescriptor().getEnumTypes().get(1); + } + + private static final ClusterType[] VALUES = values(); + + public static ClusterType 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 ClusterType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1.Cluster.ClusterType) + } + + public interface SecondaryConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.Cluster.SecondaryConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the primary cluster name with the format:
+     * * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string primary_cluster_name = 1; + * + * @return The primaryClusterName. + */ + java.lang.String getPrimaryClusterName(); + /** + * + * + *
+     * The name of the primary cluster name with the format:
+     * * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string primary_cluster_name = 1; + * + * @return The bytes for primaryClusterName. + */ + com.google.protobuf.ByteString getPrimaryClusterNameBytes(); + } + /** + * + * + *
+   * Configuration information for the secondary cluster. This should be set
+   * if and only if the cluster is of type SECONDARY.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Cluster.SecondaryConfig} + */ + public static final class SecondaryConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.Cluster.SecondaryConfig) + SecondaryConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecondaryConfig.newBuilder() to construct. + private SecondaryConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecondaryConfig() { + primaryClusterName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecondaryConfig(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_SecondaryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_SecondaryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.class, + com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.Builder.class); + } + + public static final int PRIMARY_CLUSTER_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object primaryClusterName_ = ""; + /** + * + * + *
+     * The name of the primary cluster name with the format:
+     * * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string primary_cluster_name = 1; + * + * @return The primaryClusterName. + */ + @java.lang.Override + public java.lang.String getPrimaryClusterName() { + java.lang.Object ref = primaryClusterName_; + 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(); + primaryClusterName_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the primary cluster name with the format:
+     * * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string primary_cluster_name = 1; + * + * @return The bytes for primaryClusterName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrimaryClusterNameBytes() { + java.lang.Object ref = primaryClusterName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryClusterName_ = 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(primaryClusterName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, primaryClusterName_); + } + 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(primaryClusterName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, primaryClusterName_); + } + 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.alloydb.v1.Cluster.SecondaryConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.Cluster.SecondaryConfig other = + (com.google.cloud.alloydb.v1.Cluster.SecondaryConfig) obj; + + if (!getPrimaryClusterName().equals(other.getPrimaryClusterName())) 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) + PRIMARY_CLUSTER_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryClusterName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.Cluster.SecondaryConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Cluster.SecondaryConfig 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.alloydb.v1.Cluster.SecondaryConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Cluster.SecondaryConfig 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.alloydb.v1.Cluster.SecondaryConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Cluster.SecondaryConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.Cluster.SecondaryConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Cluster.SecondaryConfig 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.alloydb.v1.Cluster.SecondaryConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Cluster.SecondaryConfig 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.alloydb.v1.Cluster.SecondaryConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Cluster.SecondaryConfig 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.alloydb.v1.Cluster.SecondaryConfig 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; + } + /** + * + * + *
+     * Configuration information for the secondary cluster. This should be set
+     * if and only if the cluster is of type SECONDARY.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Cluster.SecondaryConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.Cluster.SecondaryConfig) + com.google.cloud.alloydb.v1.Cluster.SecondaryConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_SecondaryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_SecondaryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.class, + com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + primaryClusterName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_SecondaryConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster.SecondaryConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster.SecondaryConfig build() { + com.google.cloud.alloydb.v1.Cluster.SecondaryConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster.SecondaryConfig buildPartial() { + com.google.cloud.alloydb.v1.Cluster.SecondaryConfig result = + new com.google.cloud.alloydb.v1.Cluster.SecondaryConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.Cluster.SecondaryConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.primaryClusterName_ = primaryClusterName_; + } + } + + @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.alloydb.v1.Cluster.SecondaryConfig) { + return mergeFrom((com.google.cloud.alloydb.v1.Cluster.SecondaryConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.Cluster.SecondaryConfig other) { + if (other == com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.getDefaultInstance()) + return this; + if (!other.getPrimaryClusterName().isEmpty()) { + primaryClusterName_ = other.primaryClusterName_; + bitField0_ |= 0x00000001; + 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: + { + primaryClusterName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + 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.lang.Object primaryClusterName_ = ""; + /** + * + * + *
+       * The name of the primary cluster name with the format:
+       * * projects/{project}/locations/{region}/clusters/{cluster_id}
+       * 
+ * + * string primary_cluster_name = 1; + * + * @return The primaryClusterName. + */ + public java.lang.String getPrimaryClusterName() { + java.lang.Object ref = primaryClusterName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryClusterName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the primary cluster name with the format:
+       * * projects/{project}/locations/{region}/clusters/{cluster_id}
+       * 
+ * + * string primary_cluster_name = 1; + * + * @return The bytes for primaryClusterName. + */ + public com.google.protobuf.ByteString getPrimaryClusterNameBytes() { + java.lang.Object ref = primaryClusterName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryClusterName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the primary cluster name with the format:
+       * * projects/{project}/locations/{region}/clusters/{cluster_id}
+       * 
+ * + * string primary_cluster_name = 1; + * + * @param value The primaryClusterName to set. + * @return This builder for chaining. + */ + public Builder setPrimaryClusterName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + primaryClusterName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the primary cluster name with the format:
+       * * projects/{project}/locations/{region}/clusters/{cluster_id}
+       * 
+ * + * string primary_cluster_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearPrimaryClusterName() { + primaryClusterName_ = getDefaultInstance().getPrimaryClusterName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the primary cluster name with the format:
+       * * projects/{project}/locations/{region}/clusters/{cluster_id}
+       * 
+ * + * string primary_cluster_name = 1; + * + * @param value The bytes for primaryClusterName to set. + * @return This builder for chaining. + */ + public Builder setPrimaryClusterNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + primaryClusterName_ = value; + 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.alloydb.v1.Cluster.SecondaryConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.Cluster.SecondaryConfig) + private static final com.google.cloud.alloydb.v1.Cluster.SecondaryConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.Cluster.SecondaryConfig(); + } + + public static com.google.cloud.alloydb.v1.Cluster.SecondaryConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecondaryConfig 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.alloydb.v1.Cluster.SecondaryConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PrimaryConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.Cluster.PrimaryConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the secondaryClusterNames. + */ + java.util.List getSecondaryClusterNamesList(); + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of secondaryClusterNames. + */ + int getSecondaryClusterNamesCount(); + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The secondaryClusterNames at the given index. + */ + java.lang.String getSecondaryClusterNames(int index); + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the secondaryClusterNames at the given index. + */ + com.google.protobuf.ByteString getSecondaryClusterNamesBytes(int index); + } + /** + * + * + *
+   * Configuration for the primary cluster. It has the list of clusters that are
+   * replicating from this cluster. This should be set if and only if the
+   * cluster is of type PRIMARY.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Cluster.PrimaryConfig} + */ + public static final class PrimaryConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.Cluster.PrimaryConfig) + PrimaryConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use PrimaryConfig.newBuilder() to construct. + private PrimaryConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PrimaryConfig() { + secondaryClusterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PrimaryConfig(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_PrimaryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_PrimaryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.class, + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.Builder.class); + } + + public static final int SECONDARY_CLUSTER_NAMES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList secondaryClusterNames_; + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the secondaryClusterNames. + */ + public com.google.protobuf.ProtocolStringList getSecondaryClusterNamesList() { + return secondaryClusterNames_; + } + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of secondaryClusterNames. + */ + public int getSecondaryClusterNamesCount() { + return secondaryClusterNames_.size(); + } + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The secondaryClusterNames at the given index. + */ + public java.lang.String getSecondaryClusterNames(int index) { + return secondaryClusterNames_.get(index); + } + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the secondaryClusterNames at the given index. + */ + public com.google.protobuf.ByteString getSecondaryClusterNamesBytes(int index) { + return secondaryClusterNames_.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 < secondaryClusterNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 1, secondaryClusterNames_.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 < secondaryClusterNames_.size(); i++) { + dataSize += computeStringSizeNoTag(secondaryClusterNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getSecondaryClusterNamesList().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.alloydb.v1.Cluster.PrimaryConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig other = + (com.google.cloud.alloydb.v1.Cluster.PrimaryConfig) obj; + + if (!getSecondaryClusterNamesList().equals(other.getSecondaryClusterNamesList())) + 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 (getSecondaryClusterNamesCount() > 0) { + hash = (37 * hash) + SECONDARY_CLUSTER_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getSecondaryClusterNamesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.Cluster.PrimaryConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Cluster.PrimaryConfig 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.alloydb.v1.Cluster.PrimaryConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Cluster.PrimaryConfig 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.alloydb.v1.Cluster.PrimaryConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Cluster.PrimaryConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.Cluster.PrimaryConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Cluster.PrimaryConfig 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.alloydb.v1.Cluster.PrimaryConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Cluster.PrimaryConfig 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.alloydb.v1.Cluster.PrimaryConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Cluster.PrimaryConfig 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.alloydb.v1.Cluster.PrimaryConfig 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; + } + /** + * + * + *
+     * Configuration for the primary cluster. It has the list of clusters that are
+     * replicating from this cluster. This should be set if and only if the
+     * cluster is of type PRIMARY.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Cluster.PrimaryConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.Cluster.PrimaryConfig) + com.google.cloud.alloydb.v1.Cluster.PrimaryConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_PrimaryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_PrimaryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.class, + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + secondaryClusterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_PrimaryConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster.PrimaryConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster.PrimaryConfig build() { + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster.PrimaryConfig buildPartial() { + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig result = + new com.google.cloud.alloydb.v1.Cluster.PrimaryConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig result) { + if (((bitField0_ & 0x00000001) != 0)) { + secondaryClusterNames_ = secondaryClusterNames_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.secondaryClusterNames_ = secondaryClusterNames_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.Cluster.PrimaryConfig result) { + int from_bitField0_ = bitField0_; + } + + @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.alloydb.v1.Cluster.PrimaryConfig) { + return mergeFrom((com.google.cloud.alloydb.v1.Cluster.PrimaryConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.Cluster.PrimaryConfig other) { + if (other == com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.getDefaultInstance()) + return this; + if (!other.secondaryClusterNames_.isEmpty()) { + if (secondaryClusterNames_.isEmpty()) { + secondaryClusterNames_ = other.secondaryClusterNames_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSecondaryClusterNamesIsMutable(); + secondaryClusterNames_.addAll(other.secondaryClusterNames_); + } + 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(); + ensureSecondaryClusterNamesIsMutable(); + secondaryClusterNames_.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 secondaryClusterNames_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureSecondaryClusterNamesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + secondaryClusterNames_ = + new com.google.protobuf.LazyStringArrayList(secondaryClusterNames_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the secondaryClusterNames. + */ + public com.google.protobuf.ProtocolStringList getSecondaryClusterNamesList() { + return secondaryClusterNames_.getUnmodifiableView(); + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of secondaryClusterNames. + */ + public int getSecondaryClusterNamesCount() { + return secondaryClusterNames_.size(); + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The secondaryClusterNames at the given index. + */ + public java.lang.String getSecondaryClusterNames(int index) { + return secondaryClusterNames_.get(index); + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the secondaryClusterNames at the given index. + */ + public com.google.protobuf.ByteString getSecondaryClusterNamesBytes(int index) { + return secondaryClusterNames_.getByteString(index); + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The secondaryClusterNames to set. + * @return This builder for chaining. + */ + public Builder setSecondaryClusterNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecondaryClusterNamesIsMutable(); + secondaryClusterNames_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The secondaryClusterNames to add. + * @return This builder for chaining. + */ + public Builder addSecondaryClusterNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecondaryClusterNamesIsMutable(); + secondaryClusterNames_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The secondaryClusterNames to add. + * @return This builder for chaining. + */ + public Builder addAllSecondaryClusterNames(java.lang.Iterable values) { + ensureSecondaryClusterNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, secondaryClusterNames_); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSecondaryClusterNames() { + secondaryClusterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes of the secondaryClusterNames to add. + * @return This builder for chaining. + */ + public Builder addSecondaryClusterNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSecondaryClusterNamesIsMutable(); + secondaryClusterNames_.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.alloydb.v1.Cluster.PrimaryConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.Cluster.PrimaryConfig) + private static final com.google.cloud.alloydb.v1.Cluster.PrimaryConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.Cluster.PrimaryConfig(); + } + + public static com.google.cloud.alloydb.v1.Cluster.PrimaryConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PrimaryConfig 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.alloydb.v1.Cluster.PrimaryConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BACKUP_SOURCE(15), + MIGRATION_SOURCE(16), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 15: + return BACKUP_SOURCE; + case 16: + return MIGRATION_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int BACKUP_SOURCE_FIELD_NUMBER = 15; + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupSource field is set. + */ + @java.lang.Override + public boolean hasBackupSource() { + return sourceCase_ == 15; + } + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BackupSource getBackupSource() { + if (sourceCase_ == 15) { + return (com.google.cloud.alloydb.v1.BackupSource) source_; + } + return com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance(); + } + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BackupSourceOrBuilder getBackupSourceOrBuilder() { + if (sourceCase_ == 15) { + return (com.google.cloud.alloydb.v1.BackupSource) source_; + } + return com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance(); + } + + public static final int MIGRATION_SOURCE_FIELD_NUMBER = 16; + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the migrationSource field is set. + */ + @java.lang.Override + public boolean hasMigrationSource() { + return sourceCase_ == 16; + } + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The migrationSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.MigrationSource getMigrationSource() { + if (sourceCase_ == 16) { + return (com.google.cloud.alloydb.v1.MigrationSource) source_; + } + return com.google.cloud.alloydb.v1.MigrationSource.getDefaultInstance(); + } + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.MigrationSourceOrBuilder getMigrationSourceOrBuilder() { + if (sourceCase_ == 16) { + return (com.google.cloud.alloydb.v1.MigrationSource) source_; + } + return com.google.cloud.alloydb.v1.MigrationSource.getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The name of the cluster resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * where the cluster ID segment should satisfy the regex expression
+   * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+   * The prefix of the cluster resource name is the name of the parent resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The name of the cluster resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * where the cluster ID segment should satisfy the regex expression
+   * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+   * The prefix of the cluster resource name is the name of the parent resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * User-settable and human-readable display name for the Cluster.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * User-settable and human-readable display name for the Cluster.
+   * 
+ * + * 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 UID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + 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(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int DELETE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + + public static final int LABELS_FIELD_NUMBER = 7; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATE_FIELD_NUMBER = 8; + private int state_ = 0; + /** + * + * + *
+   * Output only. The current serving state of the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current serving state of the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster.State getState() { + com.google.cloud.alloydb.v1.Cluster.State result = + com.google.cloud.alloydb.v1.Cluster.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1.Cluster.State.UNRECOGNIZED : result; + } + + public static final int CLUSTER_TYPE_FIELD_NUMBER = 24; + private int clusterType_ = 0; + /** + * + * + *
+   * Output only. The type of the cluster. This is an output-only field and it's
+   * populated at the Cluster creation time or the Cluster promotion
+   * time. The cluster type is determined by which RPC was used to create
+   * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+   * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for clusterType. + */ + @java.lang.Override + public int getClusterTypeValue() { + return clusterType_; + } + /** + * + * + *
+   * Output only. The type of the cluster. This is an output-only field and it's
+   * populated at the Cluster creation time or the Cluster promotion
+   * time. The cluster type is determined by which RPC was used to create
+   * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+   * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The clusterType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster.ClusterType getClusterType() { + com.google.cloud.alloydb.v1.Cluster.ClusterType result = + com.google.cloud.alloydb.v1.Cluster.ClusterType.forNumber(clusterType_); + return result == null ? com.google.cloud.alloydb.v1.Cluster.ClusterType.UNRECOGNIZED : result; + } + + public static final int DATABASE_VERSION_FIELD_NUMBER = 9; + private int databaseVersion_ = 0; + /** + * + * + *
+   * Output only. The database engine major version. This is an output-only
+   * field and it's populated at the Cluster creation time. This field cannot be
+   * changed after cluster creation.
+   * 
+ * + * + * .google.cloud.alloydb.v1.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + /** + * + * + *
+   * Output only. The database engine major version. This is an output-only
+   * field and it's populated at the Cluster creation time. This field cannot be
+   * changed after cluster creation.
+   * 
+ * + * + * .google.cloud.alloydb.v1.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.DatabaseVersion getDatabaseVersion() { + com.google.cloud.alloydb.v1.DatabaseVersion result = + com.google.cloud.alloydb.v1.DatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.alloydb.v1.DatabaseVersion.UNRECOGNIZED : result; + } + + public static final int NETWORK_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object network_ = ""; + /** + * + * + *
+   * Required. The resource link for the VPC network in which cluster resources
+   * are created and from which they are accessible via Private IP. The network
+   * must belong to the same project as the cluster. It is specified in the
+   * form: "projects/{project_number}/global/networks/{network_id}". This is
+   * required to create a cluster. It can be updated, but it cannot be removed.
+   * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + 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(); + network_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource link for the VPC network in which cluster resources
+   * are created and from which they are accessible via Private IP. The network
+   * must belong to the same project as the cluster. It is specified in the
+   * form: "projects/{project_number}/global/networks/{network_id}". This is
+   * required to create a cluster. It can be updated, but it cannot be removed.
+   * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 11; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 11; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 12; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int RECONCILING_FIELD_NUMBER = 13; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+   * Set to true if the current state of Cluster does not match the user's
+   * intended state, and the service is actively updating the resource to
+   * reconcile them. This can happen due to user-triggered updates or
+   * system actions like failover or maintenance.
+   * 
+ * + * bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int INITIAL_USER_FIELD_NUMBER = 14; + private com.google.cloud.alloydb.v1.UserPassword initialUser_; + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the initialUser field is set. + */ + @java.lang.Override + public boolean hasInitialUser() { + return initialUser_ != null; + } + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The initialUser. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.UserPassword getInitialUser() { + return initialUser_ == null + ? com.google.cloud.alloydb.v1.UserPassword.getDefaultInstance() + : initialUser_; + } + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.UserPasswordOrBuilder getInitialUserOrBuilder() { + return initialUser_ == null + ? com.google.cloud.alloydb.v1.UserPassword.getDefaultInstance() + : initialUser_; + } + + public static final int AUTOMATED_BACKUP_POLICY_FIELD_NUMBER = 17; + private com.google.cloud.alloydb.v1.AutomatedBackupPolicy automatedBackupPolicy_; + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return Whether the automatedBackupPolicy field is set. + */ + @java.lang.Override + public boolean hasAutomatedBackupPolicy() { + return automatedBackupPolicy_ != null; + } + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return The automatedBackupPolicy. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy getAutomatedBackupPolicy() { + return automatedBackupPolicy_ == null + ? com.google.cloud.alloydb.v1.AutomatedBackupPolicy.getDefaultInstance() + : automatedBackupPolicy_; + } + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.AutomatedBackupPolicyOrBuilder + getAutomatedBackupPolicyOrBuilder() { + return automatedBackupPolicy_ == null + ? com.google.cloud.alloydb.v1.AutomatedBackupPolicy.getDefaultInstance() + : automatedBackupPolicy_; + } + + public static final int SSL_CONFIG_FIELD_NUMBER = 18; + private com.google.cloud.alloydb.v1.SslConfig sslConfig_; + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * + * @return Whether the sslConfig field is set. + */ + @java.lang.Override + public boolean hasSslConfig() { + return sslConfig_ != null; + } + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * + * @return The sslConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SslConfig getSslConfig() { + return sslConfig_ == null + ? com.google.cloud.alloydb.v1.SslConfig.getDefaultInstance() + : sslConfig_; + } + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SslConfigOrBuilder getSslConfigOrBuilder() { + return sslConfig_ == null + ? com.google.cloud.alloydb.v1.SslConfig.getDefaultInstance() + : sslConfig_; + } + + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 19; + private com.google.cloud.alloydb.v1.EncryptionConfig encryptionConfig_; + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return encryptionConfig_ != null; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + public static final int ENCRYPTION_INFO_FIELD_NUMBER = 20; + private com.google.cloud.alloydb.v1.EncryptionInfo encryptionInfo_; + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + @java.lang.Override + public boolean hasEncryptionInfo() { + return encryptionInfo_ != null; + } + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionInfo getEncryptionInfo() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + + public static final int SECONDARY_CONFIG_FIELD_NUMBER = 22; + private com.google.cloud.alloydb.v1.Cluster.SecondaryConfig secondaryConfig_; + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + * + * @return Whether the secondaryConfig field is set. + */ + @java.lang.Override + public boolean hasSecondaryConfig() { + return secondaryConfig_ != null; + } + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + * + * @return The secondaryConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster.SecondaryConfig getSecondaryConfig() { + return secondaryConfig_ == null + ? com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.getDefaultInstance() + : secondaryConfig_; + } + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster.SecondaryConfigOrBuilder + getSecondaryConfigOrBuilder() { + return secondaryConfig_ == null + ? com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.getDefaultInstance() + : secondaryConfig_; + } + + public static final int PRIMARY_CONFIG_FIELD_NUMBER = 23; + private com.google.cloud.alloydb.v1.Cluster.PrimaryConfig primaryConfig_; + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the primaryConfig field is set. + */ + @java.lang.Override + public boolean hasPrimaryConfig() { + return primaryConfig_ != null; + } + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The primaryConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster.PrimaryConfig getPrimaryConfig() { + return primaryConfig_ == null + ? com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.getDefaultInstance() + : primaryConfig_; + } + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster.PrimaryConfigOrBuilder getPrimaryConfigOrBuilder() { + return primaryConfig_ == null + ? com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.getDefaultInstance() + : primaryConfig_; + } + + 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(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uid_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (deleteTime_ != null) { + output.writeMessage(6, getDeleteTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 7); + if (state_ != com.google.cloud.alloydb.v1.Cluster.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, state_); + } + if (databaseVersion_ + != com.google.cloud.alloydb.v1.DatabaseVersion.DATABASE_VERSION_UNSPECIFIED.getNumber()) { + output.writeEnum(9, databaseVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, etag_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 12); + if (reconciling_ != false) { + output.writeBool(13, reconciling_); + } + if (initialUser_ != null) { + output.writeMessage(14, getInitialUser()); + } + if (sourceCase_ == 15) { + output.writeMessage(15, (com.google.cloud.alloydb.v1.BackupSource) source_); + } + if (sourceCase_ == 16) { + output.writeMessage(16, (com.google.cloud.alloydb.v1.MigrationSource) source_); + } + if (automatedBackupPolicy_ != null) { + output.writeMessage(17, getAutomatedBackupPolicy()); + } + if (sslConfig_ != null) { + output.writeMessage(18, getSslConfig()); + } + if (encryptionConfig_ != null) { + output.writeMessage(19, getEncryptionConfig()); + } + if (encryptionInfo_ != null) { + output.writeMessage(20, getEncryptionInfo()); + } + if (secondaryConfig_ != null) { + output.writeMessage(22, getSecondaryConfig()); + } + if (primaryConfig_ != null) { + output.writeMessage(23, getPrimaryConfig()); + } + if (clusterType_ + != com.google.cloud.alloydb.v1.Cluster.ClusterType.CLUSTER_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(24, clusterType_); + } + 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(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uid_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDeleteTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, labels__); + } + if (state_ != com.google.cloud.alloydb.v1.Cluster.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, state_); + } + if (databaseVersion_ + != com.google.cloud.alloydb.v1.DatabaseVersion.DATABASE_VERSION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, databaseVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, etag_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, annotations__); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, reconciling_); + } + if (initialUser_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getInitialUser()); + } + if (sourceCase_ == 15) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 15, (com.google.cloud.alloydb.v1.BackupSource) source_); + } + if (sourceCase_ == 16) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 16, (com.google.cloud.alloydb.v1.MigrationSource) source_); + } + if (automatedBackupPolicy_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(17, getAutomatedBackupPolicy()); + } + if (sslConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getSslConfig()); + } + if (encryptionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getEncryptionConfig()); + } + if (encryptionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getEncryptionInfo()); + } + if (secondaryConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, getSecondaryConfig()); + } + if (primaryConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, getPrimaryConfig()); + } + if (clusterType_ + != com.google.cloud.alloydb.v1.Cluster.ClusterType.CLUSTER_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(24, clusterType_); + } + 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.alloydb.v1.Cluster)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.Cluster other = (com.google.cloud.alloydb.v1.Cluster) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (state_ != other.state_) return false; + if (clusterType_ != other.clusterType_) return false; + if (databaseVersion_ != other.databaseVersion_) return false; + if (!getNetwork().equals(other.getNetwork())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (getReconciling() != other.getReconciling()) return false; + if (hasInitialUser() != other.hasInitialUser()) return false; + if (hasInitialUser()) { + if (!getInitialUser().equals(other.getInitialUser())) return false; + } + if (hasAutomatedBackupPolicy() != other.hasAutomatedBackupPolicy()) return false; + if (hasAutomatedBackupPolicy()) { + if (!getAutomatedBackupPolicy().equals(other.getAutomatedBackupPolicy())) return false; + } + if (hasSslConfig() != other.hasSslConfig()) return false; + if (hasSslConfig()) { + if (!getSslConfig().equals(other.getSslConfig())) return false; + } + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) return false; + } + if (hasEncryptionInfo() != other.hasEncryptionInfo()) return false; + if (hasEncryptionInfo()) { + if (!getEncryptionInfo().equals(other.getEncryptionInfo())) return false; + } + if (hasSecondaryConfig() != other.hasSecondaryConfig()) return false; + if (hasSecondaryConfig()) { + if (!getSecondaryConfig().equals(other.getSecondaryConfig())) return false; + } + if (hasPrimaryConfig() != other.hasPrimaryConfig()) return false; + if (hasPrimaryConfig()) { + if (!getPrimaryConfig().equals(other.getPrimaryConfig())) return false; + } + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 15: + if (!getBackupSource().equals(other.getBackupSource())) return false; + break; + case 16: + if (!getMigrationSource().equals(other.getMigrationSource())) 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) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + CLUSTER_TYPE_FIELD_NUMBER; + hash = (53 * hash) + clusterType_; + hash = (37 * hash) + DATABASE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + databaseVersion_; + hash = (37 * hash) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + if (hasInitialUser()) { + hash = (37 * hash) + INITIAL_USER_FIELD_NUMBER; + hash = (53 * hash) + getInitialUser().hashCode(); + } + if (hasAutomatedBackupPolicy()) { + hash = (37 * hash) + AUTOMATED_BACKUP_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getAutomatedBackupPolicy().hashCode(); + } + if (hasSslConfig()) { + hash = (37 * hash) + SSL_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSslConfig().hashCode(); + } + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } + if (hasEncryptionInfo()) { + hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionInfo().hashCode(); + } + if (hasSecondaryConfig()) { + hash = (37 * hash) + SECONDARY_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSecondaryConfig().hashCode(); + } + if (hasPrimaryConfig()) { + hash = (37 * hash) + PRIMARY_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryConfig().hashCode(); + } + switch (sourceCase_) { + case 15: + hash = (37 * hash) + BACKUP_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getBackupSource().hashCode(); + break; + case 16: + hash = (37 * hash) + MIGRATION_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getMigrationSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.Cluster parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Cluster 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.alloydb.v1.Cluster parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Cluster 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.alloydb.v1.Cluster parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Cluster parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.Cluster parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Cluster 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.alloydb.v1.Cluster parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Cluster 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.alloydb.v1.Cluster parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Cluster 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.alloydb.v1.Cluster 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 cluster is a collection of regional AlloyDB resources. It can include a
+   * primary instance and one or more read pool instances.
+   * All cluster resources share a storage layer, which scales as needed.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Cluster} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.Cluster) + com.google.cloud.alloydb.v1.ClusterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + case 12: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableLabels(); + case 12: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Cluster.class, + com.google.cloud.alloydb.v1.Cluster.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.Cluster.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (backupSourceBuilder_ != null) { + backupSourceBuilder_.clear(); + } + if (migrationSourceBuilder_ != null) { + migrationSourceBuilder_.clear(); + } + name_ = ""; + displayName_ = ""; + uid_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + state_ = 0; + clusterType_ = 0; + databaseVersion_ = 0; + network_ = ""; + etag_ = ""; + internalGetMutableAnnotations().clear(); + reconciling_ = false; + initialUser_ = null; + if (initialUserBuilder_ != null) { + initialUserBuilder_.dispose(); + initialUserBuilder_ = null; + } + automatedBackupPolicy_ = null; + if (automatedBackupPolicyBuilder_ != null) { + automatedBackupPolicyBuilder_.dispose(); + automatedBackupPolicyBuilder_ = null; + } + sslConfig_ = null; + if (sslConfigBuilder_ != null) { + sslConfigBuilder_.dispose(); + sslConfigBuilder_ = null; + } + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + secondaryConfig_ = null; + if (secondaryConfigBuilder_ != null) { + secondaryConfigBuilder_.dispose(); + secondaryConfigBuilder_ = null; + } + primaryConfig_ = null; + if (primaryConfigBuilder_ != null) { + primaryConfigBuilder_.dispose(); + primaryConfigBuilder_ = null; + } + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Cluster_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.Cluster.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster build() { + com.google.cloud.alloydb.v1.Cluster result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster buildPartial() { + com.google.cloud.alloydb.v1.Cluster result = new com.google.cloud.alloydb.v1.Cluster(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.Cluster result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.clusterType_ = clusterType_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.databaseVersion_ = databaseVersion_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.network_ = network_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.initialUser_ = + initialUserBuilder_ == null ? initialUser_ : initialUserBuilder_.build(); + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.automatedBackupPolicy_ = + automatedBackupPolicyBuilder_ == null + ? automatedBackupPolicy_ + : automatedBackupPolicyBuilder_.build(); + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.sslConfig_ = sslConfigBuilder_ == null ? sslConfig_ : sslConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.encryptionConfig_ = + encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.encryptionInfo_ = + encryptionInfoBuilder_ == null ? encryptionInfo_ : encryptionInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.secondaryConfig_ = + secondaryConfigBuilder_ == null ? secondaryConfig_ : secondaryConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.primaryConfig_ = + primaryConfigBuilder_ == null ? primaryConfig_ : primaryConfigBuilder_.build(); + } + } + + private void buildPartialOneofs(com.google.cloud.alloydb.v1.Cluster result) { + result.sourceCase_ = sourceCase_; + result.source_ = this.source_; + if (sourceCase_ == 15 && backupSourceBuilder_ != null) { + result.source_ = backupSourceBuilder_.build(); + } + if (sourceCase_ == 16 && migrationSourceBuilder_ != null) { + result.source_ = migrationSourceBuilder_.build(); + } + } + + @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.alloydb.v1.Cluster) { + return mergeFrom((com.google.cloud.alloydb.v1.Cluster) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.Cluster other) { + if (other == com.google.cloud.alloydb.v1.Cluster.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000100; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.clusterType_ != 0) { + setClusterTypeValue(other.getClusterTypeValue()); + } + if (other.databaseVersion_ != 0) { + setDatabaseVersionValue(other.getDatabaseVersionValue()); + } + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + bitField0_ |= 0x00001000; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00002000; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00004000; + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + if (other.hasInitialUser()) { + mergeInitialUser(other.getInitialUser()); + } + if (other.hasAutomatedBackupPolicy()) { + mergeAutomatedBackupPolicy(other.getAutomatedBackupPolicy()); + } + if (other.hasSslConfig()) { + mergeSslConfig(other.getSslConfig()); + } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } + if (other.hasEncryptionInfo()) { + mergeEncryptionInfo(other.getEncryptionInfo()); + } + if (other.hasSecondaryConfig()) { + mergeSecondaryConfig(other.getSecondaryConfig()); + } + if (other.hasPrimaryConfig()) { + mergePrimaryConfig(other.getPrimaryConfig()); + } + switch (other.getSourceCase()) { + case BACKUP_SOURCE: + { + mergeBackupSource(other.getBackupSource()); + break; + } + case MIGRATION_SOURCE: + { + mergeMigrationSource(other.getMigrationSource()); + break; + } + case SOURCE_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(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 26: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 26 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 42 + case 50: + { + input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 50 + case 58: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000100; + break; + } // case 58 + case 64: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 64 + case 72: + { + databaseVersion_ = input.readEnum(); + bitField0_ |= 0x00000800; + break; + } // case 72 + case 82: + { + network_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 82 + case 90: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00002000; + break; + } // case 90 + case 98: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00004000; + break; + } // case 98 + case 104: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00008000; + break; + } // case 104 + case 114: + { + input.readMessage(getInitialUserFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 114 + case 122: + { + input.readMessage(getBackupSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 15; + break; + } // case 122 + case 130: + { + input.readMessage(getMigrationSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 16; + break; + } // case 130 + case 138: + { + input.readMessage( + getAutomatedBackupPolicyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 138 + case 146: + { + input.readMessage(getSslConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 146 + case 154: + { + input.readMessage( + getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 154 + case 162: + { + input.readMessage(getEncryptionInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00100000; + break; + } // case 162 + case 178: + { + input.readMessage(getSecondaryConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00200000; + break; + } // case 178 + case 186: + { + input.readMessage(getPrimaryConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00400000; + break; + } // case 186 + case 192: + { + clusterType_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 192 + 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 sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.BackupSource, + com.google.cloud.alloydb.v1.BackupSource.Builder, + com.google.cloud.alloydb.v1.BackupSourceOrBuilder> + backupSourceBuilder_; + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupSource field is set. + */ + @java.lang.Override + public boolean hasBackupSource() { + return sourceCase_ == 15; + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BackupSource getBackupSource() { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 15) { + return (com.google.cloud.alloydb.v1.BackupSource) source_; + } + return com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance(); + } else { + if (sourceCase_ == 15) { + return backupSourceBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBackupSource(com.google.cloud.alloydb.v1.BackupSource value) { + if (backupSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + backupSourceBuilder_.setMessage(value); + } + sourceCase_ = 15; + return this; + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBackupSource( + com.google.cloud.alloydb.v1.BackupSource.Builder builderForValue) { + if (backupSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + backupSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 15; + return this; + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeBackupSource(com.google.cloud.alloydb.v1.BackupSource value) { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 15 + && source_ != com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance()) { + source_ = + com.google.cloud.alloydb.v1.BackupSource.newBuilder( + (com.google.cloud.alloydb.v1.BackupSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 15) { + backupSourceBuilder_.mergeFrom(value); + } else { + backupSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 15; + return this; + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearBackupSource() { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 15) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 15) { + sourceCase_ = 0; + source_ = null; + } + backupSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.BackupSource.Builder getBackupSourceBuilder() { + return getBackupSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BackupSourceOrBuilder getBackupSourceOrBuilder() { + if ((sourceCase_ == 15) && (backupSourceBuilder_ != null)) { + return backupSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 15) { + return (com.google.cloud.alloydb.v1.BackupSource) source_; + } + return com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.BackupSource, + com.google.cloud.alloydb.v1.BackupSource.Builder, + com.google.cloud.alloydb.v1.BackupSourceOrBuilder> + getBackupSourceFieldBuilder() { + if (backupSourceBuilder_ == null) { + if (!(sourceCase_ == 15)) { + source_ = com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance(); + } + backupSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.BackupSource, + com.google.cloud.alloydb.v1.BackupSource.Builder, + com.google.cloud.alloydb.v1.BackupSourceOrBuilder>( + (com.google.cloud.alloydb.v1.BackupSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 15; + onChanged(); + return backupSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.MigrationSource, + com.google.cloud.alloydb.v1.MigrationSource.Builder, + com.google.cloud.alloydb.v1.MigrationSourceOrBuilder> + migrationSourceBuilder_; + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the migrationSource field is set. + */ + @java.lang.Override + public boolean hasMigrationSource() { + return sourceCase_ == 16; + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The migrationSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.MigrationSource getMigrationSource() { + if (migrationSourceBuilder_ == null) { + if (sourceCase_ == 16) { + return (com.google.cloud.alloydb.v1.MigrationSource) source_; + } + return com.google.cloud.alloydb.v1.MigrationSource.getDefaultInstance(); + } else { + if (sourceCase_ == 16) { + return migrationSourceBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1.MigrationSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMigrationSource(com.google.cloud.alloydb.v1.MigrationSource value) { + if (migrationSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + migrationSourceBuilder_.setMessage(value); + } + sourceCase_ = 16; + return this; + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMigrationSource( + com.google.cloud.alloydb.v1.MigrationSource.Builder builderForValue) { + if (migrationSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + migrationSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 16; + return this; + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeMigrationSource(com.google.cloud.alloydb.v1.MigrationSource value) { + if (migrationSourceBuilder_ == null) { + if (sourceCase_ == 16 + && source_ != com.google.cloud.alloydb.v1.MigrationSource.getDefaultInstance()) { + source_ = + com.google.cloud.alloydb.v1.MigrationSource.newBuilder( + (com.google.cloud.alloydb.v1.MigrationSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 16) { + migrationSourceBuilder_.mergeFrom(value); + } else { + migrationSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 16; + return this; + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMigrationSource() { + if (migrationSourceBuilder_ == null) { + if (sourceCase_ == 16) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 16) { + sourceCase_ = 0; + source_ = null; + } + migrationSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.MigrationSource.Builder getMigrationSourceBuilder() { + return getMigrationSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.MigrationSourceOrBuilder getMigrationSourceOrBuilder() { + if ((sourceCase_ == 16) && (migrationSourceBuilder_ != null)) { + return migrationSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 16) { + return (com.google.cloud.alloydb.v1.MigrationSource) source_; + } + return com.google.cloud.alloydb.v1.MigrationSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.MigrationSource, + com.google.cloud.alloydb.v1.MigrationSource.Builder, + com.google.cloud.alloydb.v1.MigrationSourceOrBuilder> + getMigrationSourceFieldBuilder() { + if (migrationSourceBuilder_ == null) { + if (!(sourceCase_ == 16)) { + source_ = com.google.cloud.alloydb.v1.MigrationSource.getDefaultInstance(); + } + migrationSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.MigrationSource, + com.google.cloud.alloydb.v1.MigrationSource.Builder, + com.google.cloud.alloydb.v1.MigrationSourceOrBuilder>( + (com.google.cloud.alloydb.v1.MigrationSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 16; + onChanged(); + return migrationSourceBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The name of the cluster resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * where the cluster ID segment should satisfy the regex expression
+     * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+     * The prefix of the cluster resource name is the name of the parent resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the cluster resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * where the cluster ID segment should satisfy the regex expression
+     * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+     * The prefix of the cluster resource name is the name of the parent resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the cluster resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * where the cluster ID segment should satisfy the regex expression
+     * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+     * The prefix of the cluster resource name is the name of the parent resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the cluster resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * where the cluster ID segment should satisfy the regex expression
+     * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+     * The prefix of the cluster resource name is the name of the parent resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the cluster resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * where the cluster ID segment should satisfy the regex expression
+     * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+     * The prefix of the cluster resource name is the name of the parent resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * User-settable and human-readable display name for the Cluster.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Cluster.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Cluster.
+     * 
+ * + * 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Cluster.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Cluster.
+     * 
+ * + * 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + 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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000020); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000040); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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 deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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; + } else { + deleteTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); + } else { + deleteTime_ = value; + } + } else { + deleteTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + bitField0_ = (bitField0_ & ~0x00000080); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_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> + 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_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000100; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000100); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000100; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000100; + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000100; + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current serving state of the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current serving state of the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current serving state of the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster.State getState() { + com.google.cloud.alloydb.v1.Cluster.State result = + com.google.cloud.alloydb.v1.Cluster.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1.Cluster.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current serving state of the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.alloydb.v1.Cluster.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current serving state of the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000200); + state_ = 0; + onChanged(); + return this; + } + + private int clusterType_ = 0; + /** + * + * + *
+     * Output only. The type of the cluster. This is an output-only field and it's
+     * populated at the Cluster creation time or the Cluster promotion
+     * time. The cluster type is determined by which RPC was used to create
+     * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for clusterType. + */ + @java.lang.Override + public int getClusterTypeValue() { + return clusterType_; + } + /** + * + * + *
+     * Output only. The type of the cluster. This is an output-only field and it's
+     * populated at the Cluster creation time or the Cluster promotion
+     * time. The cluster type is determined by which RPC was used to create
+     * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for clusterType to set. + * @return This builder for chaining. + */ + public Builder setClusterTypeValue(int value) { + clusterType_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of the cluster. This is an output-only field and it's
+     * populated at the Cluster creation time or the Cluster promotion
+     * time. The cluster type is determined by which RPC was used to create
+     * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The clusterType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster.ClusterType getClusterType() { + com.google.cloud.alloydb.v1.Cluster.ClusterType result = + com.google.cloud.alloydb.v1.Cluster.ClusterType.forNumber(clusterType_); + return result == null ? com.google.cloud.alloydb.v1.Cluster.ClusterType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The type of the cluster. This is an output-only field and it's
+     * populated at the Cluster creation time or the Cluster promotion
+     * time. The cluster type is determined by which RPC was used to create
+     * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The clusterType to set. + * @return This builder for chaining. + */ + public Builder setClusterType(com.google.cloud.alloydb.v1.Cluster.ClusterType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + clusterType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of the cluster. This is an output-only field and it's
+     * populated at the Cluster creation time or the Cluster promotion
+     * time. The cluster type is determined by which RPC was used to create
+     * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearClusterType() { + bitField0_ = (bitField0_ & ~0x00000400); + clusterType_ = 0; + onChanged(); + return this; + } + + private int databaseVersion_ = 0; + /** + * + * + *
+     * Output only. The database engine major version. This is an output-only
+     * field and it's populated at the Cluster creation time. This field cannot be
+     * changed after cluster creation.
+     * 
+ * + * + * .google.cloud.alloydb.v1.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + /** + * + * + *
+     * Output only. The database engine major version. This is an output-only
+     * field and it's populated at the Cluster creation time. This field cannot be
+     * changed after cluster creation.
+     * 
+ * + * + * .google.cloud.alloydb.v1.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersionValue(int value) { + databaseVersion_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The database engine major version. This is an output-only
+     * field and it's populated at the Cluster creation time. This field cannot be
+     * changed after cluster creation.
+     * 
+ * + * + * .google.cloud.alloydb.v1.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.DatabaseVersion getDatabaseVersion() { + com.google.cloud.alloydb.v1.DatabaseVersion result = + com.google.cloud.alloydb.v1.DatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.alloydb.v1.DatabaseVersion.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The database engine major version. This is an output-only
+     * field and it's populated at the Cluster creation time. This field cannot be
+     * changed after cluster creation.
+     * 
+ * + * + * .google.cloud.alloydb.v1.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersion(com.google.cloud.alloydb.v1.DatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000800; + databaseVersion_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The database engine major version. This is an output-only
+     * field and it's populated at the Cluster creation time. This field cannot be
+     * changed after cluster creation.
+     * 
+ * + * + * .google.cloud.alloydb.v1.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDatabaseVersion() { + bitField0_ = (bitField0_ & ~0x00000800); + databaseVersion_ = 0; + onChanged(); + return this; + } + + private java.lang.Object network_ = ""; + /** + * + * + *
+     * Required. The resource link for the VPC network in which cluster resources
+     * are created and from which they are accessible via Private IP. The network
+     * must belong to the same project as the cluster. It is specified in the
+     * form: "projects/{project_number}/global/networks/{network_id}". This is
+     * required to create a cluster. It can be updated, but it cannot be removed.
+     * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource link for the VPC network in which cluster resources
+     * are created and from which they are accessible via Private IP. The network
+     * must belong to the same project as the cluster. It is specified in the
+     * form: "projects/{project_number}/global/networks/{network_id}". This is
+     * required to create a cluster. It can be updated, but it cannot be removed.
+     * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource link for the VPC network in which cluster resources
+     * are created and from which they are accessible via Private IP. The network
+     * must belong to the same project as the cluster. It is specified in the
+     * form: "projects/{project_number}/global/networks/{network_id}". This is
+     * required to create a cluster. It can be updated, but it cannot be removed.
+     * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + network_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource link for the VPC network in which cluster resources
+     * are created and from which they are accessible via Private IP. The network
+     * must belong to the same project as the cluster. It is specified in the
+     * form: "projects/{project_number}/global/networks/{network_id}". This is
+     * required to create a cluster. It can be updated, but it cannot be removed.
+     * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource link for the VPC network in which cluster resources
+     * are created and from which they are accessible via Private IP. The network
+     * must belong to the same project as the cluster. It is specified in the
+     * form: "projects/{project_number}/global/networks/{network_id}". This is
+     * required to create a cluster. It can be updated, but it cannot be removed.
+     * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + network_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 11; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 11; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 11; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 11; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 11; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00004000; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00004000); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00004000; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00004000; + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00004000; + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Cluster does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Cluster does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Cluster does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00008000); + reconciling_ = false; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1.UserPassword initialUser_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.UserPassword, + com.google.cloud.alloydb.v1.UserPassword.Builder, + com.google.cloud.alloydb.v1.UserPasswordOrBuilder> + initialUserBuilder_; + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the initialUser field is set. + */ + public boolean hasInitialUser() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The initialUser. + */ + public com.google.cloud.alloydb.v1.UserPassword getInitialUser() { + if (initialUserBuilder_ == null) { + return initialUser_ == null + ? com.google.cloud.alloydb.v1.UserPassword.getDefaultInstance() + : initialUser_; + } else { + return initialUserBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setInitialUser(com.google.cloud.alloydb.v1.UserPassword value) { + if (initialUserBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + initialUser_ = value; + } else { + initialUserBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setInitialUser( + com.google.cloud.alloydb.v1.UserPassword.Builder builderForValue) { + if (initialUserBuilder_ == null) { + initialUser_ = builderForValue.build(); + } else { + initialUserBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder mergeInitialUser(com.google.cloud.alloydb.v1.UserPassword value) { + if (initialUserBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && initialUser_ != null + && initialUser_ != com.google.cloud.alloydb.v1.UserPassword.getDefaultInstance()) { + getInitialUserBuilder().mergeFrom(value); + } else { + initialUser_ = value; + } + } else { + initialUserBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder clearInitialUser() { + bitField0_ = (bitField0_ & ~0x00010000); + initialUser_ = null; + if (initialUserBuilder_ != null) { + initialUserBuilder_.dispose(); + initialUserBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.UserPassword.Builder getInitialUserBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return getInitialUserFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.UserPasswordOrBuilder getInitialUserOrBuilder() { + if (initialUserBuilder_ != null) { + return initialUserBuilder_.getMessageOrBuilder(); + } else { + return initialUser_ == null + ? com.google.cloud.alloydb.v1.UserPassword.getDefaultInstance() + : initialUser_; + } + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.UserPassword, + com.google.cloud.alloydb.v1.UserPassword.Builder, + com.google.cloud.alloydb.v1.UserPasswordOrBuilder> + getInitialUserFieldBuilder() { + if (initialUserBuilder_ == null) { + initialUserBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.UserPassword, + com.google.cloud.alloydb.v1.UserPassword.Builder, + com.google.cloud.alloydb.v1.UserPasswordOrBuilder>( + getInitialUser(), getParentForChildren(), isClean()); + initialUser_ = null; + } + return initialUserBuilder_; + } + + private com.google.cloud.alloydb.v1.AutomatedBackupPolicy automatedBackupPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.AutomatedBackupPolicy, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.Builder, + com.google.cloud.alloydb.v1.AutomatedBackupPolicyOrBuilder> + automatedBackupPolicyBuilder_; + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return Whether the automatedBackupPolicy field is set. + */ + public boolean hasAutomatedBackupPolicy() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return The automatedBackupPolicy. + */ + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy getAutomatedBackupPolicy() { + if (automatedBackupPolicyBuilder_ == null) { + return automatedBackupPolicy_ == null + ? com.google.cloud.alloydb.v1.AutomatedBackupPolicy.getDefaultInstance() + : automatedBackupPolicy_; + } else { + return automatedBackupPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + */ + public Builder setAutomatedBackupPolicy( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy value) { + if (automatedBackupPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + automatedBackupPolicy_ = value; + } else { + automatedBackupPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + */ + public Builder setAutomatedBackupPolicy( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.Builder builderForValue) { + if (automatedBackupPolicyBuilder_ == null) { + automatedBackupPolicy_ = builderForValue.build(); + } else { + automatedBackupPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + */ + public Builder mergeAutomatedBackupPolicy( + com.google.cloud.alloydb.v1.AutomatedBackupPolicy value) { + if (automatedBackupPolicyBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) + && automatedBackupPolicy_ != null + && automatedBackupPolicy_ + != com.google.cloud.alloydb.v1.AutomatedBackupPolicy.getDefaultInstance()) { + getAutomatedBackupPolicyBuilder().mergeFrom(value); + } else { + automatedBackupPolicy_ = value; + } + } else { + automatedBackupPolicyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + */ + public Builder clearAutomatedBackupPolicy() { + bitField0_ = (bitField0_ & ~0x00020000); + automatedBackupPolicy_ = null; + if (automatedBackupPolicyBuilder_ != null) { + automatedBackupPolicyBuilder_.dispose(); + automatedBackupPolicyBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + */ + public com.google.cloud.alloydb.v1.AutomatedBackupPolicy.Builder + getAutomatedBackupPolicyBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return getAutomatedBackupPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + */ + public com.google.cloud.alloydb.v1.AutomatedBackupPolicyOrBuilder + getAutomatedBackupPolicyOrBuilder() { + if (automatedBackupPolicyBuilder_ != null) { + return automatedBackupPolicyBuilder_.getMessageOrBuilder(); + } else { + return automatedBackupPolicy_ == null + ? com.google.cloud.alloydb.v1.AutomatedBackupPolicy.getDefaultInstance() + : automatedBackupPolicy_; + } + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.AutomatedBackupPolicy, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.Builder, + com.google.cloud.alloydb.v1.AutomatedBackupPolicyOrBuilder> + getAutomatedBackupPolicyFieldBuilder() { + if (automatedBackupPolicyBuilder_ == null) { + automatedBackupPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.AutomatedBackupPolicy, + com.google.cloud.alloydb.v1.AutomatedBackupPolicy.Builder, + com.google.cloud.alloydb.v1.AutomatedBackupPolicyOrBuilder>( + getAutomatedBackupPolicy(), getParentForChildren(), isClean()); + automatedBackupPolicy_ = null; + } + return automatedBackupPolicyBuilder_; + } + + private com.google.cloud.alloydb.v1.SslConfig sslConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.SslConfig, + com.google.cloud.alloydb.v1.SslConfig.Builder, + com.google.cloud.alloydb.v1.SslConfigOrBuilder> + sslConfigBuilder_; + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * + * @return Whether the sslConfig field is set. + */ + public boolean hasSslConfig() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * + * @return The sslConfig. + */ + public com.google.cloud.alloydb.v1.SslConfig getSslConfig() { + if (sslConfigBuilder_ == null) { + return sslConfig_ == null + ? com.google.cloud.alloydb.v1.SslConfig.getDefaultInstance() + : sslConfig_; + } else { + return sslConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + */ + public Builder setSslConfig(com.google.cloud.alloydb.v1.SslConfig value) { + if (sslConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sslConfig_ = value; + } else { + sslConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + */ + public Builder setSslConfig(com.google.cloud.alloydb.v1.SslConfig.Builder builderForValue) { + if (sslConfigBuilder_ == null) { + sslConfig_ = builderForValue.build(); + } else { + sslConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + */ + public Builder mergeSslConfig(com.google.cloud.alloydb.v1.SslConfig value) { + if (sslConfigBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) + && sslConfig_ != null + && sslConfig_ != com.google.cloud.alloydb.v1.SslConfig.getDefaultInstance()) { + getSslConfigBuilder().mergeFrom(value); + } else { + sslConfig_ = value; + } + } else { + sslConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + */ + public Builder clearSslConfig() { + bitField0_ = (bitField0_ & ~0x00040000); + sslConfig_ = null; + if (sslConfigBuilder_ != null) { + sslConfigBuilder_.dispose(); + sslConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + */ + public com.google.cloud.alloydb.v1.SslConfig.Builder getSslConfigBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return getSslConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + */ + public com.google.cloud.alloydb.v1.SslConfigOrBuilder getSslConfigOrBuilder() { + if (sslConfigBuilder_ != null) { + return sslConfigBuilder_.getMessageOrBuilder(); + } else { + return sslConfig_ == null + ? com.google.cloud.alloydb.v1.SslConfig.getDefaultInstance() + : sslConfig_; + } + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.SslConfig, + com.google.cloud.alloydb.v1.SslConfig.Builder, + com.google.cloud.alloydb.v1.SslConfigOrBuilder> + getSslConfigFieldBuilder() { + if (sslConfigBuilder_ == null) { + sslConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.SslConfig, + com.google.cloud.alloydb.v1.SslConfig.Builder, + com.google.cloud.alloydb.v1.SslConfigOrBuilder>( + getSslConfig(), getParentForChildren(), isClean()); + sslConfig_ = null; + } + return sslConfigBuilder_; + } + + private com.google.cloud.alloydb.v1.EncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionConfig, + com.google.cloud.alloydb.v1.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder> + encryptionConfigBuilder_; + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00080000) != 0); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + public com.google.cloud.alloydb.v1.EncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig(com.google.cloud.alloydb.v1.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + } else { + encryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig( + com.google.cloud.alloydb.v1.EncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); + } else { + encryptionConfig_ = value; + } + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEncryptionConfig() { + bitField0_ = (bitField0_ & ~0x00080000); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1.EncryptionConfig.Builder getEncryptionConfigBuilder() { + bitField0_ |= 0x00080000; + onChanged(); + return getEncryptionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionConfig, + com.google.cloud.alloydb.v1.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder> + getEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionConfig, + com.google.cloud.alloydb.v1.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + + private com.google.cloud.alloydb.v1.EncryptionInfo encryptionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionInfo, + com.google.cloud.alloydb.v1.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder> + encryptionInfoBuilder_; + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + public boolean hasEncryptionInfo() { + return ((bitField0_ & 0x00100000) != 0); + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + public com.google.cloud.alloydb.v1.EncryptionInfo getEncryptionInfo() { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } else { + return encryptionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo(com.google.cloud.alloydb.v1.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionInfo_ = value; + } else { + encryptionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo( + com.google.cloud.alloydb.v1.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = builderForValue.build(); + } else { + encryptionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEncryptionInfo(com.google.cloud.alloydb.v1.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (((bitField0_ & 0x00100000) != 0) + && encryptionInfo_ != null + && encryptionInfo_ != com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance()) { + getEncryptionInfoBuilder().mergeFrom(value); + } else { + encryptionInfo_ = value; + } + } else { + encryptionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEncryptionInfo() { + bitField0_ = (bitField0_ & ~0x00100000); + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.EncryptionInfo.Builder getEncryptionInfoBuilder() { + bitField0_ |= 0x00100000; + onChanged(); + return getEncryptionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + if (encryptionInfoBuilder_ != null) { + return encryptionInfoBuilder_.getMessageOrBuilder(); + } else { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionInfo, + com.google.cloud.alloydb.v1.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder> + getEncryptionInfoFieldBuilder() { + if (encryptionInfoBuilder_ == null) { + encryptionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionInfo, + com.google.cloud.alloydb.v1.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder>( + getEncryptionInfo(), getParentForChildren(), isClean()); + encryptionInfo_ = null; + } + return encryptionInfoBuilder_; + } + + private com.google.cloud.alloydb.v1.Cluster.SecondaryConfig secondaryConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster.SecondaryConfig, + com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.Builder, + com.google.cloud.alloydb.v1.Cluster.SecondaryConfigOrBuilder> + secondaryConfigBuilder_; + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + * + * @return Whether the secondaryConfig field is set. + */ + public boolean hasSecondaryConfig() { + return ((bitField0_ & 0x00200000) != 0); + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + * + * @return The secondaryConfig. + */ + public com.google.cloud.alloydb.v1.Cluster.SecondaryConfig getSecondaryConfig() { + if (secondaryConfigBuilder_ == null) { + return secondaryConfig_ == null + ? com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.getDefaultInstance() + : secondaryConfig_; + } else { + return secondaryConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + */ + public Builder setSecondaryConfig(com.google.cloud.alloydb.v1.Cluster.SecondaryConfig value) { + if (secondaryConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + secondaryConfig_ = value; + } else { + secondaryConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + */ + public Builder setSecondaryConfig( + com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.Builder builderForValue) { + if (secondaryConfigBuilder_ == null) { + secondaryConfig_ = builderForValue.build(); + } else { + secondaryConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + */ + public Builder mergeSecondaryConfig(com.google.cloud.alloydb.v1.Cluster.SecondaryConfig value) { + if (secondaryConfigBuilder_ == null) { + if (((bitField0_ & 0x00200000) != 0) + && secondaryConfig_ != null + && secondaryConfig_ + != com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.getDefaultInstance()) { + getSecondaryConfigBuilder().mergeFrom(value); + } else { + secondaryConfig_ = value; + } + } else { + secondaryConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + */ + public Builder clearSecondaryConfig() { + bitField0_ = (bitField0_ & ~0x00200000); + secondaryConfig_ = null; + if (secondaryConfigBuilder_ != null) { + secondaryConfigBuilder_.dispose(); + secondaryConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + */ + public com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.Builder getSecondaryConfigBuilder() { + bitField0_ |= 0x00200000; + onChanged(); + return getSecondaryConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + */ + public com.google.cloud.alloydb.v1.Cluster.SecondaryConfigOrBuilder + getSecondaryConfigOrBuilder() { + if (secondaryConfigBuilder_ != null) { + return secondaryConfigBuilder_.getMessageOrBuilder(); + } else { + return secondaryConfig_ == null + ? com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.getDefaultInstance() + : secondaryConfig_; + } + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster.SecondaryConfig, + com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.Builder, + com.google.cloud.alloydb.v1.Cluster.SecondaryConfigOrBuilder> + getSecondaryConfigFieldBuilder() { + if (secondaryConfigBuilder_ == null) { + secondaryConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster.SecondaryConfig, + com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.Builder, + com.google.cloud.alloydb.v1.Cluster.SecondaryConfigOrBuilder>( + getSecondaryConfig(), getParentForChildren(), isClean()); + secondaryConfig_ = null; + } + return secondaryConfigBuilder_; + } + + private com.google.cloud.alloydb.v1.Cluster.PrimaryConfig primaryConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig, + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.Builder, + com.google.cloud.alloydb.v1.Cluster.PrimaryConfigOrBuilder> + primaryConfigBuilder_; + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the primaryConfig field is set. + */ + public boolean hasPrimaryConfig() { + return ((bitField0_ & 0x00400000) != 0); + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The primaryConfig. + */ + public com.google.cloud.alloydb.v1.Cluster.PrimaryConfig getPrimaryConfig() { + if (primaryConfigBuilder_ == null) { + return primaryConfig_ == null + ? com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.getDefaultInstance() + : primaryConfig_; + } else { + return primaryConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPrimaryConfig(com.google.cloud.alloydb.v1.Cluster.PrimaryConfig value) { + if (primaryConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + primaryConfig_ = value; + } else { + primaryConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPrimaryConfig( + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.Builder builderForValue) { + if (primaryConfigBuilder_ == null) { + primaryConfig_ = builderForValue.build(); + } else { + primaryConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergePrimaryConfig(com.google.cloud.alloydb.v1.Cluster.PrimaryConfig value) { + if (primaryConfigBuilder_ == null) { + if (((bitField0_ & 0x00400000) != 0) + && primaryConfig_ != null + && primaryConfig_ + != com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.getDefaultInstance()) { + getPrimaryConfigBuilder().mergeFrom(value); + } else { + primaryConfig_ = value; + } + } else { + primaryConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPrimaryConfig() { + bitField0_ = (bitField0_ & ~0x00400000); + primaryConfig_ = null; + if (primaryConfigBuilder_ != null) { + primaryConfigBuilder_.dispose(); + primaryConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.Builder getPrimaryConfigBuilder() { + bitField0_ |= 0x00400000; + onChanged(); + return getPrimaryConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.Cluster.PrimaryConfigOrBuilder getPrimaryConfigOrBuilder() { + if (primaryConfigBuilder_ != null) { + return primaryConfigBuilder_.getMessageOrBuilder(); + } else { + return primaryConfig_ == null + ? com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.getDefaultInstance() + : primaryConfig_; + } + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig, + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.Builder, + com.google.cloud.alloydb.v1.Cluster.PrimaryConfigOrBuilder> + getPrimaryConfigFieldBuilder() { + if (primaryConfigBuilder_ == null) { + primaryConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig, + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.Builder, + com.google.cloud.alloydb.v1.Cluster.PrimaryConfigOrBuilder>( + getPrimaryConfig(), getParentForChildren(), isClean()); + primaryConfig_ = null; + } + return primaryConfigBuilder_; + } + + @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.alloydb.v1.Cluster) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.Cluster) + private static final com.google.cloud.alloydb.v1.Cluster DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.Cluster(); + } + + public static com.google.cloud.alloydb.v1.Cluster getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Cluster 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.alloydb.v1.Cluster getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ClusterName.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ClusterName.java new file mode 100644 index 000000000000..48b3054b3ba2 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ClusterName.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.alloydb.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 ClusterName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CLUSTER = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/clusters/{cluster}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String cluster; + + @Deprecated + protected ClusterName() { + project = null; + location = null; + cluster = null; + } + + private ClusterName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + cluster = Preconditions.checkNotNull(builder.getCluster()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ClusterName of(String project, String location, String cluster) { + return newBuilder().setProject(project).setLocation(location).setCluster(cluster).build(); + } + + public static String format(String project, String location, String cluster) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCluster(cluster) + .build() + .toString(); + } + + public static ClusterName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CLUSTER.validatedMatch( + formattedString, "ClusterName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("cluster")); + } + + 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 (ClusterName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CLUSTER.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 (cluster != null) { + fieldMapBuilder.put("cluster", cluster); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CLUSTER.instantiate( + "project", project, "location", location, "cluster", cluster); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ClusterName that = ((ClusterName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.cluster, that.cluster); + } + 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(cluster); + return h; + } + + /** Builder for projects/{project}/locations/{location}/clusters/{cluster}. */ + public static class Builder { + private String project; + private String location; + private String cluster; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCluster(String cluster) { + this.cluster = cluster; + return this; + } + + private Builder(ClusterName clusterName) { + this.project = clusterName.project; + this.location = clusterName.location; + this.cluster = clusterName.cluster; + } + + public ClusterName build() { + return new ClusterName(this); + } + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ClusterOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ClusterOrBuilder.java new file mode 100644 index 000000000000..8251179d0e86 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ClusterOrBuilder.java @@ -0,0 +1,911 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public interface ClusterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.Cluster) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupSource field is set. + */ + boolean hasBackupSource(); + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupSource. + */ + com.google.cloud.alloydb.v1.BackupSource getBackupSource(); + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1.BackupSourceOrBuilder getBackupSourceOrBuilder(); + + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the migrationSource field is set. + */ + boolean hasMigrationSource(); + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The migrationSource. + */ + com.google.cloud.alloydb.v1.MigrationSource getMigrationSource(); + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1.MigrationSourceOrBuilder getMigrationSourceOrBuilder(); + + /** + * + * + *
+   * Output only. The name of the cluster resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * where the cluster ID segment should satisfy the regex expression
+   * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+   * The prefix of the cluster resource name is the name of the parent resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The name of the cluster resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * where the cluster ID segment should satisfy the regex expression
+   * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+   * The prefix of the cluster resource name is the name of the parent resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * User-settable and human-readable display name for the Cluster.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * User-settable and human-readable display name for the Cluster.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The current serving state of the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current serving state of the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.alloydb.v1.Cluster.State getState(); + + /** + * + * + *
+   * Output only. The type of the cluster. This is an output-only field and it's
+   * populated at the Cluster creation time or the Cluster promotion
+   * time. The cluster type is determined by which RPC was used to create
+   * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+   * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for clusterType. + */ + int getClusterTypeValue(); + /** + * + * + *
+   * Output only. The type of the cluster. This is an output-only field and it's
+   * populated at the Cluster creation time or the Cluster promotion
+   * time. The cluster type is determined by which RPC was used to create
+   * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+   * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The clusterType. + */ + com.google.cloud.alloydb.v1.Cluster.ClusterType getClusterType(); + + /** + * + * + *
+   * Output only. The database engine major version. This is an output-only
+   * field and it's populated at the Cluster creation time. This field cannot be
+   * changed after cluster creation.
+   * 
+ * + * + * .google.cloud.alloydb.v1.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + int getDatabaseVersionValue(); + /** + * + * + *
+   * Output only. The database engine major version. This is an output-only
+   * field and it's populated at the Cluster creation time. This field cannot be
+   * changed after cluster creation.
+   * 
+ * + * + * .google.cloud.alloydb.v1.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + com.google.cloud.alloydb.v1.DatabaseVersion getDatabaseVersion(); + + /** + * + * + *
+   * Required. The resource link for the VPC network in which cluster resources
+   * are created and from which they are accessible via Private IP. The network
+   * must belong to the same project as the cluster. It is specified in the
+   * form: "projects/{project_number}/global/networks/{network_id}". This is
+   * required to create a cluster. It can be updated, but it cannot be removed.
+   * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * Required. The resource link for the VPC network in which cluster resources
+   * are created and from which they are accessible via Private IP. The network
+   * must belong to the same project as the cluster. It is specified in the
+   * form: "projects/{project_number}/global/networks/{network_id}". This is
+   * required to create a cluster. It can be updated, but it cannot be removed.
+   * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 11; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 11; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+   * Set to true if the current state of Cluster does not match the user's
+   * intended state, and the service is actively updating the resource to
+   * reconcile them. This can happen due to user-triggered updates or
+   * system actions like failover or maintenance.
+   * 
+ * + * bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the initialUser field is set. + */ + boolean hasInitialUser(); + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The initialUser. + */ + com.google.cloud.alloydb.v1.UserPassword getInitialUser(); + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1.UserPasswordOrBuilder getInitialUserOrBuilder(); + + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return Whether the automatedBackupPolicy field is set. + */ + boolean hasAutomatedBackupPolicy(); + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return The automatedBackupPolicy. + */ + com.google.cloud.alloydb.v1.AutomatedBackupPolicy getAutomatedBackupPolicy(); + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + */ + com.google.cloud.alloydb.v1.AutomatedBackupPolicyOrBuilder getAutomatedBackupPolicyOrBuilder(); + + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * + * @return Whether the sslConfig field is set. + */ + boolean hasSslConfig(); + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * + * @return The sslConfig. + */ + com.google.cloud.alloydb.v1.SslConfig getSslConfig(); + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + */ + com.google.cloud.alloydb.v1.SslConfigOrBuilder getSslConfigOrBuilder(); + + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + com.google.cloud.alloydb.v1.EncryptionConfig getEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); + + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + boolean hasEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + com.google.cloud.alloydb.v1.EncryptionInfo getEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(); + + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + * + * @return Whether the secondaryConfig field is set. + */ + boolean hasSecondaryConfig(); + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + * + * @return The secondaryConfig. + */ + com.google.cloud.alloydb.v1.Cluster.SecondaryConfig getSecondaryConfig(); + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + */ + com.google.cloud.alloydb.v1.Cluster.SecondaryConfigOrBuilder getSecondaryConfigOrBuilder(); + + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the primaryConfig field is set. + */ + boolean hasPrimaryConfig(); + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The primaryConfig. + */ + com.google.cloud.alloydb.v1.Cluster.PrimaryConfig getPrimaryConfig(); + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1.Cluster.PrimaryConfigOrBuilder getPrimaryConfigOrBuilder(); + + public com.google.cloud.alloydb.v1.Cluster.SourceCase getSourceCase(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateBackupRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateBackupRequest.java new file mode 100644 index 000000000000..28a788b724b2 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateBackupRequest.java @@ -0,0 +1,1442 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for creating a Backup
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.CreateBackupRequest} + */ +public final class CreateBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.CreateBackupRequest) + CreateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateBackupRequest.newBuilder() to construct. + private CreateBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateBackupRequest() { + parent_ = ""; + backupId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateBackupRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.CreateBackupRequest.class, + com.google.cloud.alloydb.v1.CreateBackupRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * 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. Value for parent.
+   * 
+ * + * + * 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 BACKUP_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + @java.lang.Override + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + 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(); + backupId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1.Backup backup_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return backup_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Backup getBackup() { + return backup_ == null ? com.google.cloud.alloydb.v1.Backup.getDefaultInstance() : backup_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BackupOrBuilder getBackupOrBuilder() { + return backup_ == null ? com.google.cloud.alloydb.v1.Backup.getDefaultInstance() : backup_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, backupId_); + } + if (backup_ != null) { + output.writeMessage(3, getBackup()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, backupId_); + } + if (backup_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBackup()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + 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.alloydb.v1.CreateBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.CreateBackupRequest other = + (com.google.cloud.alloydb.v1.CreateBackupRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getBackupId().equals(other.getBackupId())) return false; + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + BACKUP_ID_FIELD_NUMBER; + hash = (53 * hash) + getBackupId().hashCode(); + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.CreateBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateBackupRequest 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.alloydb.v1.CreateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateBackupRequest 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.alloydb.v1.CreateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateBackupRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateBackupRequest 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.alloydb.v1.CreateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateBackupRequest 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.alloydb.v1.CreateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateBackupRequest 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.alloydb.v1.CreateBackupRequest 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; + } + /** + * + * + *
+   * Message for creating a Backup
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.CreateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.CreateBackupRequest) + com.google.cloud.alloydb.v1.CreateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.CreateBackupRequest.class, + com.google.cloud.alloydb.v1.CreateBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.CreateBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + backupId_ = ""; + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateBackupRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.CreateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateBackupRequest build() { + com.google.cloud.alloydb.v1.CreateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateBackupRequest buildPartial() { + com.google.cloud.alloydb.v1.CreateBackupRequest result = + new com.google.cloud.alloydb.v1.CreateBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.CreateBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backupId_ = backupId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.backup_ = backupBuilder_ == null ? backup_ : backupBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1.CreateBackupRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.CreateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.CreateBackupRequest other) { + if (other == com.google.cloud.alloydb.v1.CreateBackupRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getBackupId().isEmpty()) { + backupId_ = other.backupId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + backupId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getBackupFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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. Value for parent.
+     * 
+ * + * + * 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. Value for parent.
+     * 
+ * + * + * 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. Value for parent.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object backupId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearBackupId() { + backupId_ = getDefaultInstance().getBackupId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1.Backup backup_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Backup, + com.google.cloud.alloydb.v1.Backup.Builder, + com.google.cloud.alloydb.v1.BackupOrBuilder> + backupBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.cloud.alloydb.v1.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null ? com.google.cloud.alloydb.v1.Backup.getDefaultInstance() : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.alloydb.v1.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + } else { + backupBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.alloydb.v1.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.cloud.alloydb.v1.Backup value) { + if (backupBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && backup_ != null + && backup_ != com.google.cloud.alloydb.v1.Backup.getDefaultInstance()) { + getBackupBuilder().mergeFrom(value); + } else { + backup_ = value; + } + } else { + backupBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + bitField0_ = (bitField0_ & ~0x00000004); + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.Backup.Builder getBackupBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getBackupFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null ? com.google.cloud.alloydb.v1.Backup.getDefaultInstance() : backup_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Backup, + com.google.cloud.alloydb.v1.Backup.Builder, + com.google.cloud.alloydb.v1.BackupOrBuilder> + getBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Backup, + com.google.cloud.alloydb.v1.Backup.Builder, + com.google.cloud.alloydb.v1.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = 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.alloydb.v1.CreateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.CreateBackupRequest) + private static final com.google.cloud.alloydb.v1.CreateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.CreateBackupRequest(); + } + + public static com.google.cloud.alloydb.v1.CreateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBackupRequest 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.alloydb.v1.CreateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateBackupRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateBackupRequestOrBuilder.java new file mode 100644 index 000000000000..e4083ebfa71b --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateBackupRequestOrBuilder.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/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface CreateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.CreateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + java.lang.String getBackupId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + com.google.protobuf.ByteString getBackupIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.cloud.alloydb.v1.Backup getBackup(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1.BackupOrBuilder getBackupOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateClusterRequest.java new file mode 100644 index 000000000000..f8797c984a7d --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateClusterRequest.java @@ -0,0 +1,1457 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for creating a Cluster
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.CreateClusterRequest} + */ +public final class CreateClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.CreateClusterRequest) + CreateClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateClusterRequest.newBuilder() to construct. + private CreateClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateClusterRequest() { + parent_ = ""; + clusterId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateClusterRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.CreateClusterRequest.class, + com.google.cloud.alloydb.v1.CreateClusterRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 CLUSTER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + @java.lang.Override + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + 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(); + clusterId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1.Cluster cluster_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + @java.lang.Override + public boolean hasCluster() { + return cluster_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster getCluster() { + return cluster_ == null ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() : cluster_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clusterId_); + } + if (cluster_ != null) { + output.writeMessage(3, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clusterId_); + } + if (cluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + 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.alloydb.v1.CreateClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.CreateClusterRequest other = + (com.google.cloud.alloydb.v1.CreateClusterRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getClusterId().equals(other.getClusterId())) return false; + if (hasCluster() != other.hasCluster()) return false; + if (hasCluster()) { + if (!getCluster().equals(other.getCluster())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getClusterId().hashCode(); + if (hasCluster()) { + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.CreateClusterRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateClusterRequest 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.alloydb.v1.CreateClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateClusterRequest 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.alloydb.v1.CreateClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateClusterRequest 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.alloydb.v1.CreateClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateClusterRequest 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.alloydb.v1.CreateClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateClusterRequest 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.alloydb.v1.CreateClusterRequest 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; + } + /** + * + * + *
+   * Message for creating a Cluster
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.CreateClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.CreateClusterRequest) + com.google.cloud.alloydb.v1.CreateClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.CreateClusterRequest.class, + com.google.cloud.alloydb.v1.CreateClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.CreateClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + clusterId_ = ""; + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.CreateClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateClusterRequest build() { + com.google.cloud.alloydb.v1.CreateClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateClusterRequest buildPartial() { + com.google.cloud.alloydb.v1.CreateClusterRequest result = + new com.google.cloud.alloydb.v1.CreateClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.CreateClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterId_ = clusterId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1.CreateClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.CreateClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.CreateClusterRequest other) { + if (other == com.google.cloud.alloydb.v1.CreateClusterRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getClusterId().isEmpty()) { + clusterId_ = other.clusterId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCluster()) { + mergeCluster(other.getCluster()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + clusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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 name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object clusterId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearClusterId() { + clusterId_ = getDefaultInstance().getClusterId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster, + com.google.cloud.alloydb.v1.Cluster.Builder, + com.google.cloud.alloydb.v1.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.alloydb.v1.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.alloydb.v1.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.alloydb.v1.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCluster() { + bitField0_ = (bitField0_ & ~0x00000004); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster, + com.google.cloud.alloydb.v1.Cluster.Builder, + com.google.cloud.alloydb.v1.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster, + com.google.cloud.alloydb.v1.Cluster.Builder, + com.google.cloud.alloydb.v1.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = 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.alloydb.v1.CreateClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.CreateClusterRequest) + private static final com.google.cloud.alloydb.v1.CreateClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.CreateClusterRequest(); + } + + public static com.google.cloud.alloydb.v1.CreateClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateClusterRequest 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.alloydb.v1.CreateClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateClusterRequestOrBuilder.java new file mode 100644 index 000000000000..6d3824bc2c32 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateClusterRequestOrBuilder.java @@ -0,0 +1,179 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface CreateClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.CreateClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.alloydb.v1.Cluster getCluster(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateInstanceRequest.java new file mode 100644 index 000000000000..b92685266631 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateInstanceRequest.java @@ -0,0 +1,1470 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for creating a Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.CreateInstanceRequest} + */ +public final class CreateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.CreateInstanceRequest) + CreateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateInstanceRequest.newBuilder() to construct. + private CreateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateInstanceRequest() { + parent_ = ""; + instanceId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateInstanceRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.CreateInstanceRequest.class, + com.google.cloud.alloydb.v1.CreateInstanceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 INSTANCE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + @java.lang.Override + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + 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(); + instanceId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1.Instance instance_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return instance_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance getInstance() { + return instance_ == null + ? com.google.cloud.alloydb.v1.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.InstanceOrBuilder getInstanceOrBuilder() { + return instance_ == null + ? com.google.cloud.alloydb.v1.Instance.getDefaultInstance() + : instance_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, instanceId_); + } + if (instance_ != null) { + output.writeMessage(3, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, instanceId_); + } + if (instance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + 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.alloydb.v1.CreateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.CreateInstanceRequest other = + (com.google.cloud.alloydb.v1.CreateInstanceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequest 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.alloydb.v1.CreateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequest 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.alloydb.v1.CreateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequest 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.alloydb.v1.CreateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequest 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.alloydb.v1.CreateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequest 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.alloydb.v1.CreateInstanceRequest 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; + } + /** + * + * + *
+   * Message for creating a Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.CreateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.CreateInstanceRequest) + com.google.cloud.alloydb.v1.CreateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.CreateInstanceRequest.class, + com.google.cloud.alloydb.v1.CreateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.CreateInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + instanceId_ = ""; + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.CreateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateInstanceRequest build() { + com.google.cloud.alloydb.v1.CreateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1.CreateInstanceRequest result = + new com.google.cloud.alloydb.v1.CreateInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.CreateInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceId_ = instanceId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1.CreateInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.CreateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.CreateInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1.CreateInstanceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instanceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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 name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instanceId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + instanceId_ = getDefaultInstance().getInstanceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance, + com.google.cloud.alloydb.v1.Instance.Builder, + com.google.cloud.alloydb.v1.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.alloydb.v1.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.alloydb.v1.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + } else { + instanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.alloydb.v1.Instance value) { + if (instanceBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && instance_ != null + && instance_ != com.google.cloud.alloydb.v1.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); + } else { + instance_ = value; + } + } else { + instanceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + bitField0_ = (bitField0_ & ~0x00000004); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.Instance.Builder getInstanceBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.alloydb.v1.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance, + com.google.cloud.alloydb.v1.Instance.Builder, + com.google.cloud.alloydb.v1.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance, + com.google.cloud.alloydb.v1.Instance.Builder, + com.google.cloud.alloydb.v1.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = 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.alloydb.v1.CreateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.CreateInstanceRequest) + private static final com.google.cloud.alloydb.v1.CreateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.CreateInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateInstanceRequest 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.alloydb.v1.CreateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..9dd6ec9f9aca --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateInstanceRequestOrBuilder.java @@ -0,0 +1,179 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface CreateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.CreateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.alloydb.v1.Instance getInstance(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1.InstanceOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateInstanceRequests.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateInstanceRequests.java new file mode 100644 index 000000000000..f6439507cce3 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateInstanceRequests.java @@ -0,0 +1,1030 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * See usage below for notes.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.CreateInstanceRequests} + */ +public final class CreateInstanceRequests extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.CreateInstanceRequests) + CreateInstanceRequestsOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateInstanceRequests.newBuilder() to construct. + private CreateInstanceRequests(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateInstanceRequests() { + createInstanceRequests_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateInstanceRequests(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateInstanceRequests_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateInstanceRequests_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.CreateInstanceRequests.class, + com.google.cloud.alloydb.v1.CreateInstanceRequests.Builder.class); + } + + public static final int CREATE_INSTANCE_REQUESTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List createInstanceRequests_; + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getCreateInstanceRequestsList() { + return createInstanceRequests_; + } + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getCreateInstanceRequestsOrBuilderList() { + return createInstanceRequests_; + } + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getCreateInstanceRequestsCount() { + return createInstanceRequests_.size(); + } + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateInstanceRequest getCreateInstanceRequests(int index) { + return createInstanceRequests_.get(index); + } + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateInstanceRequestOrBuilder + getCreateInstanceRequestsOrBuilder(int index) { + return createInstanceRequests_.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 < createInstanceRequests_.size(); i++) { + output.writeMessage(1, createInstanceRequests_.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 < createInstanceRequests_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, createInstanceRequests_.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.alloydb.v1.CreateInstanceRequests)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.CreateInstanceRequests other = + (com.google.cloud.alloydb.v1.CreateInstanceRequests) obj; + + if (!getCreateInstanceRequestsList().equals(other.getCreateInstanceRequestsList())) + 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 (getCreateInstanceRequestsCount() > 0) { + hash = (37 * hash) + CREATE_INSTANCE_REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getCreateInstanceRequestsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequests parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequests 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.alloydb.v1.CreateInstanceRequests parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequests 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.alloydb.v1.CreateInstanceRequests parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequests parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequests parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequests 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.alloydb.v1.CreateInstanceRequests parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequests 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.alloydb.v1.CreateInstanceRequests parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequests 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.alloydb.v1.CreateInstanceRequests 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; + } + /** + * + * + *
+   * See usage below for notes.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.CreateInstanceRequests} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.CreateInstanceRequests) + com.google.cloud.alloydb.v1.CreateInstanceRequestsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateInstanceRequests_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateInstanceRequests_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.CreateInstanceRequests.class, + com.google.cloud.alloydb.v1.CreateInstanceRequests.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.CreateInstanceRequests.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (createInstanceRequestsBuilder_ == null) { + createInstanceRequests_ = java.util.Collections.emptyList(); + } else { + createInstanceRequests_ = null; + createInstanceRequestsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateInstanceRequests_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateInstanceRequests getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.CreateInstanceRequests.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateInstanceRequests build() { + com.google.cloud.alloydb.v1.CreateInstanceRequests result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateInstanceRequests buildPartial() { + com.google.cloud.alloydb.v1.CreateInstanceRequests result = + new com.google.cloud.alloydb.v1.CreateInstanceRequests(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1.CreateInstanceRequests result) { + if (createInstanceRequestsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + createInstanceRequests_ = java.util.Collections.unmodifiableList(createInstanceRequests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.createInstanceRequests_ = createInstanceRequests_; + } else { + result.createInstanceRequests_ = createInstanceRequestsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.alloydb.v1.CreateInstanceRequests result) { + int from_bitField0_ = bitField0_; + } + + @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.alloydb.v1.CreateInstanceRequests) { + return mergeFrom((com.google.cloud.alloydb.v1.CreateInstanceRequests) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.CreateInstanceRequests other) { + if (other == com.google.cloud.alloydb.v1.CreateInstanceRequests.getDefaultInstance()) + return this; + if (createInstanceRequestsBuilder_ == null) { + if (!other.createInstanceRequests_.isEmpty()) { + if (createInstanceRequests_.isEmpty()) { + createInstanceRequests_ = other.createInstanceRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.addAll(other.createInstanceRequests_); + } + onChanged(); + } + } else { + if (!other.createInstanceRequests_.isEmpty()) { + if (createInstanceRequestsBuilder_.isEmpty()) { + createInstanceRequestsBuilder_.dispose(); + createInstanceRequestsBuilder_ = null; + createInstanceRequests_ = other.createInstanceRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + createInstanceRequestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCreateInstanceRequestsFieldBuilder() + : null; + } else { + createInstanceRequestsBuilder_.addAllMessages(other.createInstanceRequests_); + } + } + } + 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.alloydb.v1.CreateInstanceRequest m = + input.readMessage( + com.google.cloud.alloydb.v1.CreateInstanceRequest.parser(), + extensionRegistry); + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.add(m); + } else { + createInstanceRequestsBuilder_.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 + createInstanceRequests_ = java.util.Collections.emptyList(); + + private void ensureCreateInstanceRequestsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + createInstanceRequests_ = + new java.util.ArrayList( + createInstanceRequests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.CreateInstanceRequest, + com.google.cloud.alloydb.v1.CreateInstanceRequest.Builder, + com.google.cloud.alloydb.v1.CreateInstanceRequestOrBuilder> + createInstanceRequestsBuilder_; + + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getCreateInstanceRequestsList() { + if (createInstanceRequestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(createInstanceRequests_); + } else { + return createInstanceRequestsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getCreateInstanceRequestsCount() { + if (createInstanceRequestsBuilder_ == null) { + return createInstanceRequests_.size(); + } else { + return createInstanceRequestsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.CreateInstanceRequest getCreateInstanceRequests(int index) { + if (createInstanceRequestsBuilder_ == null) { + return createInstanceRequests_.get(index); + } else { + return createInstanceRequestsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCreateInstanceRequests( + int index, com.google.cloud.alloydb.v1.CreateInstanceRequest value) { + if (createInstanceRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.set(index, value); + onChanged(); + } else { + createInstanceRequestsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCreateInstanceRequests( + int index, com.google.cloud.alloydb.v1.CreateInstanceRequest.Builder builderForValue) { + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.set(index, builderForValue.build()); + onChanged(); + } else { + createInstanceRequestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCreateInstanceRequests( + com.google.cloud.alloydb.v1.CreateInstanceRequest value) { + if (createInstanceRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.add(value); + onChanged(); + } else { + createInstanceRequestsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCreateInstanceRequests( + int index, com.google.cloud.alloydb.v1.CreateInstanceRequest value) { + if (createInstanceRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.add(index, value); + onChanged(); + } else { + createInstanceRequestsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCreateInstanceRequests( + com.google.cloud.alloydb.v1.CreateInstanceRequest.Builder builderForValue) { + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.add(builderForValue.build()); + onChanged(); + } else { + createInstanceRequestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCreateInstanceRequests( + int index, com.google.cloud.alloydb.v1.CreateInstanceRequest.Builder builderForValue) { + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.add(index, builderForValue.build()); + onChanged(); + } else { + createInstanceRequestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllCreateInstanceRequests( + java.lang.Iterable values) { + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, createInstanceRequests_); + onChanged(); + } else { + createInstanceRequestsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCreateInstanceRequests() { + if (createInstanceRequestsBuilder_ == null) { + createInstanceRequests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + createInstanceRequestsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeCreateInstanceRequests(int index) { + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.remove(index); + onChanged(); + } else { + createInstanceRequestsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.CreateInstanceRequest.Builder + getCreateInstanceRequestsBuilder(int index) { + return getCreateInstanceRequestsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.CreateInstanceRequestOrBuilder + getCreateInstanceRequestsOrBuilder(int index) { + if (createInstanceRequestsBuilder_ == null) { + return createInstanceRequests_.get(index); + } else { + return createInstanceRequestsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getCreateInstanceRequestsOrBuilderList() { + if (createInstanceRequestsBuilder_ != null) { + return createInstanceRequestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(createInstanceRequests_); + } + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.CreateInstanceRequest.Builder + addCreateInstanceRequestsBuilder() { + return getCreateInstanceRequestsFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1.CreateInstanceRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.CreateInstanceRequest.Builder + addCreateInstanceRequestsBuilder(int index) { + return getCreateInstanceRequestsFieldBuilder() + .addBuilder( + index, com.google.cloud.alloydb.v1.CreateInstanceRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getCreateInstanceRequestsBuilderList() { + return getCreateInstanceRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.CreateInstanceRequest, + com.google.cloud.alloydb.v1.CreateInstanceRequest.Builder, + com.google.cloud.alloydb.v1.CreateInstanceRequestOrBuilder> + getCreateInstanceRequestsFieldBuilder() { + if (createInstanceRequestsBuilder_ == null) { + createInstanceRequestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.CreateInstanceRequest, + com.google.cloud.alloydb.v1.CreateInstanceRequest.Builder, + com.google.cloud.alloydb.v1.CreateInstanceRequestOrBuilder>( + createInstanceRequests_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + createInstanceRequests_ = null; + } + return createInstanceRequestsBuilder_; + } + + @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.alloydb.v1.CreateInstanceRequests) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.CreateInstanceRequests) + private static final com.google.cloud.alloydb.v1.CreateInstanceRequests DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.CreateInstanceRequests(); + } + + public static com.google.cloud.alloydb.v1.CreateInstanceRequests getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateInstanceRequests 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.alloydb.v1.CreateInstanceRequests getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateInstanceRequestsOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateInstanceRequestsOrBuilder.java new file mode 100644 index 000000000000..e33505840ef8 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateInstanceRequestsOrBuilder.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/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface CreateInstanceRequestsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.CreateInstanceRequests) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getCreateInstanceRequestsList(); + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1.CreateInstanceRequest getCreateInstanceRequests(int index); + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getCreateInstanceRequestsCount(); + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getCreateInstanceRequestsOrBuilderList(); + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1.CreateInstanceRequestOrBuilder getCreateInstanceRequestsOrBuilder( + int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DatabaseVersion.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DatabaseVersion.java new file mode 100644 index 000000000000..9c278361b8c8 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DatabaseVersion.java @@ -0,0 +1,177 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * The supported database engine versions.
+ * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.DatabaseVersion} + */ +public enum DatabaseVersion implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown database version.
+   * 
+ * + * DATABASE_VERSION_UNSPECIFIED = 0; + */ + DATABASE_VERSION_UNSPECIFIED(0), + /** + * + * + *
+   * DEPRECATED - The database version is Postgres 13.
+   * 
+ * + * POSTGRES_13 = 1 [deprecated = true]; + */ + @java.lang.Deprecated + POSTGRES_13(1), + /** + * + * + *
+   * The database version is Postgres 14.
+   * 
+ * + * POSTGRES_14 = 2; + */ + POSTGRES_14(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * This is an unknown database version.
+   * 
+ * + * DATABASE_VERSION_UNSPECIFIED = 0; + */ + public static final int DATABASE_VERSION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * DEPRECATED - The database version is Postgres 13.
+   * 
+ * + * POSTGRES_13 = 1 [deprecated = true]; + */ + @java.lang.Deprecated public static final int POSTGRES_13_VALUE = 1; + /** + * + * + *
+   * The database version is Postgres 14.
+   * 
+ * + * POSTGRES_14 = 2; + */ + public static final int POSTGRES_14_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 DatabaseVersion 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 DatabaseVersion forNumber(int value) { + switch (value) { + case 0: + return DATABASE_VERSION_UNSPECIFIED; + case 1: + return POSTGRES_13; + case 2: + return POSTGRES_14; + 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 DatabaseVersion findValueByNumber(int number) { + return DatabaseVersion.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.alloydb.v1.ResourcesProto.getDescriptor().getEnumTypes().get(0); + } + + private static final DatabaseVersion[] VALUES = values(); + + public static DatabaseVersion 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 DatabaseVersion(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1.DatabaseVersion) +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteBackupRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteBackupRequest.java new file mode 100644 index 000000000000..4d8cc9a4aa3b --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteBackupRequest.java @@ -0,0 +1,1195 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for deleting a Backup
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.DeleteBackupRequest} + */ +public final class DeleteBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.DeleteBackupRequest) + DeleteBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteBackupRequest.newBuilder() to construct. + private DeleteBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteBackupRequest() { + name_ = ""; + requestId_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteBackupRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.DeleteBackupRequest.class, + com.google.cloud.alloydb.v1.DeleteBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource. For the required format, see the comment on
+   * the Backup.name field.
+   * 
+ * + * + * 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. Name of the resource. For the required format, see the comment on
+   * the Backup.name field.
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ETAG_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. The current etag of the Backup.
+   * If an etag is provided and does not match the current etag of the Backup,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The current etag of the Backup.
+   * If an etag is provided and does not match the current etag of the Backup,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, etag_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, etag_); + } + 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.alloydb.v1.DeleteBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.DeleteBackupRequest other = + (com.google.cloud.alloydb.v1.DeleteBackupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getEtag().equals(other.getEtag())) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.DeleteBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.DeleteBackupRequest 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.alloydb.v1.DeleteBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.DeleteBackupRequest 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.alloydb.v1.DeleteBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.DeleteBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.DeleteBackupRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.DeleteBackupRequest 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.alloydb.v1.DeleteBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.DeleteBackupRequest 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.alloydb.v1.DeleteBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.DeleteBackupRequest 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.alloydb.v1.DeleteBackupRequest 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; + } + /** + * + * + *
+   * Message for deleting a Backup
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.DeleteBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.DeleteBackupRequest) + com.google.cloud.alloydb.v1.DeleteBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.DeleteBackupRequest.class, + com.google.cloud.alloydb.v1.DeleteBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.DeleteBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + validateOnly_ = false; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.DeleteBackupRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.DeleteBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.DeleteBackupRequest build() { + com.google.cloud.alloydb.v1.DeleteBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.DeleteBackupRequest buildPartial() { + com.google.cloud.alloydb.v1.DeleteBackupRequest result = + new com.google.cloud.alloydb.v1.DeleteBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.DeleteBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.etag_ = etag_; + } + } + + @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.alloydb.v1.DeleteBackupRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.DeleteBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.DeleteBackupRequest other) { + if (other == com.google.cloud.alloydb.v1.DeleteBackupRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000008; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the resource. For the required format, see the comment on
+     * the Backup.name field.
+     * 
+ * + * + * 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. Name of the resource. For the required format, see the comment on
+     * the Backup.name field.
+     * 
+ * + * + * 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. Name of the resource. For the required format, see the comment on
+     * the Backup.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource. For the required format, see the comment on
+     * the Backup.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource. For the required format, see the comment on
+     * the Backup.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The current etag of the Backup.
+     * If an etag is provided and does not match the current etag of the Backup,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Backup.
+     * If an etag is provided and does not match the current etag of the Backup,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Backup.
+     * If an etag is provided and does not match the current etag of the Backup,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Backup.
+     * If an etag is provided and does not match the current etag of the Backup,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Backup.
+     * If an etag is provided and does not match the current etag of the Backup,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000008; + 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.alloydb.v1.DeleteBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.DeleteBackupRequest) + private static final com.google.cloud.alloydb.v1.DeleteBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.DeleteBackupRequest(); + } + + public static com.google.cloud.alloydb.v1.DeleteBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBackupRequest 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.alloydb.v1.DeleteBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteBackupRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteBackupRequestOrBuilder.java new file mode 100644 index 000000000000..84c6608f43f5 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteBackupRequestOrBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface DeleteBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.DeleteBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource. For the required format, see the comment on
+   * the Backup.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource. For the required format, see the comment on
+   * the Backup.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. The current etag of the Backup.
+   * If an etag is provided and does not match the current etag of the Backup,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The current etag of the Backup.
+   * If an etag is provided and does not match the current etag of the Backup,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteClusterRequest.java new file mode 100644 index 000000000000..9d623ff43b6b --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteClusterRequest.java @@ -0,0 +1,1288 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for deleting a Cluster
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.DeleteClusterRequest} + */ +public final class DeleteClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.DeleteClusterRequest) + DeleteClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteClusterRequest.newBuilder() to construct. + private DeleteClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteClusterRequest() { + name_ = ""; + requestId_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteClusterRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.DeleteClusterRequest.class, + com.google.cloud.alloydb.v1.DeleteClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int FORCE_FIELD_NUMBER = 5; + private boolean force_ = false; + /** + * + * + *
+   * Optional. Whether to cascade delete child instances for given cluster.
+   * 
+ * + * bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (force_ != false) { + output.writeBool(5, force_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, force_); + } + 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.alloydb.v1.DeleteClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.DeleteClusterRequest other = + (com.google.cloud.alloydb.v1.DeleteClusterRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getForce() != other.getForce()) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.DeleteClusterRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.DeleteClusterRequest 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.alloydb.v1.DeleteClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.DeleteClusterRequest 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.alloydb.v1.DeleteClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.DeleteClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.DeleteClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.DeleteClusterRequest 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.alloydb.v1.DeleteClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.DeleteClusterRequest 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.alloydb.v1.DeleteClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.DeleteClusterRequest 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.alloydb.v1.DeleteClusterRequest 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; + } + /** + * + * + *
+   * Message for deleting a Cluster
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.DeleteClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.DeleteClusterRequest) + com.google.cloud.alloydb.v1.DeleteClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.DeleteClusterRequest.class, + com.google.cloud.alloydb.v1.DeleteClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.DeleteClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + etag_ = ""; + validateOnly_ = false; + force_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.DeleteClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.DeleteClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.DeleteClusterRequest build() { + com.google.cloud.alloydb.v1.DeleteClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.DeleteClusterRequest buildPartial() { + com.google.cloud.alloydb.v1.DeleteClusterRequest result = + new com.google.cloud.alloydb.v1.DeleteClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.DeleteClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.force_ = force_; + } + } + + @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.alloydb.v1.DeleteClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.DeleteClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.DeleteClusterRequest other) { + if (other == com.google.cloud.alloydb.v1.DeleteClusterRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + force_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * Optional. Whether to cascade delete child instances for given cluster.
+     * 
+ * + * bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * Optional. Whether to cascade delete child instances for given cluster.
+     * 
+ * + * bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Whether to cascade delete child instances for given cluster.
+     * 
+ * + * bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + bitField0_ = (bitField0_ & ~0x00000010); + force_ = 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.alloydb.v1.DeleteClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.DeleteClusterRequest) + private static final com.google.cloud.alloydb.v1.DeleteClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.DeleteClusterRequest(); + } + + public static com.google.cloud.alloydb.v1.DeleteClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteClusterRequest 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.alloydb.v1.DeleteClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteClusterRequestOrBuilder.java new file mode 100644 index 000000000000..d53decba332a --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteClusterRequestOrBuilder.java @@ -0,0 +1,157 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface DeleteClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.DeleteClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. Whether to cascade delete child instances for given cluster.
+   * 
+ * + * bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteInstanceRequest.java new file mode 100644 index 000000000000..c89901799e22 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteInstanceRequest.java @@ -0,0 +1,1195 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for deleting a Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.DeleteInstanceRequest} + */ +public final class DeleteInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.DeleteInstanceRequest) + DeleteInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteInstanceRequest.newBuilder() to construct. + private DeleteInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteInstanceRequest() { + name_ = ""; + requestId_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteInstanceRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.DeleteInstanceRequest.class, + com.google.cloud.alloydb.v1.DeleteInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. The current etag of the Instance.
+   * If an etag is provided and does not match the current etag of the Instance,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The current etag of the Instance.
+   * If an etag is provided and does not match the current etag of the Instance,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + 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.alloydb.v1.DeleteInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.DeleteInstanceRequest other = + (com.google.cloud.alloydb.v1.DeleteInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.DeleteInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.DeleteInstanceRequest 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.alloydb.v1.DeleteInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.DeleteInstanceRequest 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.alloydb.v1.DeleteInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.DeleteInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.DeleteInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.DeleteInstanceRequest 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.alloydb.v1.DeleteInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.DeleteInstanceRequest 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.alloydb.v1.DeleteInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.DeleteInstanceRequest 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.alloydb.v1.DeleteInstanceRequest 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; + } + /** + * + * + *
+   * Message for deleting a Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.DeleteInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.DeleteInstanceRequest) + com.google.cloud.alloydb.v1.DeleteInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.DeleteInstanceRequest.class, + com.google.cloud.alloydb.v1.DeleteInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.DeleteInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + etag_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.DeleteInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.DeleteInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.DeleteInstanceRequest build() { + com.google.cloud.alloydb.v1.DeleteInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.DeleteInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1.DeleteInstanceRequest result = + new com.google.cloud.alloydb.v1.DeleteInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.DeleteInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1.DeleteInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.DeleteInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.DeleteInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1.DeleteInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The current etag of the Instance.
+     * If an etag is provided and does not match the current etag of the Instance,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Instance.
+     * If an etag is provided and does not match the current etag of the Instance,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Instance.
+     * If an etag is provided and does not match the current etag of the Instance,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Instance.
+     * If an etag is provided and does not match the current etag of the Instance,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Instance.
+     * If an etag is provided and does not match the current etag of the Instance,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = 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.alloydb.v1.DeleteInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.DeleteInstanceRequest) + private static final com.google.cloud.alloydb.v1.DeleteInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.DeleteInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1.DeleteInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteInstanceRequest 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.alloydb.v1.DeleteInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..591213eb0da1 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteInstanceRequestOrBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface DeleteInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.DeleteInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. The current etag of the Instance.
+   * If an etag is provided and does not match the current etag of the Instance,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The current etag of the Instance.
+   * If an etag is provided and does not match the current etag of the Instance,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/EncryptionConfig.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/EncryptionConfig.java new file mode 100644 index 000000000000..793e44fca624 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/EncryptionConfig.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/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * EncryptionConfig describes the encryption config of a cluster or a backup
+ * that is encrypted with a CMEK (customer-managed encryption key).
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.EncryptionConfig} + */ +public final class EncryptionConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.EncryptionConfig) + EncryptionConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use EncryptionConfig.newBuilder() to construct. + private EncryptionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EncryptionConfig() { + kmsKeyName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EncryptionConfig(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_EncryptionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_EncryptionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.EncryptionConfig.class, + com.google.cloud.alloydb.v1.EncryptionConfig.Builder.class); + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+   * The fully-qualified resource name of the KMS key.
+   * Each Cloud KMS key is regionalized and has the following format:
+   * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+   * 
+ * + * string kms_key_name = 1; + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + 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(); + kmsKeyName_ = s; + return s; + } + } + /** + * + * + *
+   * The fully-qualified resource name of the KMS key.
+   * Each Cloud KMS key is regionalized and has the following format:
+   * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+   * 
+ * + * string kms_key_name = 1; + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = 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(kmsKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kmsKeyName_); + } + 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(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kmsKeyName_); + } + 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.alloydb.v1.EncryptionConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.EncryptionConfig other = + (com.google.cloud.alloydb.v1.EncryptionConfig) obj; + + if (!getKmsKeyName().equals(other.getKmsKeyName())) 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) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.EncryptionConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.EncryptionConfig 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.alloydb.v1.EncryptionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.EncryptionConfig 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.alloydb.v1.EncryptionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.EncryptionConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.EncryptionConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.EncryptionConfig 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.alloydb.v1.EncryptionConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.EncryptionConfig 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.alloydb.v1.EncryptionConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.EncryptionConfig 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.alloydb.v1.EncryptionConfig 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; + } + /** + * + * + *
+   * EncryptionConfig describes the encryption config of a cluster or a backup
+   * that is encrypted with a CMEK (customer-managed encryption key).
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.EncryptionConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.EncryptionConfig) + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_EncryptionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_EncryptionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.EncryptionConfig.class, + com.google.cloud.alloydb.v1.EncryptionConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.EncryptionConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kmsKeyName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_EncryptionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionConfig build() { + com.google.cloud.alloydb.v1.EncryptionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionConfig buildPartial() { + com.google.cloud.alloydb.v1.EncryptionConfig result = + new com.google.cloud.alloydb.v1.EncryptionConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.EncryptionConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kmsKeyName_ = kmsKeyName_; + } + } + + @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.alloydb.v1.EncryptionConfig) { + return mergeFrom((com.google.cloud.alloydb.v1.EncryptionConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.EncryptionConfig other) { + if (other == com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance()) return this; + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + bitField0_ |= 0x00000001; + 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: + { + kmsKeyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + 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.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+     * The fully-qualified resource name of the KMS key.
+     * Each Cloud KMS key is regionalized and has the following format:
+     * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+     * 
+ * + * string kms_key_name = 1; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The fully-qualified resource name of the KMS key.
+     * Each Cloud KMS key is regionalized and has the following format:
+     * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+     * 
+ * + * string kms_key_name = 1; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The fully-qualified resource name of the KMS key.
+     * Each Cloud KMS key is regionalized and has the following format:
+     * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+     * 
+ * + * string kms_key_name = 1; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The fully-qualified resource name of the KMS key.
+     * Each Cloud KMS key is regionalized and has the following format:
+     * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+     * 
+ * + * string kms_key_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The fully-qualified resource name of the KMS key.
+     * Each Cloud KMS key is regionalized and has the following format:
+     * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+     * 
+ * + * string kms_key_name = 1; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyName_ = value; + 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.alloydb.v1.EncryptionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.EncryptionConfig) + private static final com.google.cloud.alloydb.v1.EncryptionConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.EncryptionConfig(); + } + + public static com.google.cloud.alloydb.v1.EncryptionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EncryptionConfig 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.alloydb.v1.EncryptionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/EncryptionConfigOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/EncryptionConfigOrBuilder.java new file mode 100644 index 000000000000..efc78fe357e7 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/EncryptionConfigOrBuilder.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/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public interface EncryptionConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.EncryptionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The fully-qualified resource name of the KMS key.
+   * Each Cloud KMS key is regionalized and has the following format:
+   * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+   * 
+ * + * string kms_key_name = 1; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + /** + * + * + *
+   * The fully-qualified resource name of the KMS key.
+   * Each Cloud KMS key is regionalized and has the following format:
+   * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+   * 
+ * + * string kms_key_name = 1; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/EncryptionInfo.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/EncryptionInfo.java new file mode 100644 index 000000000000..80e280422c0f --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/EncryptionInfo.java @@ -0,0 +1,1086 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * EncryptionInfo describes the encryption information of a cluster or a backup.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.EncryptionInfo} + */ +public final class EncryptionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.EncryptionInfo) + EncryptionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use EncryptionInfo.newBuilder() to construct. + private EncryptionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EncryptionInfo() { + encryptionType_ = 0; + kmsKeyVersions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EncryptionInfo(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_EncryptionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_EncryptionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.EncryptionInfo.class, + com.google.cloud.alloydb.v1.EncryptionInfo.Builder.class); + } + + /** + * + * + *
+   * Possible encryption types.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.EncryptionInfo.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The data is encrypted at rest with a key that is fully managed by Google.
+     * No key version will be populated. This is the default state.
+     * 
+ * + * GOOGLE_DEFAULT_ENCRYPTION = 1; + */ + GOOGLE_DEFAULT_ENCRYPTION(1), + /** + * + * + *
+     * The data is encrypted at rest with a key that is managed by the customer.
+     * KMS key versions will be populated.
+     * 
+ * + * CUSTOMER_MANAGED_ENCRYPTION = 2; + */ + CUSTOMER_MANAGED_ENCRYPTION(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The data is encrypted at rest with a key that is fully managed by Google.
+     * No key version will be populated. This is the default state.
+     * 
+ * + * GOOGLE_DEFAULT_ENCRYPTION = 1; + */ + public static final int GOOGLE_DEFAULT_ENCRYPTION_VALUE = 1; + /** + * + * + *
+     * The data is encrypted at rest with a key that is managed by the customer.
+     * KMS key versions will be populated.
+     * 
+ * + * CUSTOMER_MANAGED_ENCRYPTION = 2; + */ + public static final int CUSTOMER_MANAGED_ENCRYPTION_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 Type 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 Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return GOOGLE_DEFAULT_ENCRYPTION; + case 2: + return CUSTOMER_MANAGED_ENCRYPTION; + 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 Type findValueByNumber(int number) { + return Type.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.alloydb.v1.EncryptionInfo.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1.EncryptionInfo.Type) + } + + public static final int ENCRYPTION_TYPE_FIELD_NUMBER = 1; + private int encryptionType_ = 0; + /** + * + * + *
+   * Output only. Type of encryption.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for encryptionType. + */ + @java.lang.Override + public int getEncryptionTypeValue() { + return encryptionType_; + } + /** + * + * + *
+   * Output only. Type of encryption.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionInfo.Type getEncryptionType() { + com.google.cloud.alloydb.v1.EncryptionInfo.Type result = + com.google.cloud.alloydb.v1.EncryptionInfo.Type.forNumber(encryptionType_); + return result == null ? com.google.cloud.alloydb.v1.EncryptionInfo.Type.UNRECOGNIZED : result; + } + + public static final int KMS_KEY_VERSIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList kmsKeyVersions_; + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the kmsKeyVersions. + */ + public com.google.protobuf.ProtocolStringList getKmsKeyVersionsList() { + return kmsKeyVersions_; + } + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of kmsKeyVersions. + */ + public int getKmsKeyVersionsCount() { + return kmsKeyVersions_.size(); + } + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The kmsKeyVersions at the given index. + */ + public java.lang.String getKmsKeyVersions(int index) { + return kmsKeyVersions_.get(index); + } + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the kmsKeyVersions at the given index. + */ + public com.google.protobuf.ByteString getKmsKeyVersionsBytes(int index) { + return kmsKeyVersions_.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 (encryptionType_ + != com.google.cloud.alloydb.v1.EncryptionInfo.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, encryptionType_); + } + for (int i = 0; i < kmsKeyVersions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kmsKeyVersions_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encryptionType_ + != com.google.cloud.alloydb.v1.EncryptionInfo.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, encryptionType_); + } + { + int dataSize = 0; + for (int i = 0; i < kmsKeyVersions_.size(); i++) { + dataSize += computeStringSizeNoTag(kmsKeyVersions_.getRaw(i)); + } + size += dataSize; + size += 1 * getKmsKeyVersionsList().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.alloydb.v1.EncryptionInfo)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.EncryptionInfo other = + (com.google.cloud.alloydb.v1.EncryptionInfo) obj; + + if (encryptionType_ != other.encryptionType_) return false; + if (!getKmsKeyVersionsList().equals(other.getKmsKeyVersionsList())) 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) + ENCRYPTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + encryptionType_; + if (getKmsKeyVersionsCount() > 0) { + hash = (37 * hash) + KMS_KEY_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyVersionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.EncryptionInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.EncryptionInfo 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.alloydb.v1.EncryptionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.EncryptionInfo 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.alloydb.v1.EncryptionInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.EncryptionInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.EncryptionInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.EncryptionInfo 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.alloydb.v1.EncryptionInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.EncryptionInfo 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.alloydb.v1.EncryptionInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.EncryptionInfo 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.alloydb.v1.EncryptionInfo 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; + } + /** + * + * + *
+   * EncryptionInfo describes the encryption information of a cluster or a backup.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.EncryptionInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.EncryptionInfo) + com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_EncryptionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_EncryptionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.EncryptionInfo.class, + com.google.cloud.alloydb.v1.EncryptionInfo.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.EncryptionInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encryptionType_ = 0; + kmsKeyVersions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_EncryptionInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionInfo getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionInfo build() { + com.google.cloud.alloydb.v1.EncryptionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionInfo buildPartial() { + com.google.cloud.alloydb.v1.EncryptionInfo result = + new com.google.cloud.alloydb.v1.EncryptionInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.alloydb.v1.EncryptionInfo result) { + if (((bitField0_ & 0x00000002) != 0)) { + kmsKeyVersions_ = kmsKeyVersions_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.kmsKeyVersions_ = kmsKeyVersions_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.EncryptionInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encryptionType_ = encryptionType_; + } + } + + @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.alloydb.v1.EncryptionInfo) { + return mergeFrom((com.google.cloud.alloydb.v1.EncryptionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.EncryptionInfo other) { + if (other == com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance()) return this; + if (other.encryptionType_ != 0) { + setEncryptionTypeValue(other.getEncryptionTypeValue()); + } + if (!other.kmsKeyVersions_.isEmpty()) { + if (kmsKeyVersions_.isEmpty()) { + kmsKeyVersions_ = other.kmsKeyVersions_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureKmsKeyVersionsIsMutable(); + kmsKeyVersions_.addAll(other.kmsKeyVersions_); + } + 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: + { + encryptionType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureKmsKeyVersionsIsMutable(); + kmsKeyVersions_.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 int encryptionType_ = 0; + /** + * + * + *
+     * Output only. Type of encryption.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for encryptionType. + */ + @java.lang.Override + public int getEncryptionTypeValue() { + return encryptionType_; + } + /** + * + * + *
+     * Output only. Type of encryption.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for encryptionType to set. + * @return This builder for chaining. + */ + public Builder setEncryptionTypeValue(int value) { + encryptionType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of encryption.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionInfo.Type getEncryptionType() { + com.google.cloud.alloydb.v1.EncryptionInfo.Type result = + com.google.cloud.alloydb.v1.EncryptionInfo.Type.forNumber(encryptionType_); + return result == null ? com.google.cloud.alloydb.v1.EncryptionInfo.Type.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. Type of encryption.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The encryptionType to set. + * @return This builder for chaining. + */ + public Builder setEncryptionType(com.google.cloud.alloydb.v1.EncryptionInfo.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + encryptionType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of encryption.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearEncryptionType() { + bitField0_ = (bitField0_ & ~0x00000001); + encryptionType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList kmsKeyVersions_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureKmsKeyVersionsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + kmsKeyVersions_ = new com.google.protobuf.LazyStringArrayList(kmsKeyVersions_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the kmsKeyVersions. + */ + public com.google.protobuf.ProtocolStringList getKmsKeyVersionsList() { + return kmsKeyVersions_.getUnmodifiableView(); + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of kmsKeyVersions. + */ + public int getKmsKeyVersionsCount() { + return kmsKeyVersions_.size(); + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The kmsKeyVersions at the given index. + */ + public java.lang.String getKmsKeyVersions(int index) { + return kmsKeyVersions_.get(index); + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the kmsKeyVersions at the given index. + */ + public com.google.protobuf.ByteString getKmsKeyVersionsBytes(int index) { + return kmsKeyVersions_.getByteString(index); + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The kmsKeyVersions to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKmsKeyVersionsIsMutable(); + kmsKeyVersions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The kmsKeyVersions to add. + * @return This builder for chaining. + */ + public Builder addKmsKeyVersions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKmsKeyVersionsIsMutable(); + kmsKeyVersions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param values The kmsKeyVersions to add. + * @return This builder for chaining. + */ + public Builder addAllKmsKeyVersions(java.lang.Iterable values) { + ensureKmsKeyVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, kmsKeyVersions_); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyVersions() { + kmsKeyVersions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the kmsKeyVersions to add. + * @return This builder for chaining. + */ + public Builder addKmsKeyVersionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureKmsKeyVersionsIsMutable(); + kmsKeyVersions_.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.alloydb.v1.EncryptionInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.EncryptionInfo) + private static final com.google.cloud.alloydb.v1.EncryptionInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.EncryptionInfo(); + } + + public static com.google.cloud.alloydb.v1.EncryptionInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EncryptionInfo 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.alloydb.v1.EncryptionInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/EncryptionInfoOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/EncryptionInfoOrBuilder.java new file mode 100644 index 000000000000..b7a2c584f77a --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/EncryptionInfoOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public interface EncryptionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.EncryptionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Type of encryption.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for encryptionType. + */ + int getEncryptionTypeValue(); + /** + * + * + *
+   * Output only. Type of encryption.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionType. + */ + com.google.cloud.alloydb.v1.EncryptionInfo.Type getEncryptionType(); + + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the kmsKeyVersions. + */ + java.util.List getKmsKeyVersionsList(); + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of kmsKeyVersions. + */ + int getKmsKeyVersionsCount(); + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The kmsKeyVersions at the given index. + */ + java.lang.String getKmsKeyVersions(int index); + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the kmsKeyVersions at the given index. + */ + com.google.protobuf.ByteString getKmsKeyVersionsBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/FailoverInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/FailoverInstanceRequest.java new file mode 100644 index 000000000000..1fa05a643c86 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/FailoverInstanceRequest.java @@ -0,0 +1,999 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for triggering failover on an Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.FailoverInstanceRequest} + */ +public final class FailoverInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.FailoverInstanceRequest) + FailoverInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use FailoverInstanceRequest.newBuilder() to construct. + private FailoverInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FailoverInstanceRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FailoverInstanceRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_FailoverInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_FailoverInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.FailoverInstanceRequest.class, + com.google.cloud.alloydb.v1.FailoverInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the failover.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + 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.alloydb.v1.FailoverInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.FailoverInstanceRequest other = + (com.google.cloud.alloydb.v1.FailoverInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.FailoverInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.FailoverInstanceRequest 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.alloydb.v1.FailoverInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.FailoverInstanceRequest 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.alloydb.v1.FailoverInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.FailoverInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.FailoverInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.FailoverInstanceRequest 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.alloydb.v1.FailoverInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.FailoverInstanceRequest 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.alloydb.v1.FailoverInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.FailoverInstanceRequest 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.alloydb.v1.FailoverInstanceRequest 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; + } + /** + * + * + *
+   * Message for triggering failover on an Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.FailoverInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.FailoverInstanceRequest) + com.google.cloud.alloydb.v1.FailoverInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_FailoverInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_FailoverInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.FailoverInstanceRequest.class, + com.google.cloud.alloydb.v1.FailoverInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.FailoverInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_FailoverInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.FailoverInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.FailoverInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.FailoverInstanceRequest build() { + com.google.cloud.alloydb.v1.FailoverInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.FailoverInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1.FailoverInstanceRequest result = + new com.google.cloud.alloydb.v1.FailoverInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.FailoverInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1.FailoverInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.FailoverInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.FailoverInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1.FailoverInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + 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 java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the failover.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the failover.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the failover.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = 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.alloydb.v1.FailoverInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.FailoverInstanceRequest) + private static final com.google.cloud.alloydb.v1.FailoverInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.FailoverInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1.FailoverInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailoverInstanceRequest 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.alloydb.v1.FailoverInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/FailoverInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/FailoverInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..891abd94f438 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/FailoverInstanceRequestOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface FailoverInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.FailoverInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the failover.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetBackupRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetBackupRequest.java new file mode 100644 index 000000000000..eb029fc4b622 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetBackupRequest.java @@ -0,0 +1,642 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for getting a Backup
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.GetBackupRequest} + */ +public final class GetBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.GetBackupRequest) + GetBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetBackupRequest.newBuilder() to construct. + private GetBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetBackupRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetBackupRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.GetBackupRequest.class, + com.google.cloud.alloydb.v1.GetBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * 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. Name of the resource
+   * 
+ * + * + * 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.alloydb.v1.GetBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.GetBackupRequest other = + (com.google.cloud.alloydb.v1.GetBackupRequest) 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.alloydb.v1.GetBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.GetBackupRequest 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.alloydb.v1.GetBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.GetBackupRequest 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.alloydb.v1.GetBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.GetBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.GetBackupRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.GetBackupRequest 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.alloydb.v1.GetBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.GetBackupRequest 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.alloydb.v1.GetBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.GetBackupRequest 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.alloydb.v1.GetBackupRequest 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; + } + /** + * + * + *
+   * Message for getting a Backup
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.GetBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.GetBackupRequest) + com.google.cloud.alloydb.v1.GetBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.GetBackupRequest.class, + com.google.cloud.alloydb.v1.GetBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.GetBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.GetBackupRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.GetBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.GetBackupRequest build() { + com.google.cloud.alloydb.v1.GetBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.GetBackupRequest buildPartial() { + com.google.cloud.alloydb.v1.GetBackupRequest result = + new com.google.cloud.alloydb.v1.GetBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.GetBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.alloydb.v1.GetBackupRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.GetBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.GetBackupRequest other) { + if (other == com.google.cloud.alloydb.v1.GetBackupRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + 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(); + bitField0_ |= 0x00000001; + 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.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * 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; + 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.alloydb.v1.GetBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.GetBackupRequest) + private static final com.google.cloud.alloydb.v1.GetBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.GetBackupRequest(); + } + + public static com.google.cloud.alloydb.v1.GetBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBackupRequest 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.alloydb.v1.GetBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetBackupRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetBackupRequestOrBuilder.java new file mode 100644 index 000000000000..cc34019440c9 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetBackupRequestOrBuilder.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/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface GetBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.GetBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * 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-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetClusterRequest.java new file mode 100644 index 000000000000..84a0a81f3d8c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetClusterRequest.java @@ -0,0 +1,649 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for getting a Cluster
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.GetClusterRequest} + */ +public final class GetClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.GetClusterRequest) + GetClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetClusterRequest.newBuilder() to construct. + private GetClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetClusterRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetClusterRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.GetClusterRequest.class, + com.google.cloud.alloydb.v1.GetClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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.alloydb.v1.GetClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.GetClusterRequest other = + (com.google.cloud.alloydb.v1.GetClusterRequest) 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.alloydb.v1.GetClusterRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.GetClusterRequest 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.alloydb.v1.GetClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.GetClusterRequest 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.alloydb.v1.GetClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.GetClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.GetClusterRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.GetClusterRequest 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.alloydb.v1.GetClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.GetClusterRequest 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.alloydb.v1.GetClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.GetClusterRequest 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.alloydb.v1.GetClusterRequest 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; + } + /** + * + * + *
+   * Message for getting a Cluster
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.GetClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.GetClusterRequest) + com.google.cloud.alloydb.v1.GetClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.GetClusterRequest.class, + com.google.cloud.alloydb.v1.GetClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.GetClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.GetClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.GetClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.GetClusterRequest build() { + com.google.cloud.alloydb.v1.GetClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.GetClusterRequest buildPartial() { + com.google.cloud.alloydb.v1.GetClusterRequest result = + new com.google.cloud.alloydb.v1.GetClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.GetClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.alloydb.v1.GetClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.GetClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.GetClusterRequest other) { + if (other == com.google.cloud.alloydb.v1.GetClusterRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + 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(); + bitField0_ |= 0x00000001; + 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.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + 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.alloydb.v1.GetClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.GetClusterRequest) + private static final com.google.cloud.alloydb.v1.GetClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.GetClusterRequest(); + } + + public static com.google.cloud.alloydb.v1.GetClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetClusterRequest 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.alloydb.v1.GetClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetClusterRequestOrBuilder.java new file mode 100644 index 000000000000..a5eb9232da49 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetClusterRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface GetClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.GetClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetInstanceRequest.java new file mode 100644 index 000000000000..0eb3a46b6c40 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetInstanceRequest.java @@ -0,0 +1,797 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for getting a Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.GetInstanceRequest} + */ +public final class GetInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.GetInstanceRequest) + GetInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetInstanceRequest.newBuilder() to construct. + private GetInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetInstanceRequest() { + name_ = ""; + view_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetInstanceRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.GetInstanceRequest.class, + com.google.cloud.alloydb.v1.GetInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 VIEW_FIELD_NUMBER = 2; + private int view_ = 0; + /** + * + * + *
+   * The view of the instance to return.
+   * 
+ * + * .google.cloud.alloydb.v1.InstanceView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * The view of the instance to return.
+   * 
+ * + * .google.cloud.alloydb.v1.InstanceView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.InstanceView getView() { + com.google.cloud.alloydb.v1.InstanceView result = + com.google.cloud.alloydb.v1.InstanceView.forNumber(view_); + return result == null ? com.google.cloud.alloydb.v1.InstanceView.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 (view_ != com.google.cloud.alloydb.v1.InstanceView.INSTANCE_VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(2, view_); + } + 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 (view_ != com.google.cloud.alloydb.v1.InstanceView.INSTANCE_VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } + 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.alloydb.v1.GetInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.GetInstanceRequest other = + (com.google.cloud.alloydb.v1.GetInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (view_ != other.view_) 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) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.GetInstanceRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.GetInstanceRequest 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.alloydb.v1.GetInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.GetInstanceRequest 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.alloydb.v1.GetInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.GetInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.GetInstanceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.GetInstanceRequest 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.alloydb.v1.GetInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.GetInstanceRequest 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.alloydb.v1.GetInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.GetInstanceRequest 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.alloydb.v1.GetInstanceRequest 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; + } + /** + * + * + *
+   * Message for getting a Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.GetInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.GetInstanceRequest) + com.google.cloud.alloydb.v1.GetInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.GetInstanceRequest.class, + com.google.cloud.alloydb.v1.GetInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.GetInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + view_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.GetInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.GetInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.GetInstanceRequest build() { + com.google.cloud.alloydb.v1.GetInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.GetInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1.GetInstanceRequest result = + new com.google.cloud.alloydb.v1.GetInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.GetInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.view_ = view_; + } + } + + @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.alloydb.v1.GetInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.GetInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.GetInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1.GetInstanceRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + view_ = input.readEnum(); + 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 java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int view_ = 0; + /** + * + * + *
+     * The view of the instance to return.
+     * 
+ * + * .google.cloud.alloydb.v1.InstanceView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * The view of the instance to return.
+     * 
+ * + * .google.cloud.alloydb.v1.InstanceView view = 2; + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + view_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The view of the instance to return.
+     * 
+ * + * .google.cloud.alloydb.v1.InstanceView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.InstanceView getView() { + com.google.cloud.alloydb.v1.InstanceView result = + com.google.cloud.alloydb.v1.InstanceView.forNumber(view_); + return result == null ? com.google.cloud.alloydb.v1.InstanceView.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The view of the instance to return.
+     * 
+ * + * .google.cloud.alloydb.v1.InstanceView view = 2; + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.alloydb.v1.InstanceView value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The view of the instance to return.
+     * 
+ * + * .google.cloud.alloydb.v1.InstanceView view = 2; + * + * @return This builder for chaining. + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000002); + view_ = 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.alloydb.v1.GetInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.GetInstanceRequest) + private static final com.google.cloud.alloydb.v1.GetInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.GetInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1.GetInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetInstanceRequest 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.alloydb.v1.GetInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..042314b4875e --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetInstanceRequestOrBuilder.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/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface GetInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.GetInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The view of the instance to return.
+   * 
+ * + * .google.cloud.alloydb.v1.InstanceView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * The view of the instance to return.
+   * 
+ * + * .google.cloud.alloydb.v1.InstanceView view = 2; + * + * @return The view. + */ + com.google.cloud.alloydb.v1.InstanceView getView(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Instance.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Instance.java new file mode 100644 index 000000000000..920a6d3d4ad2 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Instance.java @@ -0,0 +1,9999 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * An Instance is a computing unit that an end customer can connect to.
+ * It's the main unit of computing resources in AlloyDB.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Instance} + */ +public final class Instance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.Instance) + InstanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Instance.newBuilder() to construct. + private Instance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Instance() { + name_ = ""; + displayName_ = ""; + uid_ = ""; + state_ = 0; + instanceType_ = 0; + availabilityType_ = 0; + gceZone_ = ""; + nodes_ = java.util.Collections.emptyList(); + ipAddress_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Instance(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + case 13: + return internalGetDatabaseFlags(); + case 18: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Instance.class, + com.google.cloud.alloydb.v1.Instance.Builder.class); + } + + /** + * + * + *
+   * Instance State
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.Instance.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The instance is active and running.
+     * 
+ * + * READY = 1; + */ + READY(1), + /** + * + * + *
+     * The instance is stopped. Instance name and IP resources are preserved.
+     * 
+ * + * STOPPED = 2; + */ + STOPPED(2), + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 3; + */ + CREATING(3), + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + /** + * + * + *
+     * The instance is down for maintenance.
+     * 
+ * + * MAINTENANCE = 5; + */ + MAINTENANCE(5), + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * an operation on the instance.
+     * Note: Instances in this state would tried to be auto-repaired. And
+     * Customers should be able to restart, update or delete these instances.
+     * 
+ * + * FAILED = 6; + */ + FAILED(6), + /** + * + * + *
+     * Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that
+     * index unused in case that state also needs to exposed via consumer apis
+     * in future.
+     * The instance has been configured to sync data from some other source.
+     * 
+ * + * BOOTSTRAPPING = 8; + */ + BOOTSTRAPPING(8), + /** + * + * + *
+     * The instance is being promoted.
+     * 
+ * + * PROMOTING = 9; + */ + PROMOTING(9), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The instance is active and running.
+     * 
+ * + * READY = 1; + */ + public static final int READY_VALUE = 1; + /** + * + * + *
+     * The instance is stopped. Instance name and IP resources are preserved.
+     * 
+ * + * STOPPED = 2; + */ + public static final int STOPPED_VALUE = 2; + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 3; + */ + public static final int CREATING_VALUE = 3; + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + /** + * + * + *
+     * The instance is down for maintenance.
+     * 
+ * + * MAINTENANCE = 5; + */ + public static final int MAINTENANCE_VALUE = 5; + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * an operation on the instance.
+     * Note: Instances in this state would tried to be auto-repaired. And
+     * Customers should be able to restart, update or delete these instances.
+     * 
+ * + * FAILED = 6; + */ + public static final int FAILED_VALUE = 6; + /** + * + * + *
+     * Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that
+     * index unused in case that state also needs to exposed via consumer apis
+     * in future.
+     * The instance has been configured to sync data from some other source.
+     * 
+ * + * BOOTSTRAPPING = 8; + */ + public static final int BOOTSTRAPPING_VALUE = 8; + /** + * + * + *
+     * The instance is being promoted.
+     * 
+ * + * PROMOTING = 9; + */ + public static final int PROMOTING_VALUE = 9; + + 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 READY; + case 2: + return STOPPED; + case 3: + return CREATING; + case 4: + return DELETING; + case 5: + return MAINTENANCE; + case 6: + return FAILED; + case 8: + return BOOTSTRAPPING; + case 9: + return PROMOTING; + 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.alloydb.v1.Instance.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.alloydb.v1.Instance.State) + } + + /** + * + * + *
+   * Type of an Instance
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.Instance.InstanceType} + */ + public enum InstanceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The type of the instance is unknown.
+     * 
+ * + * INSTANCE_TYPE_UNSPECIFIED = 0; + */ + INSTANCE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * PRIMARY instances support read and write operations.
+     * 
+ * + * PRIMARY = 1; + */ + PRIMARY(1), + /** + * + * + *
+     * READ POOL instances support read operations only. Each read pool instance
+     * consists of one or more homogeneous nodes.
+     *  * Read pool of size 1 can only have zonal availability.
+     *  * Read pools with node count of 2 or more can have regional
+     *    availability (nodes are present in 2 or more zones in a region).
+     * 
+ * + * READ_POOL = 2; + */ + READ_POOL(2), + /** + * + * + *
+     * SECONDARY instances support read operations only. SECONDARY instance
+     * is a cross-region read replica
+     * 
+ * + * SECONDARY = 3; + */ + SECONDARY(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The type of the instance is unknown.
+     * 
+ * + * INSTANCE_TYPE_UNSPECIFIED = 0; + */ + public static final int INSTANCE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * PRIMARY instances support read and write operations.
+     * 
+ * + * PRIMARY = 1; + */ + public static final int PRIMARY_VALUE = 1; + /** + * + * + *
+     * READ POOL instances support read operations only. Each read pool instance
+     * consists of one or more homogeneous nodes.
+     *  * Read pool of size 1 can only have zonal availability.
+     *  * Read pools with node count of 2 or more can have regional
+     *    availability (nodes are present in 2 or more zones in a region).
+     * 
+ * + * READ_POOL = 2; + */ + public static final int READ_POOL_VALUE = 2; + /** + * + * + *
+     * SECONDARY instances support read operations only. SECONDARY instance
+     * is a cross-region read replica
+     * 
+ * + * SECONDARY = 3; + */ + public static final int SECONDARY_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 InstanceType 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 InstanceType forNumber(int value) { + switch (value) { + case 0: + return INSTANCE_TYPE_UNSPECIFIED; + case 1: + return PRIMARY; + case 2: + return READ_POOL; + case 3: + return SECONDARY; + 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 InstanceType findValueByNumber(int number) { + return InstanceType.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.alloydb.v1.Instance.getDescriptor().getEnumTypes().get(1); + } + + private static final InstanceType[] VALUES = values(); + + public static InstanceType 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 InstanceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1.Instance.InstanceType) + } + + /** + * + * + *
+   * The Availability type of an instance. Potential values:
+   *   <br><b>ZONAL</b>: The instance serves data from only one zone.
+   * Outages in that zone affect instance availability.
+   *   <br><b>REGIONAL</b>: The instance can serve data from more than one zone
+   *   in a region (it is highly available).
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.Instance.AvailabilityType} + */ + public enum AvailabilityType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * This is an unknown Availability type.
+     * 
+ * + * AVAILABILITY_TYPE_UNSPECIFIED = 0; + */ + AVAILABILITY_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Zonal available instance.
+     * 
+ * + * ZONAL = 1; + */ + ZONAL(1), + /** + * + * + *
+     * Regional (or Highly) available instance.
+     * 
+ * + * REGIONAL = 2; + */ + REGIONAL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * This is an unknown Availability type.
+     * 
+ * + * AVAILABILITY_TYPE_UNSPECIFIED = 0; + */ + public static final int AVAILABILITY_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Zonal available instance.
+     * 
+ * + * ZONAL = 1; + */ + public static final int ZONAL_VALUE = 1; + /** + * + * + *
+     * Regional (or Highly) available instance.
+     * 
+ * + * REGIONAL = 2; + */ + public static final int REGIONAL_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 AvailabilityType 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 AvailabilityType forNumber(int value) { + switch (value) { + case 0: + return AVAILABILITY_TYPE_UNSPECIFIED; + case 1: + return ZONAL; + case 2: + return REGIONAL; + 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 AvailabilityType findValueByNumber(int number) { + return AvailabilityType.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.alloydb.v1.Instance.getDescriptor().getEnumTypes().get(2); + } + + private static final AvailabilityType[] VALUES = values(); + + public static AvailabilityType 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 AvailabilityType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1.Instance.AvailabilityType) + } + + public interface MachineConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.Instance.MachineConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The number of CPU's in the VM instance.
+     * 
+ * + * int32 cpu_count = 1; + * + * @return The cpuCount. + */ + int getCpuCount(); + } + /** + * + * + *
+   * MachineConfig describes the configuration of a machine.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Instance.MachineConfig} + */ + public static final class MachineConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.Instance.MachineConfig) + MachineConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use MachineConfig.newBuilder() to construct. + private MachineConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MachineConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MachineConfig(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_MachineConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_MachineConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Instance.MachineConfig.class, + com.google.cloud.alloydb.v1.Instance.MachineConfig.Builder.class); + } + + public static final int CPU_COUNT_FIELD_NUMBER = 1; + private int cpuCount_ = 0; + /** + * + * + *
+     * The number of CPU's in the VM instance.
+     * 
+ * + * int32 cpu_count = 1; + * + * @return The cpuCount. + */ + @java.lang.Override + public int getCpuCount() { + return cpuCount_; + } + + 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 (cpuCount_ != 0) { + output.writeInt32(1, cpuCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (cpuCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, cpuCount_); + } + 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.alloydb.v1.Instance.MachineConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.Instance.MachineConfig other = + (com.google.cloud.alloydb.v1.Instance.MachineConfig) obj; + + if (getCpuCount() != other.getCpuCount()) 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) + CPU_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getCpuCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.Instance.MachineConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Instance.MachineConfig 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.alloydb.v1.Instance.MachineConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Instance.MachineConfig 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.alloydb.v1.Instance.MachineConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Instance.MachineConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.Instance.MachineConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Instance.MachineConfig 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.alloydb.v1.Instance.MachineConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Instance.MachineConfig 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.alloydb.v1.Instance.MachineConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Instance.MachineConfig 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.alloydb.v1.Instance.MachineConfig 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; + } + /** + * + * + *
+     * MachineConfig describes the configuration of a machine.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Instance.MachineConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.Instance.MachineConfig) + com.google.cloud.alloydb.v1.Instance.MachineConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_MachineConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_MachineConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Instance.MachineConfig.class, + com.google.cloud.alloydb.v1.Instance.MachineConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.Instance.MachineConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cpuCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_MachineConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.MachineConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.Instance.MachineConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.MachineConfig build() { + com.google.cloud.alloydb.v1.Instance.MachineConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.MachineConfig buildPartial() { + com.google.cloud.alloydb.v1.Instance.MachineConfig result = + new com.google.cloud.alloydb.v1.Instance.MachineConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.Instance.MachineConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cpuCount_ = cpuCount_; + } + } + + @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.alloydb.v1.Instance.MachineConfig) { + return mergeFrom((com.google.cloud.alloydb.v1.Instance.MachineConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.Instance.MachineConfig other) { + if (other == com.google.cloud.alloydb.v1.Instance.MachineConfig.getDefaultInstance()) + return this; + if (other.getCpuCount() != 0) { + setCpuCount(other.getCpuCount()); + } + 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: + { + cpuCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + 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 bitField0_; + + private int cpuCount_; + /** + * + * + *
+       * The number of CPU's in the VM instance.
+       * 
+ * + * int32 cpu_count = 1; + * + * @return The cpuCount. + */ + @java.lang.Override + public int getCpuCount() { + return cpuCount_; + } + /** + * + * + *
+       * The number of CPU's in the VM instance.
+       * 
+ * + * int32 cpu_count = 1; + * + * @param value The cpuCount to set. + * @return This builder for chaining. + */ + public Builder setCpuCount(int value) { + + cpuCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The number of CPU's in the VM instance.
+       * 
+ * + * int32 cpu_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearCpuCount() { + bitField0_ = (bitField0_ & ~0x00000001); + cpuCount_ = 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.alloydb.v1.Instance.MachineConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.Instance.MachineConfig) + private static final com.google.cloud.alloydb.v1.Instance.MachineConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.Instance.MachineConfig(); + } + + public static com.google.cloud.alloydb.v1.Instance.MachineConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MachineConfig 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.alloydb.v1.Instance.MachineConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface NodeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.Instance.Node) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The Compute Engine zone of the VM e.g. "us-central1-b".
+     * 
+ * + * string zone_id = 1; + * + * @return The zoneId. + */ + java.lang.String getZoneId(); + /** + * + * + *
+     * The Compute Engine zone of the VM e.g. "us-central1-b".
+     * 
+ * + * string zone_id = 1; + * + * @return The bytes for zoneId. + */ + com.google.protobuf.ByteString getZoneIdBytes(); + + /** + * + * + *
+     * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+     * 
+ * + * string id = 2; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+     * 
+ * + * string id = 2; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * The private IP address of the VM e.g. "10.57.0.34".
+     * 
+ * + * string ip = 3; + * + * @return The ip. + */ + java.lang.String getIp(); + /** + * + * + *
+     * The private IP address of the VM e.g. "10.57.0.34".
+     * 
+ * + * string ip = 3; + * + * @return The bytes for ip. + */ + com.google.protobuf.ByteString getIpBytes(); + + /** + * + * + *
+     * Determined by state of the compute VM and postgres-service health.
+     * Compute VM state can have values listed in
+     * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+     * postgres-service health can have values: HEALTHY and UNHEALTHY.
+     * 
+ * + * string state = 4; + * + * @return The state. + */ + java.lang.String getState(); + /** + * + * + *
+     * Determined by state of the compute VM and postgres-service health.
+     * Compute VM state can have values listed in
+     * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+     * postgres-service health can have values: HEALTHY and UNHEALTHY.
+     * 
+ * + * string state = 4; + * + * @return The bytes for state. + */ + com.google.protobuf.ByteString getStateBytes(); + } + /** + * + * + *
+   * Details of a single node in the instance.
+   * Nodes in an AlloyDB instance are ephemereal, they can change during
+   * update, failover, autohealing and resize operations.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Instance.Node} + */ + public static final class Node extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.Instance.Node) + NodeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Node.newBuilder() to construct. + private Node(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Node() { + zoneId_ = ""; + id_ = ""; + ip_ = ""; + state_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Node(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_Node_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Instance.Node.class, + com.google.cloud.alloydb.v1.Instance.Node.Builder.class); + } + + public static final int ZONE_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object zoneId_ = ""; + /** + * + * + *
+     * The Compute Engine zone of the VM e.g. "us-central1-b".
+     * 
+ * + * string zone_id = 1; + * + * @return The zoneId. + */ + @java.lang.Override + public java.lang.String getZoneId() { + java.lang.Object ref = zoneId_; + 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(); + zoneId_ = s; + return s; + } + } + /** + * + * + *
+     * The Compute Engine zone of the VM e.g. "us-central1-b".
+     * 
+ * + * string zone_id = 1; + * + * @return The bytes for zoneId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getZoneIdBytes() { + java.lang.Object ref = zoneId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zoneId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+     * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+     * 
+ * + * string id = 2; + * + * @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; + } + } + /** + * + * + *
+     * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+     * 
+ * + * string id = 2; + * + * @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 IP_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object ip_ = ""; + /** + * + * + *
+     * The private IP address of the VM e.g. "10.57.0.34".
+     * 
+ * + * string ip = 3; + * + * @return The ip. + */ + @java.lang.Override + public java.lang.String getIp() { + java.lang.Object ref = ip_; + 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(); + ip_ = s; + return s; + } + } + /** + * + * + *
+     * The private IP address of the VM e.g. "10.57.0.34".
+     * 
+ * + * string ip = 3; + * + * @return The bytes for ip. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpBytes() { + java.lang.Object ref = ip_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ip_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object state_ = ""; + /** + * + * + *
+     * Determined by state of the compute VM and postgres-service health.
+     * Compute VM state can have values listed in
+     * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+     * postgres-service health can have values: HEALTHY and UNHEALTHY.
+     * 
+ * + * string state = 4; + * + * @return The state. + */ + @java.lang.Override + public java.lang.String getState() { + java.lang.Object ref = state_; + 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(); + state_ = s; + return s; + } + } + /** + * + * + *
+     * Determined by state of the compute VM and postgres-service health.
+     * Compute VM state can have values listed in
+     * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+     * postgres-service health can have values: HEALTHY and UNHEALTHY.
+     * 
+ * + * string state = 4; + * + * @return The bytes for state. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStateBytes() { + java.lang.Object ref = state_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + state_ = 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(zoneId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, zoneId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ip_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, ip_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(state_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, 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(zoneId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, zoneId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ip_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, ip_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(state_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, 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.alloydb.v1.Instance.Node)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.Instance.Node other = + (com.google.cloud.alloydb.v1.Instance.Node) obj; + + if (!getZoneId().equals(other.getZoneId())) return false; + if (!getId().equals(other.getId())) return false; + if (!getIp().equals(other.getIp())) return false; + if (!getState().equals(other.getState())) 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) + ZONE_ID_FIELD_NUMBER; + hash = (53 * hash) + getZoneId().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + IP_FIELD_NUMBER; + hash = (53 * hash) + getIp().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + getState().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.Instance.Node parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Instance.Node 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.alloydb.v1.Instance.Node parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Instance.Node 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.alloydb.v1.Instance.Node parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Instance.Node parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.Instance.Node parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Instance.Node 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.alloydb.v1.Instance.Node parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Instance.Node 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.alloydb.v1.Instance.Node parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Instance.Node 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.alloydb.v1.Instance.Node 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; + } + /** + * + * + *
+     * Details of a single node in the instance.
+     * Nodes in an AlloyDB instance are ephemereal, they can change during
+     * update, failover, autohealing and resize operations.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Instance.Node} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.Instance.Node) + com.google.cloud.alloydb.v1.Instance.NodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_Node_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Instance.Node.class, + com.google.cloud.alloydb.v1.Instance.Node.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.Instance.Node.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + zoneId_ = ""; + id_ = ""; + ip_ = ""; + state_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_Node_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.Node getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.Instance.Node.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.Node build() { + com.google.cloud.alloydb.v1.Instance.Node result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.Node buildPartial() { + com.google.cloud.alloydb.v1.Instance.Node result = + new com.google.cloud.alloydb.v1.Instance.Node(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.Instance.Node result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.zoneId_ = zoneId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ip_ = ip_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.state_ = state_; + } + } + + @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.alloydb.v1.Instance.Node) { + return mergeFrom((com.google.cloud.alloydb.v1.Instance.Node) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.Instance.Node other) { + if (other == com.google.cloud.alloydb.v1.Instance.Node.getDefaultInstance()) return this; + if (!other.getZoneId().isEmpty()) { + zoneId_ = other.zoneId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getIp().isEmpty()) { + ip_ = other.ip_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getState().isEmpty()) { + state_ = other.state_; + bitField0_ |= 0x00000008; + 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: + { + zoneId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + ip_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + state_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object zoneId_ = ""; + /** + * + * + *
+       * The Compute Engine zone of the VM e.g. "us-central1-b".
+       * 
+ * + * string zone_id = 1; + * + * @return The zoneId. + */ + public java.lang.String getZoneId() { + java.lang.Object ref = zoneId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + zoneId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The Compute Engine zone of the VM e.g. "us-central1-b".
+       * 
+ * + * string zone_id = 1; + * + * @return The bytes for zoneId. + */ + public com.google.protobuf.ByteString getZoneIdBytes() { + java.lang.Object ref = zoneId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zoneId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The Compute Engine zone of the VM e.g. "us-central1-b".
+       * 
+ * + * string zone_id = 1; + * + * @param value The zoneId to set. + * @return This builder for chaining. + */ + public Builder setZoneId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + zoneId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The Compute Engine zone of the VM e.g. "us-central1-b".
+       * 
+ * + * string zone_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearZoneId() { + zoneId_ = getDefaultInstance().getZoneId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The Compute Engine zone of the VM e.g. "us-central1-b".
+       * 
+ * + * string zone_id = 1; + * + * @param value The bytes for zoneId to set. + * @return This builder for chaining. + */ + public Builder setZoneIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + zoneId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+       * 
+ * + * string id = 2; + * + * @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; + } + } + /** + * + * + *
+       * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+       * 
+ * + * string id = 2; + * + * @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; + } + } + /** + * + * + *
+       * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+       * 
+ * + * string id = 2; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+       * 
+ * + * string id = 2; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+       * 
+ * + * string id = 2; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object ip_ = ""; + /** + * + * + *
+       * The private IP address of the VM e.g. "10.57.0.34".
+       * 
+ * + * string ip = 3; + * + * @return The ip. + */ + public java.lang.String getIp() { + java.lang.Object ref = ip_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ip_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The private IP address of the VM e.g. "10.57.0.34".
+       * 
+ * + * string ip = 3; + * + * @return The bytes for ip. + */ + public com.google.protobuf.ByteString getIpBytes() { + java.lang.Object ref = ip_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ip_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The private IP address of the VM e.g. "10.57.0.34".
+       * 
+ * + * string ip = 3; + * + * @param value The ip to set. + * @return This builder for chaining. + */ + public Builder setIp(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ip_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * The private IP address of the VM e.g. "10.57.0.34".
+       * 
+ * + * string ip = 3; + * + * @return This builder for chaining. + */ + public Builder clearIp() { + ip_ = getDefaultInstance().getIp(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * The private IP address of the VM e.g. "10.57.0.34".
+       * 
+ * + * string ip = 3; + * + * @param value The bytes for ip to set. + * @return This builder for chaining. + */ + public Builder setIpBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ip_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object state_ = ""; + /** + * + * + *
+       * Determined by state of the compute VM and postgres-service health.
+       * Compute VM state can have values listed in
+       * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+       * postgres-service health can have values: HEALTHY and UNHEALTHY.
+       * 
+ * + * string state = 4; + * + * @return The state. + */ + public java.lang.String getState() { + java.lang.Object ref = state_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + state_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Determined by state of the compute VM and postgres-service health.
+       * Compute VM state can have values listed in
+       * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+       * postgres-service health can have values: HEALTHY and UNHEALTHY.
+       * 
+ * + * string state = 4; + * + * @return The bytes for state. + */ + public com.google.protobuf.ByteString getStateBytes() { + java.lang.Object ref = state_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + state_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Determined by state of the compute VM and postgres-service health.
+       * Compute VM state can have values listed in
+       * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+       * postgres-service health can have values: HEALTHY and UNHEALTHY.
+       * 
+ * + * string state = 4; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + state_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Determined by state of the compute VM and postgres-service health.
+       * Compute VM state can have values listed in
+       * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+       * postgres-service health can have values: HEALTHY and UNHEALTHY.
+       * 
+ * + * string state = 4; + * + * @return This builder for chaining. + */ + public Builder clearState() { + state_ = getDefaultInstance().getState(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+       * Determined by state of the compute VM and postgres-service health.
+       * Compute VM state can have values listed in
+       * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+       * postgres-service health can have values: HEALTHY and UNHEALTHY.
+       * 
+ * + * string state = 4; + * + * @param value The bytes for state to set. + * @return This builder for chaining. + */ + public Builder setStateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + state_ = value; + bitField0_ |= 0x00000008; + 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.alloydb.v1.Instance.Node) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.Instance.Node) + private static final com.google.cloud.alloydb.v1.Instance.Node DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.Instance.Node(); + } + + public static com.google.cloud.alloydb.v1.Instance.Node getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Node 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.alloydb.v1.Instance.Node getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryInsightsInstanceConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Record application tags for an instance.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_application_tags = 2; + * + * @return Whether the recordApplicationTags field is set. + */ + boolean hasRecordApplicationTags(); + /** + * + * + *
+     * Record application tags for an instance.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_application_tags = 2; + * + * @return The recordApplicationTags. + */ + boolean getRecordApplicationTags(); + + /** + * + * + *
+     * Record client address for an instance. Client address is PII information.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_client_address = 3; + * + * @return Whether the recordClientAddress field is set. + */ + boolean hasRecordClientAddress(); + /** + * + * + *
+     * Record client address for an instance. Client address is PII information.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_client_address = 3; + * + * @return The recordClientAddress. + */ + boolean getRecordClientAddress(); + + /** + * + * + *
+     * Query string length. The default value is 1024.
+     * Any integer between 256 and 4500 is considered valid.
+     * 
+ * + * uint32 query_string_length = 4; + * + * @return The queryStringLength. + */ + int getQueryStringLength(); + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. The default value is 5.
+     * Any integer between 0 and 20 is considered valid.
+     * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return Whether the queryPlansPerMinute field is set. + */ + boolean hasQueryPlansPerMinute(); + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. The default value is 5.
+     * Any integer between 0 and 20 is considered valid.
+     * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return The queryPlansPerMinute. + */ + int getQueryPlansPerMinute(); + } + /** + * + * + *
+   * QueryInsights Instance specific configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} + */ + public static final class QueryInsightsInstanceConfig + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig) + QueryInsightsInstanceConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryInsightsInstanceConfig.newBuilder() to construct. + private QueryInsightsInstanceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryInsightsInstanceConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryInsightsInstanceConfig(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_QueryInsightsInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_QueryInsightsInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.class, + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.Builder.class); + } + + private int bitField0_; + public static final int RECORD_APPLICATION_TAGS_FIELD_NUMBER = 2; + private boolean recordApplicationTags_ = false; + /** + * + * + *
+     * Record application tags for an instance.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_application_tags = 2; + * + * @return Whether the recordApplicationTags field is set. + */ + @java.lang.Override + public boolean hasRecordApplicationTags() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Record application tags for an instance.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_application_tags = 2; + * + * @return The recordApplicationTags. + */ + @java.lang.Override + public boolean getRecordApplicationTags() { + return recordApplicationTags_; + } + + public static final int RECORD_CLIENT_ADDRESS_FIELD_NUMBER = 3; + private boolean recordClientAddress_ = false; + /** + * + * + *
+     * Record client address for an instance. Client address is PII information.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_client_address = 3; + * + * @return Whether the recordClientAddress field is set. + */ + @java.lang.Override + public boolean hasRecordClientAddress() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Record client address for an instance. Client address is PII information.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_client_address = 3; + * + * @return The recordClientAddress. + */ + @java.lang.Override + public boolean getRecordClientAddress() { + return recordClientAddress_; + } + + public static final int QUERY_STRING_LENGTH_FIELD_NUMBER = 4; + private int queryStringLength_ = 0; + /** + * + * + *
+     * Query string length. The default value is 1024.
+     * Any integer between 256 and 4500 is considered valid.
+     * 
+ * + * uint32 query_string_length = 4; + * + * @return The queryStringLength. + */ + @java.lang.Override + public int getQueryStringLength() { + return queryStringLength_; + } + + public static final int QUERY_PLANS_PER_MINUTE_FIELD_NUMBER = 5; + private int queryPlansPerMinute_ = 0; + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. The default value is 5.
+     * Any integer between 0 and 20 is considered valid.
+     * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return Whether the queryPlansPerMinute field is set. + */ + @java.lang.Override + public boolean hasQueryPlansPerMinute() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. The default value is 5.
+     * Any integer between 0 and 20 is considered valid.
+     * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return The queryPlansPerMinute. + */ + @java.lang.Override + public int getQueryPlansPerMinute() { + return queryPlansPerMinute_; + } + + 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(2, recordApplicationTags_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(3, recordClientAddress_); + } + if (queryStringLength_ != 0) { + output.writeUInt32(4, queryStringLength_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeUInt32(5, queryPlansPerMinute_); + } + 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(2, recordApplicationTags_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, recordClientAddress_); + } + if (queryStringLength_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(4, queryStringLength_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(5, queryPlansPerMinute_); + } + 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.alloydb.v1.Instance.QueryInsightsInstanceConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig other = + (com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig) obj; + + if (hasRecordApplicationTags() != other.hasRecordApplicationTags()) return false; + if (hasRecordApplicationTags()) { + if (getRecordApplicationTags() != other.getRecordApplicationTags()) return false; + } + if (hasRecordClientAddress() != other.hasRecordClientAddress()) return false; + if (hasRecordClientAddress()) { + if (getRecordClientAddress() != other.getRecordClientAddress()) return false; + } + if (getQueryStringLength() != other.getQueryStringLength()) return false; + if (hasQueryPlansPerMinute() != other.hasQueryPlansPerMinute()) return false; + if (hasQueryPlansPerMinute()) { + if (getQueryPlansPerMinute() != other.getQueryPlansPerMinute()) 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 (hasRecordApplicationTags()) { + hash = (37 * hash) + RECORD_APPLICATION_TAGS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRecordApplicationTags()); + } + if (hasRecordClientAddress()) { + hash = (37 * hash) + RECORD_CLIENT_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRecordClientAddress()); + } + hash = (37 * hash) + QUERY_STRING_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getQueryStringLength(); + if (hasQueryPlansPerMinute()) { + hash = (37 * hash) + QUERY_PLANS_PER_MINUTE_FIELD_NUMBER; + hash = (53 * hash) + getQueryPlansPerMinute(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig 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.alloydb.v1.Instance.QueryInsightsInstanceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig 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.alloydb.v1.Instance.QueryInsightsInstanceConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig 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.alloydb.v1.Instance.QueryInsightsInstanceConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + 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.alloydb.v1.Instance.QueryInsightsInstanceConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig 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.alloydb.v1.Instance.QueryInsightsInstanceConfig 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; + } + /** + * + * + *
+     * QueryInsights Instance specific configuration.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig) + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_QueryInsightsInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_QueryInsightsInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.class, + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.Builder.class); + } + + // Construct using + // com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + recordApplicationTags_ = false; + recordClientAddress_ = false; + queryStringLength_ = 0; + queryPlansPerMinute_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_QueryInsightsInstanceConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig build() { + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig buildPartial() { + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig result = + new com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.recordApplicationTags_ = recordApplicationTags_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.recordClientAddress_ = recordClientAddress_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.queryStringLength_ = queryStringLength_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.queryPlansPerMinute_ = queryPlansPerMinute_; + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @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.alloydb.v1.Instance.QueryInsightsInstanceConfig) { + return mergeFrom( + (com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig other) { + if (other + == com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + .getDefaultInstance()) return this; + if (other.hasRecordApplicationTags()) { + setRecordApplicationTags(other.getRecordApplicationTags()); + } + if (other.hasRecordClientAddress()) { + setRecordClientAddress(other.getRecordClientAddress()); + } + if (other.getQueryStringLength() != 0) { + setQueryStringLength(other.getQueryStringLength()); + } + if (other.hasQueryPlansPerMinute()) { + setQueryPlansPerMinute(other.getQueryPlansPerMinute()); + } + 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 16: + { + recordApplicationTags_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 16 + case 24: + { + recordClientAddress_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 24 + case 32: + { + queryStringLength_ = input.readUInt32(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 40: + { + queryPlansPerMinute_ = input.readUInt32(); + bitField0_ |= 0x00000008; + break; + } // case 40 + 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 recordApplicationTags_; + /** + * + * + *
+       * Record application tags for an instance.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_application_tags = 2; + * + * @return Whether the recordApplicationTags field is set. + */ + @java.lang.Override + public boolean hasRecordApplicationTags() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Record application tags for an instance.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_application_tags = 2; + * + * @return The recordApplicationTags. + */ + @java.lang.Override + public boolean getRecordApplicationTags() { + return recordApplicationTags_; + } + /** + * + * + *
+       * Record application tags for an instance.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_application_tags = 2; + * + * @param value The recordApplicationTags to set. + * @return This builder for chaining. + */ + public Builder setRecordApplicationTags(boolean value) { + + recordApplicationTags_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Record application tags for an instance.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_application_tags = 2; + * + * @return This builder for chaining. + */ + public Builder clearRecordApplicationTags() { + bitField0_ = (bitField0_ & ~0x00000001); + recordApplicationTags_ = false; + onChanged(); + return this; + } + + private boolean recordClientAddress_; + /** + * + * + *
+       * Record client address for an instance. Client address is PII information.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_client_address = 3; + * + * @return Whether the recordClientAddress field is set. + */ + @java.lang.Override + public boolean hasRecordClientAddress() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Record client address for an instance. Client address is PII information.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_client_address = 3; + * + * @return The recordClientAddress. + */ + @java.lang.Override + public boolean getRecordClientAddress() { + return recordClientAddress_; + } + /** + * + * + *
+       * Record client address for an instance. Client address is PII information.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_client_address = 3; + * + * @param value The recordClientAddress to set. + * @return This builder for chaining. + */ + public Builder setRecordClientAddress(boolean value) { + + recordClientAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Record client address for an instance. Client address is PII information.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_client_address = 3; + * + * @return This builder for chaining. + */ + public Builder clearRecordClientAddress() { + bitField0_ = (bitField0_ & ~0x00000002); + recordClientAddress_ = false; + onChanged(); + return this; + } + + private int queryStringLength_; + /** + * + * + *
+       * Query string length. The default value is 1024.
+       * Any integer between 256 and 4500 is considered valid.
+       * 
+ * + * uint32 query_string_length = 4; + * + * @return The queryStringLength. + */ + @java.lang.Override + public int getQueryStringLength() { + return queryStringLength_; + } + /** + * + * + *
+       * Query string length. The default value is 1024.
+       * Any integer between 256 and 4500 is considered valid.
+       * 
+ * + * uint32 query_string_length = 4; + * + * @param value The queryStringLength to set. + * @return This builder for chaining. + */ + public Builder setQueryStringLength(int value) { + + queryStringLength_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Query string length. The default value is 1024.
+       * Any integer between 256 and 4500 is considered valid.
+       * 
+ * + * uint32 query_string_length = 4; + * + * @return This builder for chaining. + */ + public Builder clearQueryStringLength() { + bitField0_ = (bitField0_ & ~0x00000004); + queryStringLength_ = 0; + onChanged(); + return this; + } + + private int queryPlansPerMinute_; + /** + * + * + *
+       * Number of query execution plans captured by Insights per minute
+       * for all queries combined. The default value is 5.
+       * Any integer between 0 and 20 is considered valid.
+       * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return Whether the queryPlansPerMinute field is set. + */ + @java.lang.Override + public boolean hasQueryPlansPerMinute() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+       * Number of query execution plans captured by Insights per minute
+       * for all queries combined. The default value is 5.
+       * Any integer between 0 and 20 is considered valid.
+       * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return The queryPlansPerMinute. + */ + @java.lang.Override + public int getQueryPlansPerMinute() { + return queryPlansPerMinute_; + } + /** + * + * + *
+       * Number of query execution plans captured by Insights per minute
+       * for all queries combined. The default value is 5.
+       * Any integer between 0 and 20 is considered valid.
+       * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @param value The queryPlansPerMinute to set. + * @return This builder for chaining. + */ + public Builder setQueryPlansPerMinute(int value) { + + queryPlansPerMinute_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Number of query execution plans captured by Insights per minute
+       * for all queries combined. The default value is 5.
+       * Any integer between 0 and 20 is considered valid.
+       * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return This builder for chaining. + */ + public Builder clearQueryPlansPerMinute() { + bitField0_ = (bitField0_ & ~0x00000008); + queryPlansPerMinute_ = 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.alloydb.v1.Instance.QueryInsightsInstanceConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig) + private static final com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig(); + } + + public static com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryInsightsInstanceConfig 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.alloydb.v1.Instance.QueryInsightsInstanceConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ReadPoolConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.Instance.ReadPoolConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Read capacity, i.e. number of nodes in a read pool instance.
+     * 
+ * + * int32 node_count = 1; + * + * @return The nodeCount. + */ + int getNodeCount(); + } + /** + * + * + *
+   * Configuration for a read pool instance.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Instance.ReadPoolConfig} + */ + public static final class ReadPoolConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.Instance.ReadPoolConfig) + ReadPoolConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadPoolConfig.newBuilder() to construct. + private ReadPoolConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadPoolConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReadPoolConfig(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_ReadPoolConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_ReadPoolConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.class, + com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.Builder.class); + } + + public static final int NODE_COUNT_FIELD_NUMBER = 1; + private int nodeCount_ = 0; + /** + * + * + *
+     * Read capacity, i.e. number of nodes in a read pool instance.
+     * 
+ * + * int32 node_count = 1; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + + 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 (nodeCount_ != 0) { + output.writeInt32(1, nodeCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (nodeCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, nodeCount_); + } + 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.alloydb.v1.Instance.ReadPoolConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.Instance.ReadPoolConfig other = + (com.google.cloud.alloydb.v1.Instance.ReadPoolConfig) obj; + + if (getNodeCount() != other.getNodeCount()) 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) + NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getNodeCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.Instance.ReadPoolConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Instance.ReadPoolConfig 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.alloydb.v1.Instance.ReadPoolConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Instance.ReadPoolConfig 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.alloydb.v1.Instance.ReadPoolConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Instance.ReadPoolConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.Instance.ReadPoolConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Instance.ReadPoolConfig 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.alloydb.v1.Instance.ReadPoolConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Instance.ReadPoolConfig 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.alloydb.v1.Instance.ReadPoolConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Instance.ReadPoolConfig 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.alloydb.v1.Instance.ReadPoolConfig 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; + } + /** + * + * + *
+     * Configuration for a read pool instance.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Instance.ReadPoolConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.Instance.ReadPoolConfig) + com.google.cloud.alloydb.v1.Instance.ReadPoolConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_ReadPoolConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_ReadPoolConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.class, + com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + nodeCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_ReadPoolConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.ReadPoolConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.ReadPoolConfig build() { + com.google.cloud.alloydb.v1.Instance.ReadPoolConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.ReadPoolConfig buildPartial() { + com.google.cloud.alloydb.v1.Instance.ReadPoolConfig result = + new com.google.cloud.alloydb.v1.Instance.ReadPoolConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.Instance.ReadPoolConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.nodeCount_ = nodeCount_; + } + } + + @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.alloydb.v1.Instance.ReadPoolConfig) { + return mergeFrom((com.google.cloud.alloydb.v1.Instance.ReadPoolConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.Instance.ReadPoolConfig other) { + if (other == com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.getDefaultInstance()) + return this; + if (other.getNodeCount() != 0) { + setNodeCount(other.getNodeCount()); + } + 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: + { + nodeCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + 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 bitField0_; + + private int nodeCount_; + /** + * + * + *
+       * Read capacity, i.e. number of nodes in a read pool instance.
+       * 
+ * + * int32 node_count = 1; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + /** + * + * + *
+       * Read capacity, i.e. number of nodes in a read pool instance.
+       * 
+ * + * int32 node_count = 1; + * + * @param value The nodeCount to set. + * @return This builder for chaining. + */ + public Builder setNodeCount(int value) { + + nodeCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Read capacity, i.e. number of nodes in a read pool instance.
+       * 
+ * + * int32 node_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearNodeCount() { + bitField0_ = (bitField0_ & ~0x00000001); + nodeCount_ = 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.alloydb.v1.Instance.ReadPoolConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.Instance.ReadPoolConfig) + private static final com.google.cloud.alloydb.v1.Instance.ReadPoolConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.Instance.ReadPoolConfig(); + } + + public static com.google.cloud.alloydb.v1.Instance.ReadPoolConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadPoolConfig 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.alloydb.v1.Instance.ReadPoolConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The name of the instance resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+   * where the cluster and instance ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the instance resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The name of the instance resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+   * where the cluster and instance ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the instance resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * User-settable and human-readable display name for the Instance.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * User-settable and human-readable display name for the Instance.
+   * 
+ * + * 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 UID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + 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(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int DELETE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + + public static final int LABELS_FIELD_NUMBER = 7; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATE_FIELD_NUMBER = 8; + private int state_ = 0; + /** + * + * + *
+   * Output only. The current serving state of the instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current serving state of the instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.State getState() { + com.google.cloud.alloydb.v1.Instance.State result = + com.google.cloud.alloydb.v1.Instance.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1.Instance.State.UNRECOGNIZED : result; + } + + public static final int INSTANCE_TYPE_FIELD_NUMBER = 9; + private int instanceType_ = 0; + /** + * + * + *
+   * Required. The type of the instance. Specified at creation time.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for instanceType. + */ + @java.lang.Override + public int getInstanceTypeValue() { + return instanceType_; + } + /** + * + * + *
+   * Required. The type of the instance. Specified at creation time.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instanceType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.InstanceType getInstanceType() { + com.google.cloud.alloydb.v1.Instance.InstanceType result = + com.google.cloud.alloydb.v1.Instance.InstanceType.forNumber(instanceType_); + return result == null ? com.google.cloud.alloydb.v1.Instance.InstanceType.UNRECOGNIZED : result; + } + + public static final int MACHINE_CONFIG_FIELD_NUMBER = 10; + private com.google.cloud.alloydb.v1.Instance.MachineConfig machineConfig_; + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + * + * @return Whether the machineConfig field is set. + */ + @java.lang.Override + public boolean hasMachineConfig() { + return machineConfig_ != null; + } + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + * + * @return The machineConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.MachineConfig getMachineConfig() { + return machineConfig_ == null + ? com.google.cloud.alloydb.v1.Instance.MachineConfig.getDefaultInstance() + : machineConfig_; + } + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.MachineConfigOrBuilder getMachineConfigOrBuilder() { + return machineConfig_ == null + ? com.google.cloud.alloydb.v1.Instance.MachineConfig.getDefaultInstance() + : machineConfig_; + } + + public static final int AVAILABILITY_TYPE_FIELD_NUMBER = 11; + private int availabilityType_ = 0; + /** + * + * + *
+   * Availability type of an Instance.
+   * Defaults to REGIONAL for both primary and read instances.
+   * Note that primary and read instances can have different availability types.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; + * + * @return The enum numeric value on the wire for availabilityType. + */ + @java.lang.Override + public int getAvailabilityTypeValue() { + return availabilityType_; + } + /** + * + * + *
+   * Availability type of an Instance.
+   * Defaults to REGIONAL for both primary and read instances.
+   * Note that primary and read instances can have different availability types.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; + * + * @return The availabilityType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.AvailabilityType getAvailabilityType() { + com.google.cloud.alloydb.v1.Instance.AvailabilityType result = + com.google.cloud.alloydb.v1.Instance.AvailabilityType.forNumber(availabilityType_); + return result == null + ? com.google.cloud.alloydb.v1.Instance.AvailabilityType.UNRECOGNIZED + : result; + } + + public static final int GCE_ZONE_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object gceZone_ = ""; + /** + * + * + *
+   * The Compute Engine zone that the instance should serve from, per
+   * https://cloud.google.com/compute/docs/regions-zones
+   * This can ONLY be specified for ZONAL instances.
+   * If present for a REGIONAL instance, an error will be thrown.
+   * If this is absent for a ZONAL instance, instance is created in a random
+   * zone with available capacity.
+   * 
+ * + * string gce_zone = 12; + * + * @return The gceZone. + */ + @java.lang.Override + public java.lang.String getGceZone() { + java.lang.Object ref = gceZone_; + 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(); + gceZone_ = s; + return s; + } + } + /** + * + * + *
+   * The Compute Engine zone that the instance should serve from, per
+   * https://cloud.google.com/compute/docs/regions-zones
+   * This can ONLY be specified for ZONAL instances.
+   * If present for a REGIONAL instance, an error will be thrown.
+   * If this is absent for a ZONAL instance, instance is created in a random
+   * zone with available capacity.
+   * 
+ * + * string gce_zone = 12; + * + * @return The bytes for gceZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGceZoneBytes() { + java.lang.Object ref = gceZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_FLAGS_FIELD_NUMBER = 13; + + private static final class DatabaseFlagsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_DatabaseFlagsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField databaseFlags_; + + private com.google.protobuf.MapField + internalGetDatabaseFlags() { + if (databaseFlags_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DatabaseFlagsDefaultEntryHolder.defaultEntry); + } + return databaseFlags_; + } + + public int getDatabaseFlagsCount() { + return internalGetDatabaseFlags().getMap().size(); + } + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public boolean containsDatabaseFlags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetDatabaseFlags().getMap().containsKey(key); + } + /** Use {@link #getDatabaseFlagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDatabaseFlags() { + return getDatabaseFlagsMap(); + } + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public java.util.Map getDatabaseFlagsMap() { + return internalGetDatabaseFlags().getMap(); + } + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public /* nullable */ java.lang.String getDatabaseFlagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDatabaseFlags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public java.lang.String getDatabaseFlagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDatabaseFlags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int WRITABLE_NODE_FIELD_NUMBER = 19; + private com.google.cloud.alloydb.v1.Instance.Node writableNode_; + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writableNode field is set. + */ + @java.lang.Override + public boolean hasWritableNode() { + return writableNode_ != null; + } + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writableNode. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.Node getWritableNode() { + return writableNode_ == null + ? com.google.cloud.alloydb.v1.Instance.Node.getDefaultInstance() + : writableNode_; + } + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.NodeOrBuilder getWritableNodeOrBuilder() { + return writableNode_ == null + ? com.google.cloud.alloydb.v1.Instance.Node.getDefaultInstance() + : writableNode_; + } + + public static final int NODES_FIELD_NUMBER = 20; + + @SuppressWarnings("serial") + private java.util.List nodes_; + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getNodesList() { + return nodes_; + } + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getNodesOrBuilderList() { + return nodes_; + } + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getNodesCount() { + return nodes_.size(); + } + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.Node getNodes(int index) { + return nodes_.get(index); + } + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.NodeOrBuilder getNodesOrBuilder(int index) { + return nodes_.get(index); + } + + public static final int QUERY_INSIGHTS_CONFIG_FIELD_NUMBER = 21; + private com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig queryInsightsConfig_; + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return Whether the queryInsightsConfig field is set. + */ + @java.lang.Override + public boolean hasQueryInsightsConfig() { + return queryInsightsConfig_ != null; + } + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return The queryInsightsConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig getQueryInsightsConfig() { + return queryInsightsConfig_ == null + ? com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.getDefaultInstance() + : queryInsightsConfig_; + } + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfigOrBuilder + getQueryInsightsConfigOrBuilder() { + return queryInsightsConfig_ == null + ? com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.getDefaultInstance() + : queryInsightsConfig_; + } + + public static final int READ_POOL_CONFIG_FIELD_NUMBER = 14; + private com.google.cloud.alloydb.v1.Instance.ReadPoolConfig readPoolConfig_; + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return Whether the readPoolConfig field is set. + */ + @java.lang.Override + public boolean hasReadPoolConfig() { + return readPoolConfig_ != null; + } + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return The readPoolConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.ReadPoolConfig getReadPoolConfig() { + return readPoolConfig_ == null + ? com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.getDefaultInstance() + : readPoolConfig_; + } + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.ReadPoolConfigOrBuilder getReadPoolConfigOrBuilder() { + return readPoolConfig_ == null + ? com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.getDefaultInstance() + : readPoolConfig_; + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object ipAddress_ = ""; + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ipAddress. + */ + @java.lang.Override + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + 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(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for ipAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECONCILING_FIELD_NUMBER = 16; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+   * Set to true if the current state of Instance does not match the user's
+   * intended state, and the service is actively updating the resource to
+   * reconcile them. This can happen due to user-triggered updates or
+   * system actions like failover or maintenance.
+   * 
+ * + * bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int ETAG_FIELD_NUMBER = 17; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 17; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 17; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 18; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().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(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(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uid_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (deleteTime_ != null) { + output.writeMessage(6, getDeleteTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 7); + if (state_ != com.google.cloud.alloydb.v1.Instance.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, state_); + } + if (instanceType_ + != com.google.cloud.alloydb.v1.Instance.InstanceType.INSTANCE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, instanceType_); + } + if (machineConfig_ != null) { + output.writeMessage(10, getMachineConfig()); + } + if (availabilityType_ + != com.google.cloud.alloydb.v1.Instance.AvailabilityType.AVAILABILITY_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(11, availabilityType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gceZone_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, gceZone_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetDatabaseFlags(), DatabaseFlagsDefaultEntryHolder.defaultEntry, 13); + if (readPoolConfig_ != null) { + output.writeMessage(14, getReadPoolConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, ipAddress_); + } + if (reconciling_ != false) { + output.writeBool(16, reconciling_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, etag_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 18); + if (writableNode_ != null) { + output.writeMessage(19, getWritableNode()); + } + for (int i = 0; i < nodes_.size(); i++) { + output.writeMessage(20, nodes_.get(i)); + } + if (queryInsightsConfig_ != null) { + output.writeMessage(21, getQueryInsightsConfig()); + } + 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(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uid_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDeleteTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, labels__); + } + if (state_ != com.google.cloud.alloydb.v1.Instance.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, state_); + } + if (instanceType_ + != com.google.cloud.alloydb.v1.Instance.InstanceType.INSTANCE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, instanceType_); + } + if (machineConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getMachineConfig()); + } + if (availabilityType_ + != com.google.cloud.alloydb.v1.Instance.AvailabilityType.AVAILABILITY_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, availabilityType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gceZone_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, gceZone_); + } + for (java.util.Map.Entry entry : + internalGetDatabaseFlags().getMap().entrySet()) { + com.google.protobuf.MapEntry databaseFlags__ = + DatabaseFlagsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, databaseFlags__); + } + if (readPoolConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getReadPoolConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, ipAddress_); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(16, reconciling_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, etag_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, annotations__); + } + if (writableNode_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getWritableNode()); + } + for (int i = 0; i < nodes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, nodes_.get(i)); + } + if (queryInsightsConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(21, getQueryInsightsConfig()); + } + 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.alloydb.v1.Instance)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.Instance other = (com.google.cloud.alloydb.v1.Instance) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (state_ != other.state_) return false; + if (instanceType_ != other.instanceType_) return false; + if (hasMachineConfig() != other.hasMachineConfig()) return false; + if (hasMachineConfig()) { + if (!getMachineConfig().equals(other.getMachineConfig())) return false; + } + if (availabilityType_ != other.availabilityType_) return false; + if (!getGceZone().equals(other.getGceZone())) return false; + if (!internalGetDatabaseFlags().equals(other.internalGetDatabaseFlags())) return false; + if (hasWritableNode() != other.hasWritableNode()) return false; + if (hasWritableNode()) { + if (!getWritableNode().equals(other.getWritableNode())) return false; + } + if (!getNodesList().equals(other.getNodesList())) return false; + if (hasQueryInsightsConfig() != other.hasQueryInsightsConfig()) return false; + if (hasQueryInsightsConfig()) { + if (!getQueryInsightsConfig().equals(other.getQueryInsightsConfig())) return false; + } + if (hasReadPoolConfig() != other.hasReadPoolConfig()) return false; + if (hasReadPoolConfig()) { + if (!getReadPoolConfig().equals(other.getReadPoolConfig())) return false; + } + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (getReconciling() != other.getReconciling()) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) 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(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + INSTANCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + instanceType_; + if (hasMachineConfig()) { + hash = (37 * hash) + MACHINE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getMachineConfig().hashCode(); + } + hash = (37 * hash) + AVAILABILITY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + availabilityType_; + hash = (37 * hash) + GCE_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getGceZone().hashCode(); + if (!internalGetDatabaseFlags().getMap().isEmpty()) { + hash = (37 * hash) + DATABASE_FLAGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetDatabaseFlags().hashCode(); + } + if (hasWritableNode()) { + hash = (37 * hash) + WRITABLE_NODE_FIELD_NUMBER; + hash = (53 * hash) + getWritableNode().hashCode(); + } + if (getNodesCount() > 0) { + hash = (37 * hash) + NODES_FIELD_NUMBER; + hash = (53 * hash) + getNodesList().hashCode(); + } + if (hasQueryInsightsConfig()) { + hash = (37 * hash) + QUERY_INSIGHTS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getQueryInsightsConfig().hashCode(); + } + if (hasReadPoolConfig()) { + hash = (37 * hash) + READ_POOL_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getReadPoolConfig().hashCode(); + } + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.Instance parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Instance 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.alloydb.v1.Instance parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Instance 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.alloydb.v1.Instance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.Instance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.Instance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Instance 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.alloydb.v1.Instance parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Instance 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.alloydb.v1.Instance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.Instance 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.alloydb.v1.Instance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An Instance is a computing unit that an end customer can connect to.
+   * It's the main unit of computing resources in AlloyDB.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.Instance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.Instance) + com.google.cloud.alloydb.v1.InstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + case 13: + return internalGetDatabaseFlags(); + case 18: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableLabels(); + case 13: + return internalGetMutableDatabaseFlags(); + case 18: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.Instance.class, + com.google.cloud.alloydb.v1.Instance.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.Instance.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + uid_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + state_ = 0; + instanceType_ = 0; + machineConfig_ = null; + if (machineConfigBuilder_ != null) { + machineConfigBuilder_.dispose(); + machineConfigBuilder_ = null; + } + availabilityType_ = 0; + gceZone_ = ""; + internalGetMutableDatabaseFlags().clear(); + writableNode_ = null; + if (writableNodeBuilder_ != null) { + writableNodeBuilder_.dispose(); + writableNodeBuilder_ = null; + } + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + } else { + nodes_ = null; + nodesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00004000); + queryInsightsConfig_ = null; + if (queryInsightsConfigBuilder_ != null) { + queryInsightsConfigBuilder_.dispose(); + queryInsightsConfigBuilder_ = null; + } + readPoolConfig_ = null; + if (readPoolConfigBuilder_ != null) { + readPoolConfigBuilder_.dispose(); + readPoolConfigBuilder_ = null; + } + ipAddress_ = ""; + reconciling_ = false; + etag_ = ""; + internalGetMutableAnnotations().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_Instance_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.Instance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance build() { + com.google.cloud.alloydb.v1.Instance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance buildPartial() { + com.google.cloud.alloydb.v1.Instance result = new com.google.cloud.alloydb.v1.Instance(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.alloydb.v1.Instance result) { + if (nodesBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0)) { + nodes_ = java.util.Collections.unmodifiableList(nodes_); + bitField0_ = (bitField0_ & ~0x00004000); + } + result.nodes_ = nodes_; + } else { + result.nodes_ = nodesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.alloydb.v1.Instance result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.instanceType_ = instanceType_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.machineConfig_ = + machineConfigBuilder_ == null ? machineConfig_ : machineConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.availabilityType_ = availabilityType_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.gceZone_ = gceZone_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.databaseFlags_ = internalGetDatabaseFlags(); + result.databaseFlags_.makeImmutable(); + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.writableNode_ = + writableNodeBuilder_ == null ? writableNode_ : writableNodeBuilder_.build(); + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.queryInsightsConfig_ = + queryInsightsConfigBuilder_ == null + ? queryInsightsConfig_ + : queryInsightsConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.readPoolConfig_ = + readPoolConfigBuilder_ == null ? readPoolConfig_ : readPoolConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.ipAddress_ = ipAddress_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + } + + @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.alloydb.v1.Instance) { + return mergeFrom((com.google.cloud.alloydb.v1.Instance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.Instance other) { + if (other == com.google.cloud.alloydb.v1.Instance.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000040; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.instanceType_ != 0) { + setInstanceTypeValue(other.getInstanceTypeValue()); + } + if (other.hasMachineConfig()) { + mergeMachineConfig(other.getMachineConfig()); + } + if (other.availabilityType_ != 0) { + setAvailabilityTypeValue(other.getAvailabilityTypeValue()); + } + if (!other.getGceZone().isEmpty()) { + gceZone_ = other.gceZone_; + bitField0_ |= 0x00000800; + onChanged(); + } + internalGetMutableDatabaseFlags().mergeFrom(other.internalGetDatabaseFlags()); + bitField0_ |= 0x00001000; + if (other.hasWritableNode()) { + mergeWritableNode(other.getWritableNode()); + } + if (nodesBuilder_ == null) { + if (!other.nodes_.isEmpty()) { + if (nodes_.isEmpty()) { + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00004000); + } else { + ensureNodesIsMutable(); + nodes_.addAll(other.nodes_); + } + onChanged(); + } + } else { + if (!other.nodes_.isEmpty()) { + if (nodesBuilder_.isEmpty()) { + nodesBuilder_.dispose(); + nodesBuilder_ = null; + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00004000); + nodesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNodesFieldBuilder() + : null; + } else { + nodesBuilder_.addAllMessages(other.nodes_); + } + } + } + if (other.hasQueryInsightsConfig()) { + mergeQueryInsightsConfig(other.getQueryInsightsConfig()); + } + if (other.hasReadPoolConfig()) { + mergeReadPoolConfig(other.getReadPoolConfig()); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + bitField0_ |= 0x00020000; + onChanged(); + } + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00080000; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00100000; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: + { + instanceType_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 82: + { + input.readMessage(getMachineConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 88: + { + availabilityType_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 98: + { + gceZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 106: + { + com.google.protobuf.MapEntry databaseFlags__ = + input.readMessage( + DatabaseFlagsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableDatabaseFlags() + .getMutableMap() + .put(databaseFlags__.getKey(), databaseFlags__.getValue()); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 114: + { + input.readMessage(getReadPoolConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 114 + case 122: + { + ipAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00020000; + break; + } // case 122 + case 128: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00040000; + break; + } // case 128 + case 138: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00080000; + break; + } // case 138 + case 146: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00100000; + break; + } // case 146 + case 154: + { + input.readMessage(getWritableNodeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 154 + case 162: + { + com.google.cloud.alloydb.v1.Instance.Node m = + input.readMessage( + com.google.cloud.alloydb.v1.Instance.Node.parser(), extensionRegistry); + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(m); + } else { + nodesBuilder_.addMessage(m); + } + break; + } // case 162 + case 170: + { + input.readMessage( + getQueryInsightsConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00008000; + break; + } // case 170 + 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_ = ""; + /** + * + * + *
+     * Output only. The name of the instance resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+     * where the cluster and instance ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the instance resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the instance resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+     * where the cluster and instance ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the instance resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the instance resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+     * where the cluster and instance ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the instance resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the instance resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+     * where the cluster and instance ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the instance resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the instance resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+     * where the cluster and instance ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the instance resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * User-settable and human-readable display name for the Instance.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Instance.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Instance.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Instance.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Instance.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + 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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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 deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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; + } else { + deleteTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); + } else { + deleteTime_ = value; + } + } else { + deleteTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + bitField0_ = (bitField0_ & ~0x00000020); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_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> + 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_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000040; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000040; + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current serving state of the instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current serving state of the instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current serving state of the instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.State getState() { + com.google.cloud.alloydb.v1.Instance.State result = + com.google.cloud.alloydb.v1.Instance.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1.Instance.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current serving state of the instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.alloydb.v1.Instance.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current serving state of the instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000080); + state_ = 0; + onChanged(); + return this; + } + + private int instanceType_ = 0; + /** + * + * + *
+     * Required. The type of the instance. Specified at creation time.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for instanceType. + */ + @java.lang.Override + public int getInstanceTypeValue() { + return instanceType_; + } + /** + * + * + *
+     * Required. The type of the instance. Specified at creation time.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for instanceType to set. + * @return This builder for chaining. + */ + public Builder setInstanceTypeValue(int value) { + instanceType_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of the instance. Specified at creation time.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instanceType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.InstanceType getInstanceType() { + com.google.cloud.alloydb.v1.Instance.InstanceType result = + com.google.cloud.alloydb.v1.Instance.InstanceType.forNumber(instanceType_); + return result == null + ? com.google.cloud.alloydb.v1.Instance.InstanceType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The type of the instance. Specified at creation time.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The instanceType to set. + * @return This builder for chaining. + */ + public Builder setInstanceType(com.google.cloud.alloydb.v1.Instance.InstanceType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + instanceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of the instance. Specified at creation time.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearInstanceType() { + bitField0_ = (bitField0_ & ~0x00000100); + instanceType_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1.Instance.MachineConfig machineConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance.MachineConfig, + com.google.cloud.alloydb.v1.Instance.MachineConfig.Builder, + com.google.cloud.alloydb.v1.Instance.MachineConfigOrBuilder> + machineConfigBuilder_; + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + * + * @return Whether the machineConfig field is set. + */ + public boolean hasMachineConfig() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + * + * @return The machineConfig. + */ + public com.google.cloud.alloydb.v1.Instance.MachineConfig getMachineConfig() { + if (machineConfigBuilder_ == null) { + return machineConfig_ == null + ? com.google.cloud.alloydb.v1.Instance.MachineConfig.getDefaultInstance() + : machineConfig_; + } else { + return machineConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + */ + public Builder setMachineConfig(com.google.cloud.alloydb.v1.Instance.MachineConfig value) { + if (machineConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + machineConfig_ = value; + } else { + machineConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + */ + public Builder setMachineConfig( + com.google.cloud.alloydb.v1.Instance.MachineConfig.Builder builderForValue) { + if (machineConfigBuilder_ == null) { + machineConfig_ = builderForValue.build(); + } else { + machineConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + */ + public Builder mergeMachineConfig(com.google.cloud.alloydb.v1.Instance.MachineConfig value) { + if (machineConfigBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && machineConfig_ != null + && machineConfig_ + != com.google.cloud.alloydb.v1.Instance.MachineConfig.getDefaultInstance()) { + getMachineConfigBuilder().mergeFrom(value); + } else { + machineConfig_ = value; + } + } else { + machineConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + */ + public Builder clearMachineConfig() { + bitField0_ = (bitField0_ & ~0x00000200); + machineConfig_ = null; + if (machineConfigBuilder_ != null) { + machineConfigBuilder_.dispose(); + machineConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + */ + public com.google.cloud.alloydb.v1.Instance.MachineConfig.Builder getMachineConfigBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getMachineConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + */ + public com.google.cloud.alloydb.v1.Instance.MachineConfigOrBuilder getMachineConfigOrBuilder() { + if (machineConfigBuilder_ != null) { + return machineConfigBuilder_.getMessageOrBuilder(); + } else { + return machineConfig_ == null + ? com.google.cloud.alloydb.v1.Instance.MachineConfig.getDefaultInstance() + : machineConfig_; + } + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance.MachineConfig, + com.google.cloud.alloydb.v1.Instance.MachineConfig.Builder, + com.google.cloud.alloydb.v1.Instance.MachineConfigOrBuilder> + getMachineConfigFieldBuilder() { + if (machineConfigBuilder_ == null) { + machineConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance.MachineConfig, + com.google.cloud.alloydb.v1.Instance.MachineConfig.Builder, + com.google.cloud.alloydb.v1.Instance.MachineConfigOrBuilder>( + getMachineConfig(), getParentForChildren(), isClean()); + machineConfig_ = null; + } + return machineConfigBuilder_; + } + + private int availabilityType_ = 0; + /** + * + * + *
+     * Availability type of an Instance.
+     * Defaults to REGIONAL for both primary and read instances.
+     * Note that primary and read instances can have different availability types.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; + * + * @return The enum numeric value on the wire for availabilityType. + */ + @java.lang.Override + public int getAvailabilityTypeValue() { + return availabilityType_; + } + /** + * + * + *
+     * Availability type of an Instance.
+     * Defaults to REGIONAL for both primary and read instances.
+     * Note that primary and read instances can have different availability types.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; + * + * @param value The enum numeric value on the wire for availabilityType to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityTypeValue(int value) { + availabilityType_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Availability type of an Instance.
+     * Defaults to REGIONAL for both primary and read instances.
+     * Note that primary and read instances can have different availability types.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; + * + * @return The availabilityType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance.AvailabilityType getAvailabilityType() { + com.google.cloud.alloydb.v1.Instance.AvailabilityType result = + com.google.cloud.alloydb.v1.Instance.AvailabilityType.forNumber(availabilityType_); + return result == null + ? com.google.cloud.alloydb.v1.Instance.AvailabilityType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Availability type of an Instance.
+     * Defaults to REGIONAL for both primary and read instances.
+     * Note that primary and read instances can have different availability types.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; + * + * @param value The availabilityType to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityType( + com.google.cloud.alloydb.v1.Instance.AvailabilityType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + availabilityType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Availability type of an Instance.
+     * Defaults to REGIONAL for both primary and read instances.
+     * Note that primary and read instances can have different availability types.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; + * + * @return This builder for chaining. + */ + public Builder clearAvailabilityType() { + bitField0_ = (bitField0_ & ~0x00000400); + availabilityType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object gceZone_ = ""; + /** + * + * + *
+     * The Compute Engine zone that the instance should serve from, per
+     * https://cloud.google.com/compute/docs/regions-zones
+     * This can ONLY be specified for ZONAL instances.
+     * If present for a REGIONAL instance, an error will be thrown.
+     * If this is absent for a ZONAL instance, instance is created in a random
+     * zone with available capacity.
+     * 
+ * + * string gce_zone = 12; + * + * @return The gceZone. + */ + public java.lang.String getGceZone() { + java.lang.Object ref = gceZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gceZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Compute Engine zone that the instance should serve from, per
+     * https://cloud.google.com/compute/docs/regions-zones
+     * This can ONLY be specified for ZONAL instances.
+     * If present for a REGIONAL instance, an error will be thrown.
+     * If this is absent for a ZONAL instance, instance is created in a random
+     * zone with available capacity.
+     * 
+ * + * string gce_zone = 12; + * + * @return The bytes for gceZone. + */ + public com.google.protobuf.ByteString getGceZoneBytes() { + java.lang.Object ref = gceZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Compute Engine zone that the instance should serve from, per
+     * https://cloud.google.com/compute/docs/regions-zones
+     * This can ONLY be specified for ZONAL instances.
+     * If present for a REGIONAL instance, an error will be thrown.
+     * If this is absent for a ZONAL instance, instance is created in a random
+     * zone with available capacity.
+     * 
+ * + * string gce_zone = 12; + * + * @param value The gceZone to set. + * @return This builder for chaining. + */ + public Builder setGceZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + gceZone_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * The Compute Engine zone that the instance should serve from, per
+     * https://cloud.google.com/compute/docs/regions-zones
+     * This can ONLY be specified for ZONAL instances.
+     * If present for a REGIONAL instance, an error will be thrown.
+     * If this is absent for a ZONAL instance, instance is created in a random
+     * zone with available capacity.
+     * 
+ * + * string gce_zone = 12; + * + * @return This builder for chaining. + */ + public Builder clearGceZone() { + gceZone_ = getDefaultInstance().getGceZone(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+     * The Compute Engine zone that the instance should serve from, per
+     * https://cloud.google.com/compute/docs/regions-zones
+     * This can ONLY be specified for ZONAL instances.
+     * If present for a REGIONAL instance, an error will be thrown.
+     * If this is absent for a ZONAL instance, instance is created in a random
+     * zone with available capacity.
+     * 
+ * + * string gce_zone = 12; + * + * @param value The bytes for gceZone to set. + * @return This builder for chaining. + */ + public Builder setGceZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + gceZone_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private com.google.protobuf.MapField databaseFlags_; + + private com.google.protobuf.MapField + internalGetDatabaseFlags() { + if (databaseFlags_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DatabaseFlagsDefaultEntryHolder.defaultEntry); + } + return databaseFlags_; + } + + private com.google.protobuf.MapField + internalGetMutableDatabaseFlags() { + if (databaseFlags_ == null) { + databaseFlags_ = + com.google.protobuf.MapField.newMapField(DatabaseFlagsDefaultEntryHolder.defaultEntry); + } + if (!databaseFlags_.isMutable()) { + databaseFlags_ = databaseFlags_.copy(); + } + bitField0_ |= 0x00001000; + onChanged(); + return databaseFlags_; + } + + public int getDatabaseFlagsCount() { + return internalGetDatabaseFlags().getMap().size(); + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public boolean containsDatabaseFlags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetDatabaseFlags().getMap().containsKey(key); + } + /** Use {@link #getDatabaseFlagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDatabaseFlags() { + return getDatabaseFlagsMap(); + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public java.util.Map getDatabaseFlagsMap() { + return internalGetDatabaseFlags().getMap(); + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public /* nullable */ java.lang.String getDatabaseFlagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDatabaseFlags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public java.lang.String getDatabaseFlagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDatabaseFlags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearDatabaseFlags() { + bitField0_ = (bitField0_ & ~0x00001000); + internalGetMutableDatabaseFlags().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + public Builder removeDatabaseFlags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableDatabaseFlags().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableDatabaseFlags() { + bitField0_ |= 0x00001000; + return internalGetMutableDatabaseFlags().getMutableMap(); + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + public Builder putDatabaseFlags(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableDatabaseFlags().getMutableMap().put(key, value); + bitField0_ |= 0x00001000; + return this; + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + public Builder putAllDatabaseFlags(java.util.Map values) { + internalGetMutableDatabaseFlags().getMutableMap().putAll(values); + bitField0_ |= 0x00001000; + return this; + } + + private com.google.cloud.alloydb.v1.Instance.Node writableNode_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance.Node, + com.google.cloud.alloydb.v1.Instance.Node.Builder, + com.google.cloud.alloydb.v1.Instance.NodeOrBuilder> + writableNodeBuilder_; + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writableNode field is set. + */ + public boolean hasWritableNode() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writableNode. + */ + public com.google.cloud.alloydb.v1.Instance.Node getWritableNode() { + if (writableNodeBuilder_ == null) { + return writableNode_ == null + ? com.google.cloud.alloydb.v1.Instance.Node.getDefaultInstance() + : writableNode_; + } else { + return writableNodeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setWritableNode(com.google.cloud.alloydb.v1.Instance.Node value) { + if (writableNodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + writableNode_ = value; + } else { + writableNodeBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setWritableNode( + com.google.cloud.alloydb.v1.Instance.Node.Builder builderForValue) { + if (writableNodeBuilder_ == null) { + writableNode_ = builderForValue.build(); + } else { + writableNodeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeWritableNode(com.google.cloud.alloydb.v1.Instance.Node value) { + if (writableNodeBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && writableNode_ != null + && writableNode_ != com.google.cloud.alloydb.v1.Instance.Node.getDefaultInstance()) { + getWritableNodeBuilder().mergeFrom(value); + } else { + writableNode_ = value; + } + } else { + writableNodeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearWritableNode() { + bitField0_ = (bitField0_ & ~0x00002000); + writableNode_ = null; + if (writableNodeBuilder_ != null) { + writableNodeBuilder_.dispose(); + writableNodeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.Instance.Node.Builder getWritableNodeBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getWritableNodeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.Instance.NodeOrBuilder getWritableNodeOrBuilder() { + if (writableNodeBuilder_ != null) { + return writableNodeBuilder_.getMessageOrBuilder(); + } else { + return writableNode_ == null + ? com.google.cloud.alloydb.v1.Instance.Node.getDefaultInstance() + : writableNode_; + } + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance.Node, + com.google.cloud.alloydb.v1.Instance.Node.Builder, + com.google.cloud.alloydb.v1.Instance.NodeOrBuilder> + getWritableNodeFieldBuilder() { + if (writableNodeBuilder_ == null) { + writableNodeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance.Node, + com.google.cloud.alloydb.v1.Instance.Node.Builder, + com.google.cloud.alloydb.v1.Instance.NodeOrBuilder>( + getWritableNode(), getParentForChildren(), isClean()); + writableNode_ = null; + } + return writableNodeBuilder_; + } + + private java.util.List nodes_ = + java.util.Collections.emptyList(); + + private void ensureNodesIsMutable() { + if (!((bitField0_ & 0x00004000) != 0)) { + nodes_ = new java.util.ArrayList(nodes_); + bitField0_ |= 0x00004000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance.Node, + com.google.cloud.alloydb.v1.Instance.Node.Builder, + com.google.cloud.alloydb.v1.Instance.NodeOrBuilder> + nodesBuilder_; + + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getNodesList() { + if (nodesBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodes_); + } else { + return nodesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getNodesCount() { + if (nodesBuilder_ == null) { + return nodes_.size(); + } else { + return nodesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.Instance.Node getNodes(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodes(int index, com.google.cloud.alloydb.v1.Instance.Node value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.set(index, value); + onChanged(); + } else { + nodesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodes( + int index, com.google.cloud.alloydb.v1.Instance.Node.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.set(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes(com.google.cloud.alloydb.v1.Instance.Node value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(value); + onChanged(); + } else { + nodesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes(int index, com.google.cloud.alloydb.v1.Instance.Node value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(index, value); + onChanged(); + } else { + nodesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes(com.google.cloud.alloydb.v1.Instance.Node.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + int index, com.google.cloud.alloydb.v1.Instance.Node.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllNodes( + java.lang.Iterable values) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, nodes_); + onChanged(); + } else { + nodesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearNodes() { + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + } else { + nodesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeNodes(int index) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.remove(index); + onChanged(); + } else { + nodesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.Instance.Node.Builder getNodesBuilder(int index) { + return getNodesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.Instance.NodeOrBuilder getNodesOrBuilder(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getNodesOrBuilderList() { + if (nodesBuilder_ != null) { + return nodesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodes_); + } + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.Instance.Node.Builder addNodesBuilder() { + return getNodesFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1.Instance.Node.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.Instance.Node.Builder addNodesBuilder(int index) { + return getNodesFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1.Instance.Node.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getNodesBuilderList() { + return getNodesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance.Node, + com.google.cloud.alloydb.v1.Instance.Node.Builder, + com.google.cloud.alloydb.v1.Instance.NodeOrBuilder> + getNodesFieldBuilder() { + if (nodesBuilder_ == null) { + nodesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance.Node, + com.google.cloud.alloydb.v1.Instance.Node.Builder, + com.google.cloud.alloydb.v1.Instance.NodeOrBuilder>( + nodes_, ((bitField0_ & 0x00004000) != 0), getParentForChildren(), isClean()); + nodes_ = null; + } + return nodesBuilder_; + } + + private com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig queryInsightsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig, + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.Builder, + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfigOrBuilder> + queryInsightsConfigBuilder_; + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return Whether the queryInsightsConfig field is set. + */ + public boolean hasQueryInsightsConfig() { + return ((bitField0_ & 0x00008000) != 0); + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return The queryInsightsConfig. + */ + public com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + getQueryInsightsConfig() { + if (queryInsightsConfigBuilder_ == null) { + return queryInsightsConfig_ == null + ? com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.getDefaultInstance() + : queryInsightsConfig_; + } else { + return queryInsightsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public Builder setQueryInsightsConfig( + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig value) { + if (queryInsightsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryInsightsConfig_ = value; + } else { + queryInsightsConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public Builder setQueryInsightsConfig( + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.Builder builderForValue) { + if (queryInsightsConfigBuilder_ == null) { + queryInsightsConfig_ = builderForValue.build(); + } else { + queryInsightsConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public Builder mergeQueryInsightsConfig( + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig value) { + if (queryInsightsConfigBuilder_ == null) { + if (((bitField0_ & 0x00008000) != 0) + && queryInsightsConfig_ != null + && queryInsightsConfig_ + != com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + .getDefaultInstance()) { + getQueryInsightsConfigBuilder().mergeFrom(value); + } else { + queryInsightsConfig_ = value; + } + } else { + queryInsightsConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public Builder clearQueryInsightsConfig() { + bitField0_ = (bitField0_ & ~0x00008000); + queryInsightsConfig_ = null; + if (queryInsightsConfigBuilder_ != null) { + queryInsightsConfigBuilder_.dispose(); + queryInsightsConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.Builder + getQueryInsightsConfigBuilder() { + bitField0_ |= 0x00008000; + onChanged(); + return getQueryInsightsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfigOrBuilder + getQueryInsightsConfigOrBuilder() { + if (queryInsightsConfigBuilder_ != null) { + return queryInsightsConfigBuilder_.getMessageOrBuilder(); + } else { + return queryInsightsConfig_ == null + ? com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.getDefaultInstance() + : queryInsightsConfig_; + } + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig, + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.Builder, + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfigOrBuilder> + getQueryInsightsConfigFieldBuilder() { + if (queryInsightsConfigBuilder_ == null) { + queryInsightsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig, + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.Builder, + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfigOrBuilder>( + getQueryInsightsConfig(), getParentForChildren(), isClean()); + queryInsightsConfig_ = null; + } + return queryInsightsConfigBuilder_; + } + + private com.google.cloud.alloydb.v1.Instance.ReadPoolConfig readPoolConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance.ReadPoolConfig, + com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.Builder, + com.google.cloud.alloydb.v1.Instance.ReadPoolConfigOrBuilder> + readPoolConfigBuilder_; + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return Whether the readPoolConfig field is set. + */ + public boolean hasReadPoolConfig() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return The readPoolConfig. + */ + public com.google.cloud.alloydb.v1.Instance.ReadPoolConfig getReadPoolConfig() { + if (readPoolConfigBuilder_ == null) { + return readPoolConfig_ == null + ? com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.getDefaultInstance() + : readPoolConfig_; + } else { + return readPoolConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + */ + public Builder setReadPoolConfig(com.google.cloud.alloydb.v1.Instance.ReadPoolConfig value) { + if (readPoolConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readPoolConfig_ = value; + } else { + readPoolConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + */ + public Builder setReadPoolConfig( + com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.Builder builderForValue) { + if (readPoolConfigBuilder_ == null) { + readPoolConfig_ = builderForValue.build(); + } else { + readPoolConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + */ + public Builder mergeReadPoolConfig(com.google.cloud.alloydb.v1.Instance.ReadPoolConfig value) { + if (readPoolConfigBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && readPoolConfig_ != null + && readPoolConfig_ + != com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.getDefaultInstance()) { + getReadPoolConfigBuilder().mergeFrom(value); + } else { + readPoolConfig_ = value; + } + } else { + readPoolConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + */ + public Builder clearReadPoolConfig() { + bitField0_ = (bitField0_ & ~0x00010000); + readPoolConfig_ = null; + if (readPoolConfigBuilder_ != null) { + readPoolConfigBuilder_.dispose(); + readPoolConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + */ + public com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.Builder getReadPoolConfigBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return getReadPoolConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + */ + public com.google.cloud.alloydb.v1.Instance.ReadPoolConfigOrBuilder + getReadPoolConfigOrBuilder() { + if (readPoolConfigBuilder_ != null) { + return readPoolConfigBuilder_.getMessageOrBuilder(); + } else { + return readPoolConfig_ == null + ? com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.getDefaultInstance() + : readPoolConfig_; + } + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance.ReadPoolConfig, + com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.Builder, + com.google.cloud.alloydb.v1.Instance.ReadPoolConfigOrBuilder> + getReadPoolConfigFieldBuilder() { + if (readPoolConfigBuilder_ == null) { + readPoolConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance.ReadPoolConfig, + com.google.cloud.alloydb.v1.Instance.ReadPoolConfig.Builder, + com.google.cloud.alloydb.v1.Instance.ReadPoolConfigOrBuilder>( + getReadPoolConfig(), getParentForChildren(), isClean()); + readPoolConfig_ = null; + } + return readPoolConfigBuilder_; + } + + private java.lang.Object ipAddress_ = ""; + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ipAddress_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + ipAddress_ = getDefaultInstance().getIpAddress(); + bitField0_ = (bitField0_ & ~0x00020000); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ipAddress_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Instance does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Instance does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Instance does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00040000); + reconciling_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 17; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 17; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 17; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 17; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00080000); + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 17; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00100000; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00100000); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00100000; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00100000; + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00100000; + 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.alloydb.v1.Instance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.Instance) + private static final com.google.cloud.alloydb.v1.Instance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.Instance(); + } + + public static com.google.cloud.alloydb.v1.Instance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Instance 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.alloydb.v1.Instance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceName.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceName.java new file mode 100644 index 000000000000..9e46d6d640b1 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceName.java @@ -0,0 +1,259 @@ +/* + * 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.alloydb.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 InstanceName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CLUSTER_INSTANCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String cluster; + private final String instance; + + @Deprecated + protected InstanceName() { + project = null; + location = null; + cluster = null; + instance = null; + } + + private InstanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + cluster = Preconditions.checkNotNull(builder.getCluster()); + instance = Preconditions.checkNotNull(builder.getInstance()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public String getInstance() { + return instance; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static InstanceName of(String project, String location, String cluster, String instance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCluster(cluster) + .setInstance(instance) + .build(); + } + + public static String format(String project, String location, String cluster, String instance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCluster(cluster) + .setInstance(instance) + .build() + .toString(); + } + + public static InstanceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CLUSTER_INSTANCE.validatedMatch( + formattedString, "InstanceName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("cluster"), + matchMap.get("instance")); + } + + 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 (InstanceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CLUSTER_INSTANCE.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 (cluster != null) { + fieldMapBuilder.put("cluster", cluster); + } + if (instance != null) { + fieldMapBuilder.put("instance", instance); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CLUSTER_INSTANCE.instantiate( + "project", project, "location", location, "cluster", cluster, "instance", instance); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + InstanceName that = ((InstanceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.cluster, that.cluster) + && Objects.equals(this.instance, that.instance); + } + 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(cluster); + h *= 1000003; + h ^= Objects.hashCode(instance); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}. + */ + public static class Builder { + private String project; + private String location; + private String cluster; + private String instance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public String getInstance() { + return instance; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCluster(String cluster) { + this.cluster = cluster; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + private Builder(InstanceName instanceName) { + this.project = instanceName.project; + this.location = instanceName.location; + this.cluster = instanceName.cluster; + this.instance = instanceName.instance; + } + + public InstanceName build() { + return new InstanceName(this); + } + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceOrBuilder.java new file mode 100644 index 000000000000..681a47b190b6 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceOrBuilder.java @@ -0,0 +1,885 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public interface InstanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.Instance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The name of the instance resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+   * where the cluster and instance ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the instance resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The name of the instance resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+   * where the cluster and instance ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the instance resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * User-settable and human-readable display name for the Instance.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * User-settable and human-readable display name for the Instance.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The current serving state of the instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current serving state of the instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.alloydb.v1.Instance.State getState(); + + /** + * + * + *
+   * Required. The type of the instance. Specified at creation time.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for instanceType. + */ + int getInstanceTypeValue(); + /** + * + * + *
+   * Required. The type of the instance. Specified at creation time.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instanceType. + */ + com.google.cloud.alloydb.v1.Instance.InstanceType getInstanceType(); + + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + * + * @return Whether the machineConfig field is set. + */ + boolean hasMachineConfig(); + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + * + * @return The machineConfig. + */ + com.google.cloud.alloydb.v1.Instance.MachineConfig getMachineConfig(); + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + */ + com.google.cloud.alloydb.v1.Instance.MachineConfigOrBuilder getMachineConfigOrBuilder(); + + /** + * + * + *
+   * Availability type of an Instance.
+   * Defaults to REGIONAL for both primary and read instances.
+   * Note that primary and read instances can have different availability types.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; + * + * @return The enum numeric value on the wire for availabilityType. + */ + int getAvailabilityTypeValue(); + /** + * + * + *
+   * Availability type of an Instance.
+   * Defaults to REGIONAL for both primary and read instances.
+   * Note that primary and read instances can have different availability types.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; + * + * @return The availabilityType. + */ + com.google.cloud.alloydb.v1.Instance.AvailabilityType getAvailabilityType(); + + /** + * + * + *
+   * The Compute Engine zone that the instance should serve from, per
+   * https://cloud.google.com/compute/docs/regions-zones
+   * This can ONLY be specified for ZONAL instances.
+   * If present for a REGIONAL instance, an error will be thrown.
+   * If this is absent for a ZONAL instance, instance is created in a random
+   * zone with available capacity.
+   * 
+ * + * string gce_zone = 12; + * + * @return The gceZone. + */ + java.lang.String getGceZone(); + /** + * + * + *
+   * The Compute Engine zone that the instance should serve from, per
+   * https://cloud.google.com/compute/docs/regions-zones
+   * This can ONLY be specified for ZONAL instances.
+   * If present for a REGIONAL instance, an error will be thrown.
+   * If this is absent for a ZONAL instance, instance is created in a random
+   * zone with available capacity.
+   * 
+ * + * string gce_zone = 12; + * + * @return The bytes for gceZone. + */ + com.google.protobuf.ByteString getGceZoneBytes(); + + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + int getDatabaseFlagsCount(); + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + boolean containsDatabaseFlags(java.lang.String key); + /** Use {@link #getDatabaseFlagsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getDatabaseFlags(); + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + java.util.Map getDatabaseFlagsMap(); + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + /* nullable */ + java.lang.String getDatabaseFlagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + java.lang.String getDatabaseFlagsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writableNode field is set. + */ + boolean hasWritableNode(); + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writableNode. + */ + com.google.cloud.alloydb.v1.Instance.Node getWritableNode(); + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1.Instance.NodeOrBuilder getWritableNodeOrBuilder(); + + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getNodesList(); + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1.Instance.Node getNodes(int index); + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getNodesCount(); + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getNodesOrBuilderList(); + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1.Instance.NodeOrBuilder getNodesOrBuilder(int index); + + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return Whether the queryInsightsConfig field is set. + */ + boolean hasQueryInsightsConfig(); + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return The queryInsightsConfig. + */ + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig getQueryInsightsConfig(); + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + com.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfigOrBuilder + getQueryInsightsConfigOrBuilder(); + + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return Whether the readPoolConfig field is set. + */ + boolean hasReadPoolConfig(); + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return The readPoolConfig. + */ + com.google.cloud.alloydb.v1.Instance.ReadPoolConfig getReadPoolConfig(); + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + */ + com.google.cloud.alloydb.v1.Instance.ReadPoolConfigOrBuilder getReadPoolConfigOrBuilder(); + + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+   * Set to true if the current state of Instance does not match the user's
+   * intended state, and the service is actively updating the resource to
+   * reconcile them. This can happen due to user-triggered updates or
+   * system actions like failover or maintenance.
+   * 
+ * + * bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 17; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 17; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceView.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceView.java new file mode 100644 index 000000000000..26b11c18848f --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceView.java @@ -0,0 +1,183 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * View on Instance. Pass this enum to rpcs that returns an Instance message to
+ * control which subsets of fields to get.
+ * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.InstanceView} + */ +public enum InstanceView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
+   * 
+ * + * INSTANCE_VIEW_UNSPECIFIED = 0; + */ + INSTANCE_VIEW_UNSPECIFIED(0), + /** + * + * + *
+   * BASIC server responses for a primary or read instance include all the
+   * relevant instance details, excluding the details of each node in the
+   * instance. The default value.
+   * 
+ * + * INSTANCE_VIEW_BASIC = 1; + */ + INSTANCE_VIEW_BASIC(1), + /** + * + * + *
+   * FULL response is equivalent to BASIC for primary instance (for now).
+   * For read pool instance, this includes details of each node in the pool.
+   * 
+ * + * INSTANCE_VIEW_FULL = 2; + */ + INSTANCE_VIEW_FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
+   * 
+ * + * INSTANCE_VIEW_UNSPECIFIED = 0; + */ + public static final int INSTANCE_VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * BASIC server responses for a primary or read instance include all the
+   * relevant instance details, excluding the details of each node in the
+   * instance. The default value.
+   * 
+ * + * INSTANCE_VIEW_BASIC = 1; + */ + public static final int INSTANCE_VIEW_BASIC_VALUE = 1; + /** + * + * + *
+   * FULL response is equivalent to BASIC for primary instance (for now).
+   * For read pool instance, this includes details of each node in the pool.
+   * 
+ * + * INSTANCE_VIEW_FULL = 2; + */ + public static final int INSTANCE_VIEW_FULL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static InstanceView 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 InstanceView forNumber(int value) { + switch (value) { + case 0: + return INSTANCE_VIEW_UNSPECIFIED; + case 1: + return INSTANCE_VIEW_BASIC; + case 2: + return INSTANCE_VIEW_FULL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public InstanceView findValueByNumber(int number) { + return InstanceView.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.alloydb.v1.ResourcesProto.getDescriptor().getEnumTypes().get(1); + } + + private static final InstanceView[] VALUES = values(); + + public static InstanceView 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 InstanceView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1.InstanceView) +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListBackupsRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListBackupsRequest.java new file mode 100644 index 000000000000..60fdc84b5cec --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListBackupsRequest.java @@ -0,0 +1,1285 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for requesting list of Backups
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListBackupsRequest} + */ +public final class ListBackupsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.ListBackupsRequest) + ListBackupsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupsRequest.newBuilder() to construct. + private ListBackupsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupsRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListBackupsRequest.class, + com.google.cloud.alloydb.v1.ListBackupsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value for ListBackupsRequest
+   * 
+ * + * + * 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 value for ListBackupsRequest
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @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; + } + } + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @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; + } + } + + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.alloydb.v1.ListBackupsRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.ListBackupsRequest other = + (com.google.cloud.alloydb.v1.ListBackupsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.ListBackupsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListBackupsRequest 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.alloydb.v1.ListBackupsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListBackupsRequest 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.alloydb.v1.ListBackupsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListBackupsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListBackupsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListBackupsRequest 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.alloydb.v1.ListBackupsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListBackupsRequest 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.alloydb.v1.ListBackupsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListBackupsRequest 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.alloydb.v1.ListBackupsRequest 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; + } + /** + * + * + *
+   * Message for requesting list of Backups
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListBackupsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.ListBackupsRequest) + com.google.cloud.alloydb.v1.ListBackupsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListBackupsRequest.class, + com.google.cloud.alloydb.v1.ListBackupsRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.ListBackupsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListBackupsRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.ListBackupsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListBackupsRequest build() { + com.google.cloud.alloydb.v1.ListBackupsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListBackupsRequest buildPartial() { + com.google.cloud.alloydb.v1.ListBackupsRequest result = + new com.google.cloud.alloydb.v1.ListBackupsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.ListBackupsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @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.alloydb.v1.ListBackupsRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.ListBackupsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.ListBackupsRequest other) { + if (other == com.google.cloud.alloydb.v1.ListBackupsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + 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 parent_ = ""; + /** + * + * + *
+     * Required. Parent value for ListBackupsRequest
+     * 
+ * + * + * 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 value for ListBackupsRequest
+     * 
+ * + * + * 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 value for ListBackupsRequest
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListBackupsRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListBackupsRequest
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @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; + } + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @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; + } + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @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; + bitField0_ |= 0x00000010; + 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.alloydb.v1.ListBackupsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.ListBackupsRequest) + private static final com.google.cloud.alloydb.v1.ListBackupsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.ListBackupsRequest(); + } + + public static com.google.cloud.alloydb.v1.ListBackupsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsRequest 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.alloydb.v1.ListBackupsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListBackupsRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListBackupsRequestOrBuilder.java new file mode 100644 index 000000000000..a02f49de384e --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListBackupsRequestOrBuilder.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/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface ListBackupsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.ListBackupsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value for ListBackupsRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value for ListBackupsRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListBackupsResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListBackupsResponse.java new file mode 100644 index 000000000000..dabb5c2d1e29 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListBackupsResponse.java @@ -0,0 +1,1393 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for response to listing Backups
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListBackupsResponse} + */ +public final class ListBackupsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.ListBackupsResponse) + ListBackupsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupsResponse.newBuilder() to construct. + private ListBackupsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupsResponse() { + backups_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupsResponse(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListBackupsResponse.class, + com.google.cloud.alloydb.v1.ListBackupsResponse.Builder.class); + } + + public static final int BACKUPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List backups_; + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + @java.lang.Override + public java.util.List getBackupsList() { + return backups_; + } + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + @java.lang.Override + public java.util.List + getBackupsOrBuilderList() { + return backups_; + } + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + @java.lang.Override + public int getBackupsCount() { + return backups_.size(); + } + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Backup getBackups(int index) { + return backups_.get(index); + } + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BackupOrBuilder getBackupsOrBuilder(int index) { + return backups_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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 UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.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 < backups_.size(); i++) { + output.writeMessage(1, backups_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(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 < backups_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, backups_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().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.alloydb.v1.ListBackupsResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.ListBackupsResponse other = + (com.google.cloud.alloydb.v1.ListBackupsResponse) obj; + + if (!getBackupsList().equals(other.getBackupsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) 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 (getBackupsCount() > 0) { + hash = (37 * hash) + BACKUPS_FIELD_NUMBER; + hash = (53 * hash) + getBackupsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.ListBackupsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListBackupsResponse 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.alloydb.v1.ListBackupsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListBackupsResponse 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.alloydb.v1.ListBackupsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListBackupsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListBackupsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListBackupsResponse 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.alloydb.v1.ListBackupsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListBackupsResponse 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.alloydb.v1.ListBackupsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListBackupsResponse 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.alloydb.v1.ListBackupsResponse 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; + } + /** + * + * + *
+   * Message for response to listing Backups
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListBackupsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.ListBackupsResponse) + com.google.cloud.alloydb.v1.ListBackupsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListBackupsResponse.class, + com.google.cloud.alloydb.v1.ListBackupsResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.ListBackupsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + } else { + backups_ = null; + backupsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListBackupsResponse getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.ListBackupsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListBackupsResponse build() { + com.google.cloud.alloydb.v1.ListBackupsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListBackupsResponse buildPartial() { + com.google.cloud.alloydb.v1.ListBackupsResponse result = + new com.google.cloud.alloydb.v1.ListBackupsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1.ListBackupsResponse result) { + if (backupsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + backups_ = java.util.Collections.unmodifiableList(backups_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.backups_ = backups_; + } else { + result.backups_ = backupsBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.ListBackupsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.alloydb.v1.ListBackupsResponse) { + return mergeFrom((com.google.cloud.alloydb.v1.ListBackupsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.ListBackupsResponse other) { + if (other == com.google.cloud.alloydb.v1.ListBackupsResponse.getDefaultInstance()) + return this; + if (backupsBuilder_ == null) { + if (!other.backups_.isEmpty()) { + if (backups_.isEmpty()) { + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBackupsIsMutable(); + backups_.addAll(other.backups_); + } + onChanged(); + } + } else { + if (!other.backups_.isEmpty()) { + if (backupsBuilder_.isEmpty()) { + backupsBuilder_.dispose(); + backupsBuilder_ = null; + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + backupsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBackupsFieldBuilder() + : null; + } else { + backupsBuilder_.addAllMessages(other.backups_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.alloydb.v1.Backup m = + input.readMessage( + com.google.cloud.alloydb.v1.Backup.parser(), extensionRegistry); + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(m); + } else { + backupsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + 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 backups_ = + java.util.Collections.emptyList(); + + private void ensureBackupsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + backups_ = new java.util.ArrayList(backups_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.Backup, + com.google.cloud.alloydb.v1.Backup.Builder, + com.google.cloud.alloydb.v1.BackupOrBuilder> + backupsBuilder_; + + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public java.util.List getBackupsList() { + if (backupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(backups_); + } else { + return backupsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public int getBackupsCount() { + if (backupsBuilder_ == null) { + return backups_.size(); + } else { + return backupsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public com.google.cloud.alloydb.v1.Backup getBackups(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public Builder setBackups(int index, com.google.cloud.alloydb.v1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.set(index, value); + onChanged(); + } else { + backupsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public Builder setBackups( + int index, com.google.cloud.alloydb.v1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.set(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public Builder addBackups(com.google.cloud.alloydb.v1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(value); + onChanged(); + } else { + backupsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public Builder addBackups(int index, com.google.cloud.alloydb.v1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(index, value); + onChanged(); + } else { + backupsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public Builder addBackups(com.google.cloud.alloydb.v1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public Builder addBackups( + int index, com.google.cloud.alloydb.v1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public Builder addAllBackups( + java.lang.Iterable values) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, backups_); + onChanged(); + } else { + backupsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public Builder clearBackups() { + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + backupsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public Builder removeBackups(int index) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.remove(index); + onChanged(); + } else { + backupsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public com.google.cloud.alloydb.v1.Backup.Builder getBackupsBuilder(int index) { + return getBackupsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public com.google.cloud.alloydb.v1.BackupOrBuilder getBackupsOrBuilder(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public java.util.List + getBackupsOrBuilderList() { + if (backupsBuilder_ != null) { + return backupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(backups_); + } + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public com.google.cloud.alloydb.v1.Backup.Builder addBackupsBuilder() { + return getBackupsFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1.Backup.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public com.google.cloud.alloydb.v1.Backup.Builder addBackupsBuilder(int index) { + return getBackupsFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1.Backup.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + public java.util.List getBackupsBuilderList() { + return getBackupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.Backup, + com.google.cloud.alloydb.v1.Backup.Builder, + com.google.cloud.alloydb.v1.BackupOrBuilder> + getBackupsFieldBuilder() { + if (backupsBuilder_ == null) { + backupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.Backup, + com.google.cloud.alloydb.v1.Backup.Builder, + com.google.cloud.alloydb.v1.BackupOrBuilder>( + backups_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + backups_ = null; + } + return backupsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.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.alloydb.v1.ListBackupsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.ListBackupsResponse) + private static final com.google.cloud.alloydb.v1.ListBackupsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.ListBackupsResponse(); + } + + public static com.google.cloud.alloydb.v1.ListBackupsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsResponse 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.alloydb.v1.ListBackupsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListBackupsResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListBackupsResponseOrBuilder.java new file mode 100644 index 000000000000..8451813465ac --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListBackupsResponseOrBuilder.java @@ -0,0 +1,152 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface ListBackupsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.ListBackupsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + java.util.List getBackupsList(); + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + com.google.cloud.alloydb.v1.Backup getBackups(int index); + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + int getBackupsCount(); + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + java.util.List getBackupsOrBuilderList(); + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + com.google.cloud.alloydb.v1.BackupOrBuilder getBackupsOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListClustersRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListClustersRequest.java new file mode 100644 index 000000000000..c481ad6730c2 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListClustersRequest.java @@ -0,0 +1,1307 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for requesting list of Clusters
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListClustersRequest} + */ +public final class ListClustersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.ListClustersRequest) + ListClustersRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListClustersRequest.newBuilder() to construct. + private ListClustersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListClustersRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListClustersRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListClustersRequest.class, + com.google.cloud.alloydb.v1.ListClustersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with the following format:
+   *  * projects/{project}/locations/-
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Cluster.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with the following format:
+   *  * projects/{project}/locations/-
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.alloydb.v1.ListClustersRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.ListClustersRequest other = + (com.google.cloud.alloydb.v1.ListClustersRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.ListClustersRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListClustersRequest 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.alloydb.v1.ListClustersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListClustersRequest 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.alloydb.v1.ListClustersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListClustersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListClustersRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListClustersRequest 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.alloydb.v1.ListClustersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListClustersRequest 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.alloydb.v1.ListClustersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListClustersRequest 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.alloydb.v1.ListClustersRequest 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; + } + /** + * + * + *
+   * Message for requesting list of Clusters
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListClustersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.ListClustersRequest) + com.google.cloud.alloydb.v1.ListClustersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListClustersRequest.class, + com.google.cloud.alloydb.v1.ListClustersRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.ListClustersRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListClustersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListClustersRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.ListClustersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListClustersRequest build() { + com.google.cloud.alloydb.v1.ListClustersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListClustersRequest buildPartial() { + com.google.cloud.alloydb.v1.ListClustersRequest result = + new com.google.cloud.alloydb.v1.ListClustersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.ListClustersRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @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.alloydb.v1.ListClustersRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.ListClustersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.ListClustersRequest other) { + if (other == com.google.cloud.alloydb.v1.ListClustersRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + 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 parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with the following format:
+     *  * projects/{project}/locations/-
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with the following format:
+     *  * projects/{project}/locations/-
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with the following format:
+     *  * projects/{project}/locations/-
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with the following format:
+     *  * projects/{project}/locations/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with the following format:
+     *  * projects/{project}/locations/-
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000010; + 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.alloydb.v1.ListClustersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.ListClustersRequest) + private static final com.google.cloud.alloydb.v1.ListClustersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.ListClustersRequest(); + } + + public static com.google.cloud.alloydb.v1.ListClustersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListClustersRequest 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.alloydb.v1.ListClustersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListClustersRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListClustersRequestOrBuilder.java new file mode 100644 index 000000000000..eff5b2e23928 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListClustersRequestOrBuilder.java @@ -0,0 +1,149 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface ListClustersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.ListClustersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with the following format:
+   *  * projects/{project}/locations/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with the following format:
+   *  * projects/{project}/locations/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListClustersResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListClustersResponse.java new file mode 100644 index 000000000000..56083fcb2a13 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListClustersResponse.java @@ -0,0 +1,1393 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for response to listing Clusters
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListClustersResponse} + */ +public final class ListClustersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.ListClustersResponse) + ListClustersResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListClustersResponse.newBuilder() to construct. + private ListClustersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListClustersResponse() { + clusters_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListClustersResponse(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListClustersResponse.class, + com.google.cloud.alloydb.v1.ListClustersResponse.Builder.class); + } + + public static final int CLUSTERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List clusters_; + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + @java.lang.Override + public java.util.List getClustersList() { + return clusters_; + } + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + @java.lang.Override + public java.util.List + getClustersOrBuilderList() { + return clusters_; + } + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + @java.lang.Override + public int getClustersCount() { + return clusters_.size(); + } + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster getClusters(int index) { + return clusters_.get(index); + } + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.ClusterOrBuilder getClustersOrBuilder(int index) { + return clusters_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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 UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.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 < clusters_.size(); i++) { + output.writeMessage(1, clusters_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(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 < clusters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, clusters_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().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.alloydb.v1.ListClustersResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.ListClustersResponse other = + (com.google.cloud.alloydb.v1.ListClustersResponse) obj; + + if (!getClustersList().equals(other.getClustersList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) 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 (getClustersCount() > 0) { + hash = (37 * hash) + CLUSTERS_FIELD_NUMBER; + hash = (53 * hash) + getClustersList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.ListClustersResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListClustersResponse 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.alloydb.v1.ListClustersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListClustersResponse 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.alloydb.v1.ListClustersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListClustersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListClustersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListClustersResponse 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.alloydb.v1.ListClustersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListClustersResponse 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.alloydb.v1.ListClustersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListClustersResponse 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.alloydb.v1.ListClustersResponse 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; + } + /** + * + * + *
+   * Message for response to listing Clusters
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListClustersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.ListClustersResponse) + com.google.cloud.alloydb.v1.ListClustersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListClustersResponse.class, + com.google.cloud.alloydb.v1.ListClustersResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.ListClustersResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (clustersBuilder_ == null) { + clusters_ = java.util.Collections.emptyList(); + } else { + clusters_ = null; + clustersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListClustersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListClustersResponse getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.ListClustersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListClustersResponse build() { + com.google.cloud.alloydb.v1.ListClustersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListClustersResponse buildPartial() { + com.google.cloud.alloydb.v1.ListClustersResponse result = + new com.google.cloud.alloydb.v1.ListClustersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1.ListClustersResponse result) { + if (clustersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + clusters_ = java.util.Collections.unmodifiableList(clusters_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.clusters_ = clusters_; + } else { + result.clusters_ = clustersBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.ListClustersResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.alloydb.v1.ListClustersResponse) { + return mergeFrom((com.google.cloud.alloydb.v1.ListClustersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.ListClustersResponse other) { + if (other == com.google.cloud.alloydb.v1.ListClustersResponse.getDefaultInstance()) + return this; + if (clustersBuilder_ == null) { + if (!other.clusters_.isEmpty()) { + if (clusters_.isEmpty()) { + clusters_ = other.clusters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureClustersIsMutable(); + clusters_.addAll(other.clusters_); + } + onChanged(); + } + } else { + if (!other.clusters_.isEmpty()) { + if (clustersBuilder_.isEmpty()) { + clustersBuilder_.dispose(); + clustersBuilder_ = null; + clusters_ = other.clusters_; + bitField0_ = (bitField0_ & ~0x00000001); + clustersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getClustersFieldBuilder() + : null; + } else { + clustersBuilder_.addAllMessages(other.clusters_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.alloydb.v1.Cluster m = + input.readMessage( + com.google.cloud.alloydb.v1.Cluster.parser(), extensionRegistry); + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(m); + } else { + clustersBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + 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 clusters_ = + java.util.Collections.emptyList(); + + private void ensureClustersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + clusters_ = new java.util.ArrayList(clusters_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster, + com.google.cloud.alloydb.v1.Cluster.Builder, + com.google.cloud.alloydb.v1.ClusterOrBuilder> + clustersBuilder_; + + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public java.util.List getClustersList() { + if (clustersBuilder_ == null) { + return java.util.Collections.unmodifiableList(clusters_); + } else { + return clustersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public int getClustersCount() { + if (clustersBuilder_ == null) { + return clusters_.size(); + } else { + return clustersBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public com.google.cloud.alloydb.v1.Cluster getClusters(int index) { + if (clustersBuilder_ == null) { + return clusters_.get(index); + } else { + return clustersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public Builder setClusters(int index, com.google.cloud.alloydb.v1.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.set(index, value); + onChanged(); + } else { + clustersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public Builder setClusters( + int index, com.google.cloud.alloydb.v1.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.set(index, builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public Builder addClusters(com.google.cloud.alloydb.v1.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.add(value); + onChanged(); + } else { + clustersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public Builder addClusters(int index, com.google.cloud.alloydb.v1.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.add(index, value); + onChanged(); + } else { + clustersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public Builder addClusters(com.google.cloud.alloydb.v1.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public Builder addClusters( + int index, com.google.cloud.alloydb.v1.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(index, builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public Builder addAllClusters( + java.lang.Iterable values) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clusters_); + onChanged(); + } else { + clustersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public Builder clearClusters() { + if (clustersBuilder_ == null) { + clusters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + clustersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public Builder removeClusters(int index) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.remove(index); + onChanged(); + } else { + clustersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public com.google.cloud.alloydb.v1.Cluster.Builder getClustersBuilder(int index) { + return getClustersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public com.google.cloud.alloydb.v1.ClusterOrBuilder getClustersOrBuilder(int index) { + if (clustersBuilder_ == null) { + return clusters_.get(index); + } else { + return clustersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public java.util.List + getClustersOrBuilderList() { + if (clustersBuilder_ != null) { + return clustersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(clusters_); + } + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public com.google.cloud.alloydb.v1.Cluster.Builder addClustersBuilder() { + return getClustersFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1.Cluster.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public com.google.cloud.alloydb.v1.Cluster.Builder addClustersBuilder(int index) { + return getClustersFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1.Cluster.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + public java.util.List getClustersBuilderList() { + return getClustersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster, + com.google.cloud.alloydb.v1.Cluster.Builder, + com.google.cloud.alloydb.v1.ClusterOrBuilder> + getClustersFieldBuilder() { + if (clustersBuilder_ == null) { + clustersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster, + com.google.cloud.alloydb.v1.Cluster.Builder, + com.google.cloud.alloydb.v1.ClusterOrBuilder>( + clusters_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + clusters_ = null; + } + return clustersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.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.alloydb.v1.ListClustersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.ListClustersResponse) + private static final com.google.cloud.alloydb.v1.ListClustersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.ListClustersResponse(); + } + + public static com.google.cloud.alloydb.v1.ListClustersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListClustersResponse 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.alloydb.v1.ListClustersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListClustersResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListClustersResponseOrBuilder.java new file mode 100644 index 000000000000..a11c0c8b5453 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListClustersResponseOrBuilder.java @@ -0,0 +1,152 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface ListClustersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.ListClustersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + java.util.List getClustersList(); + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + com.google.cloud.alloydb.v1.Cluster getClusters(int index); + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + int getClustersCount(); + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + java.util.List getClustersOrBuilderList(); + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + com.google.cloud.alloydb.v1.ClusterOrBuilder getClustersOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListInstancesRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListInstancesRequest.java new file mode 100644 index 000000000000..b4d054832b34 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListInstancesRequest.java @@ -0,0 +1,1321 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for requesting list of Instances
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListInstancesRequest} + */ +public final class ListInstancesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.ListInstancesRequest) + ListInstancesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInstancesRequest.newBuilder() to construct. + private ListInstancesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInstancesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListInstancesRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListInstancesRequest.class, + com.google.cloud.alloydb.v1.ListInstancesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with one of the following
+   * formats:
+   *  * projects/{project}/locations/-/clusters/-
+   *  * projects/{project}/locations/{region}/clusters/-
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Instance.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with one of the following
+   * formats:
+   *  * projects/{project}/locations/-/clusters/-
+   *  * projects/{project}/locations/{region}/clusters/-
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.alloydb.v1.ListInstancesRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.ListInstancesRequest other = + (com.google.cloud.alloydb.v1.ListInstancesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.ListInstancesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListInstancesRequest 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.alloydb.v1.ListInstancesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListInstancesRequest 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.alloydb.v1.ListInstancesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListInstancesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListInstancesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListInstancesRequest 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.alloydb.v1.ListInstancesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListInstancesRequest 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.alloydb.v1.ListInstancesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListInstancesRequest 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.alloydb.v1.ListInstancesRequest 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; + } + /** + * + * + *
+   * Message for requesting list of Instances
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListInstancesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.ListInstancesRequest) + com.google.cloud.alloydb.v1.ListInstancesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListInstancesRequest.class, + com.google.cloud.alloydb.v1.ListInstancesRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.ListInstancesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListInstancesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListInstancesRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.ListInstancesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListInstancesRequest build() { + com.google.cloud.alloydb.v1.ListInstancesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListInstancesRequest buildPartial() { + com.google.cloud.alloydb.v1.ListInstancesRequest result = + new com.google.cloud.alloydb.v1.ListInstancesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.ListInstancesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @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.alloydb.v1.ListInstancesRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.ListInstancesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.ListInstancesRequest other) { + if (other == com.google.cloud.alloydb.v1.ListInstancesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + 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 parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with one of the following
+     * formats:
+     *  * projects/{project}/locations/-/clusters/-
+     *  * projects/{project}/locations/{region}/clusters/-
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with one of the following
+     * formats:
+     *  * projects/{project}/locations/-/clusters/-
+     *  * projects/{project}/locations/{region}/clusters/-
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with one of the following
+     * formats:
+     *  * projects/{project}/locations/-/clusters/-
+     *  * projects/{project}/locations/{region}/clusters/-
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with one of the following
+     * formats:
+     *  * projects/{project}/locations/-/clusters/-
+     *  * projects/{project}/locations/{region}/clusters/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with one of the following
+     * formats:
+     *  * projects/{project}/locations/-/clusters/-
+     *  * projects/{project}/locations/{region}/clusters/-
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000010; + 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.alloydb.v1.ListInstancesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.ListInstancesRequest) + private static final com.google.cloud.alloydb.v1.ListInstancesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.ListInstancesRequest(); + } + + public static com.google.cloud.alloydb.v1.ListInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesRequest 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.alloydb.v1.ListInstancesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListInstancesRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListInstancesRequestOrBuilder.java new file mode 100644 index 000000000000..d35f1663c46a --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListInstancesRequestOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface ListInstancesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.ListInstancesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with one of the following
+   * formats:
+   *  * projects/{project}/locations/-/clusters/-
+   *  * projects/{project}/locations/{region}/clusters/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with one of the following
+   * formats:
+   *  * projects/{project}/locations/-/clusters/-
+   *  * projects/{project}/locations/{region}/clusters/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListInstancesResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListInstancesResponse.java new file mode 100644 index 000000000000..4b8a4be7b896 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListInstancesResponse.java @@ -0,0 +1,1393 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for response to listing Instances
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListInstancesResponse} + */ +public final class ListInstancesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.ListInstancesResponse) + ListInstancesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInstancesResponse.newBuilder() to construct. + private ListInstancesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInstancesResponse() { + instances_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListInstancesResponse(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListInstancesResponse.class, + com.google.cloud.alloydb.v1.ListInstancesResponse.Builder.class); + } + + public static final int INSTANCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List instances_; + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + @java.lang.Override + public java.util.List getInstancesList() { + return instances_; + } + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + @java.lang.Override + public java.util.List + getInstancesOrBuilderList() { + return instances_; + } + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance getInstances(int index) { + return instances_.get(index); + } + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.InstanceOrBuilder getInstancesOrBuilder(int index) { + return instances_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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 UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.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 < instances_.size(); i++) { + output.writeMessage(1, instances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(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 < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, instances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().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.alloydb.v1.ListInstancesResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.ListInstancesResponse other = + (com.google.cloud.alloydb.v1.ListInstancesResponse) obj; + + if (!getInstancesList().equals(other.getInstancesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) 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 (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.ListInstancesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListInstancesResponse 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.alloydb.v1.ListInstancesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListInstancesResponse 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.alloydb.v1.ListInstancesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListInstancesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListInstancesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListInstancesResponse 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.alloydb.v1.ListInstancesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListInstancesResponse 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.alloydb.v1.ListInstancesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListInstancesResponse 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.alloydb.v1.ListInstancesResponse 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; + } + /** + * + * + *
+   * Message for response to listing Instances
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListInstancesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.ListInstancesResponse) + com.google.cloud.alloydb.v1.ListInstancesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListInstancesResponse.class, + com.google.cloud.alloydb.v1.ListInstancesResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.ListInstancesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + } else { + instances_ = null; + instancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListInstancesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListInstancesResponse getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.ListInstancesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListInstancesResponse build() { + com.google.cloud.alloydb.v1.ListInstancesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListInstancesResponse buildPartial() { + com.google.cloud.alloydb.v1.ListInstancesResponse result = + new com.google.cloud.alloydb.v1.ListInstancesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1.ListInstancesResponse result) { + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.ListInstancesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.alloydb.v1.ListInstancesResponse) { + return mergeFrom((com.google.cloud.alloydb.v1.ListInstancesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.ListInstancesResponse other) { + if (other == com.google.cloud.alloydb.v1.ListInstancesResponse.getDefaultInstance()) + return this; + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.alloydb.v1.Instance m = + input.readMessage( + com.google.cloud.alloydb.v1.Instance.parser(), extensionRegistry); + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(m); + } else { + instancesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + 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 instances_ = + java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instances_ = new java.util.ArrayList(instances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance, + com.google.cloud.alloydb.v1.Instance.Builder, + com.google.cloud.alloydb.v1.InstanceOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public java.util.List getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1.Instance getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder setInstances(int index, com.google.cloud.alloydb.v1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder setInstances( + int index, com.google.cloud.alloydb.v1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.alloydb.v1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder addInstances(int index, com.google.cloud.alloydb.v1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.alloydb.v1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder addInstances( + int index, com.google.cloud.alloydb.v1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder addAllInstances( + java.lang.Iterable values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1.Instance.Builder getInstancesBuilder(int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1.InstanceOrBuilder getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public java.util.List + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1.Instance.Builder addInstancesBuilder() { + return getInstancesFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1.Instance.Builder addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + public java.util.List getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance, + com.google.cloud.alloydb.v1.Instance.Builder, + com.google.cloud.alloydb.v1.InstanceOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance, + com.google.cloud.alloydb.v1.Instance.Builder, + com.google.cloud.alloydb.v1.InstanceOrBuilder>( + instances_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.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.alloydb.v1.ListInstancesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.ListInstancesResponse) + private static final com.google.cloud.alloydb.v1.ListInstancesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.ListInstancesResponse(); + } + + public static com.google.cloud.alloydb.v1.ListInstancesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesResponse 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.alloydb.v1.ListInstancesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListInstancesResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListInstancesResponseOrBuilder.java new file mode 100644 index 000000000000..991efc7ec235 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListInstancesResponseOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface ListInstancesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.ListInstancesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + java.util.List getInstancesList(); + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + com.google.cloud.alloydb.v1.Instance getInstances(int index); + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + int getInstancesCount(); + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + java.util.List + getInstancesOrBuilderList(); + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + com.google.cloud.alloydb.v1.InstanceOrBuilder getInstancesOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListSupportedDatabaseFlagsRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListSupportedDatabaseFlagsRequest.java new file mode 100644 index 000000000000..edcf3a5c51b4 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListSupportedDatabaseFlagsRequest.java @@ -0,0 +1,963 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for listing the information about the supported Database flags.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} + */ +public final class ListSupportedDatabaseFlagsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest) + ListSupportedDatabaseFlagsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSupportedDatabaseFlagsRequest.newBuilder() to construct. + private ListSupportedDatabaseFlagsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSupportedDatabaseFlagsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSupportedDatabaseFlagsRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.class, + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   *  * projects/{project}/locations/{location}
+   * Regardless of the parent specified here, as long it is contains a valid
+   * project and location, the service will return a static list of supported
+   * flags resources. Note that we do not yet support region-specific
+   * flags.
+   * 
+ * + * + * 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 parent resource. The required format is:
+   *  * projects/{project}/locations/{location}
+   * Regardless of the parent specified here, as long it is contains a valid
+   * project and location, the service will return a static list of supported
+   * flags resources. Note that we do not yet support region-specific
+   * flags.
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * 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.alloydb.v1.ListSupportedDatabaseFlagsRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest other = + (com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest) 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.alloydb.v1.ListSupportedDatabaseFlagsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest 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.alloydb.v1.ListSupportedDatabaseFlagsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest 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.alloydb.v1.ListSupportedDatabaseFlagsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest 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.alloydb.v1.ListSupportedDatabaseFlagsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest 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.alloydb.v1.ListSupportedDatabaseFlagsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest 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.alloydb.v1.ListSupportedDatabaseFlagsRequest 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; + } + /** + * + * + *
+   * Message for listing the information about the supported Database flags.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest) + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.class, + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest build() { + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest buildPartial() { + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest result = + new com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.alloydb.v1.ListSupportedDatabaseFlagsRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest other) { + if (other + == com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + 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 parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     *  * projects/{project}/locations/{location}
+     * Regardless of the parent specified here, as long it is contains a valid
+     * project and location, the service will return a static list of supported
+     * flags resources. Note that we do not yet support region-specific
+     * flags.
+     * 
+ * + * + * 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 parent resource. The required format is:
+     *  * projects/{project}/locations/{location}
+     * Regardless of the parent specified here, as long it is contains a valid
+     * project and location, the service will return a static list of supported
+     * flags resources. Note that we do not yet support region-specific
+     * flags.
+     * 
+ * + * + * 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 parent resource. The required format is:
+     *  * projects/{project}/locations/{location}
+     * Regardless of the parent specified here, as long it is contains a valid
+     * project and location, the service will return a static list of supported
+     * flags resources. Note that we do not yet support region-specific
+     * flags.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     *  * projects/{project}/locations/{location}
+     * Regardless of the parent specified here, as long it is contains a valid
+     * project and location, the service will return a static list of supported
+     * flags resources. Note that we do not yet support region-specific
+     * flags.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     *  * projects/{project}/locations/{location}
+     * Regardless of the parent specified here, as long it is contains a valid
+     * project and location, the service will return a static list of supported
+     * flags resources. Note that we do not yet support region-specific
+     * flags.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + 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.alloydb.v1.ListSupportedDatabaseFlagsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest) + private static final com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest(); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSupportedDatabaseFlagsRequest 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.alloydb.v1.ListSupportedDatabaseFlagsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListSupportedDatabaseFlagsRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListSupportedDatabaseFlagsRequestOrBuilder.java new file mode 100644 index 000000000000..c2bba1dbec01 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListSupportedDatabaseFlagsRequestOrBuilder.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/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface ListSupportedDatabaseFlagsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   *  * projects/{project}/locations/{location}
+   * Regardless of the parent specified here, as long it is contains a valid
+   * project and location, the service will return a static list of supported
+   * flags resources. Note that we do not yet support region-specific
+   * flags.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   *  * projects/{project}/locations/{location}
+   * Regardless of the parent specified here, as long it is contains a valid
+   * project and location, the service will return a static list of supported
+   * flags resources. Note that we do not yet support region-specific
+   * flags.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListSupportedDatabaseFlagsResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListSupportedDatabaseFlagsResponse.java new file mode 100644 index 000000000000..08330283c332 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListSupportedDatabaseFlagsResponse.java @@ -0,0 +1,1174 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for response to listing SupportedDatabaseFlags.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} + */ +public final class ListSupportedDatabaseFlagsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse) + ListSupportedDatabaseFlagsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSupportedDatabaseFlagsResponse.newBuilder() to construct. + private ListSupportedDatabaseFlagsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSupportedDatabaseFlagsResponse() { + supportedDatabaseFlags_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSupportedDatabaseFlagsResponse(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.class, + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.Builder.class); + } + + public static final int SUPPORTED_DATABASE_FLAGS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List supportedDatabaseFlags_; + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + @java.lang.Override + public java.util.List + getSupportedDatabaseFlagsList() { + return supportedDatabaseFlags_; + } + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + @java.lang.Override + public java.util.List + getSupportedDatabaseFlagsOrBuilderList() { + return supportedDatabaseFlags_; + } + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + @java.lang.Override + public int getSupportedDatabaseFlagsCount() { + return supportedDatabaseFlags_.size(); + } + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag getSupportedDatabaseFlags(int index) { + return supportedDatabaseFlags_.get(index); + } + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlagOrBuilder + getSupportedDatabaseFlagsOrBuilder(int index) { + return supportedDatabaseFlags_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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 < supportedDatabaseFlags_.size(); i++) { + output.writeMessage(1, supportedDatabaseFlags_.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 < supportedDatabaseFlags_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, supportedDatabaseFlags_.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.alloydb.v1.ListSupportedDatabaseFlagsResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse other = + (com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse) obj; + + if (!getSupportedDatabaseFlagsList().equals(other.getSupportedDatabaseFlagsList())) + 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 (getSupportedDatabaseFlagsCount() > 0) { + hash = (37 * hash) + SUPPORTED_DATABASE_FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getSupportedDatabaseFlagsList().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.alloydb.v1.ListSupportedDatabaseFlagsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse 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.alloydb.v1.ListSupportedDatabaseFlagsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse 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.alloydb.v1.ListSupportedDatabaseFlagsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse 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.alloydb.v1.ListSupportedDatabaseFlagsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse 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.alloydb.v1.ListSupportedDatabaseFlagsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse 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.alloydb.v1.ListSupportedDatabaseFlagsResponse 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; + } + /** + * + * + *
+   * Message for response to listing SupportedDatabaseFlags.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse) + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.class, + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (supportedDatabaseFlagsBuilder_ == null) { + supportedDatabaseFlags_ = java.util.Collections.emptyList(); + } else { + supportedDatabaseFlags_ = null; + supportedDatabaseFlagsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse build() { + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse buildPartial() { + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse result = + new com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse result) { + if (supportedDatabaseFlagsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + supportedDatabaseFlags_ = java.util.Collections.unmodifiableList(supportedDatabaseFlags_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.supportedDatabaseFlags_ = supportedDatabaseFlags_; + } else { + result.supportedDatabaseFlags_ = supportedDatabaseFlagsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.alloydb.v1.ListSupportedDatabaseFlagsResponse) { + return mergeFrom((com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse other) { + if (other + == com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.getDefaultInstance()) + return this; + if (supportedDatabaseFlagsBuilder_ == null) { + if (!other.supportedDatabaseFlags_.isEmpty()) { + if (supportedDatabaseFlags_.isEmpty()) { + supportedDatabaseFlags_ = other.supportedDatabaseFlags_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.addAll(other.supportedDatabaseFlags_); + } + onChanged(); + } + } else { + if (!other.supportedDatabaseFlags_.isEmpty()) { + if (supportedDatabaseFlagsBuilder_.isEmpty()) { + supportedDatabaseFlagsBuilder_.dispose(); + supportedDatabaseFlagsBuilder_ = null; + supportedDatabaseFlags_ = other.supportedDatabaseFlags_; + bitField0_ = (bitField0_ & ~0x00000001); + supportedDatabaseFlagsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSupportedDatabaseFlagsFieldBuilder() + : null; + } else { + supportedDatabaseFlagsBuilder_.addAllMessages(other.supportedDatabaseFlags_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + 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.alloydb.v1.SupportedDatabaseFlag m = + input.readMessage( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.parser(), + extensionRegistry); + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.add(m); + } else { + supportedDatabaseFlagsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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 + supportedDatabaseFlags_ = java.util.Collections.emptyList(); + + private void ensureSupportedDatabaseFlagsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + supportedDatabaseFlags_ = + new java.util.ArrayList( + supportedDatabaseFlags_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.SupportedDatabaseFlag, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.Builder, + com.google.cloud.alloydb.v1.SupportedDatabaseFlagOrBuilder> + supportedDatabaseFlagsBuilder_; + + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public java.util.List + getSupportedDatabaseFlagsList() { + if (supportedDatabaseFlagsBuilder_ == null) { + return java.util.Collections.unmodifiableList(supportedDatabaseFlags_); + } else { + return supportedDatabaseFlagsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public int getSupportedDatabaseFlagsCount() { + if (supportedDatabaseFlagsBuilder_ == null) { + return supportedDatabaseFlags_.size(); + } else { + return supportedDatabaseFlagsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag getSupportedDatabaseFlags(int index) { + if (supportedDatabaseFlagsBuilder_ == null) { + return supportedDatabaseFlags_.get(index); + } else { + return supportedDatabaseFlagsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder setSupportedDatabaseFlags( + int index, com.google.cloud.alloydb.v1.SupportedDatabaseFlag value) { + if (supportedDatabaseFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.set(index, value); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder setSupportedDatabaseFlags( + int index, com.google.cloud.alloydb.v1.SupportedDatabaseFlag.Builder builderForValue) { + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.set(index, builderForValue.build()); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder addSupportedDatabaseFlags( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag value) { + if (supportedDatabaseFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.add(value); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder addSupportedDatabaseFlags( + int index, com.google.cloud.alloydb.v1.SupportedDatabaseFlag value) { + if (supportedDatabaseFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.add(index, value); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder addSupportedDatabaseFlags( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.Builder builderForValue) { + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.add(builderForValue.build()); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder addSupportedDatabaseFlags( + int index, com.google.cloud.alloydb.v1.SupportedDatabaseFlag.Builder builderForValue) { + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.add(index, builderForValue.build()); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder addAllSupportedDatabaseFlags( + java.lang.Iterable values) { + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, supportedDatabaseFlags_); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder clearSupportedDatabaseFlags() { + if (supportedDatabaseFlagsBuilder_ == null) { + supportedDatabaseFlags_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder removeSupportedDatabaseFlags(int index) { + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.remove(index); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.Builder + getSupportedDatabaseFlagsBuilder(int index) { + return getSupportedDatabaseFlagsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public com.google.cloud.alloydb.v1.SupportedDatabaseFlagOrBuilder + getSupportedDatabaseFlagsOrBuilder(int index) { + if (supportedDatabaseFlagsBuilder_ == null) { + return supportedDatabaseFlags_.get(index); + } else { + return supportedDatabaseFlagsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public java.util.List + getSupportedDatabaseFlagsOrBuilderList() { + if (supportedDatabaseFlagsBuilder_ != null) { + return supportedDatabaseFlagsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(supportedDatabaseFlags_); + } + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.Builder + addSupportedDatabaseFlagsBuilder() { + return getSupportedDatabaseFlagsFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1.SupportedDatabaseFlag.getDefaultInstance()); + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.Builder + addSupportedDatabaseFlagsBuilder(int index) { + return getSupportedDatabaseFlagsFieldBuilder() + .addBuilder( + index, com.google.cloud.alloydb.v1.SupportedDatabaseFlag.getDefaultInstance()); + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public java.util.List + getSupportedDatabaseFlagsBuilderList() { + return getSupportedDatabaseFlagsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.SupportedDatabaseFlag, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.Builder, + com.google.cloud.alloydb.v1.SupportedDatabaseFlagOrBuilder> + getSupportedDatabaseFlagsFieldBuilder() { + if (supportedDatabaseFlagsBuilder_ == null) { + supportedDatabaseFlagsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.SupportedDatabaseFlag, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.Builder, + com.google.cloud.alloydb.v1.SupportedDatabaseFlagOrBuilder>( + supportedDatabaseFlags_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + supportedDatabaseFlags_ = null; + } + return supportedDatabaseFlagsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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.alloydb.v1.ListSupportedDatabaseFlagsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse) + private static final com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse(); + } + + public static com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSupportedDatabaseFlagsResponse 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.alloydb.v1.ListSupportedDatabaseFlagsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListSupportedDatabaseFlagsResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListSupportedDatabaseFlagsResponseOrBuilder.java new file mode 100644 index 000000000000..b74bb5dc404e --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListSupportedDatabaseFlagsResponseOrBuilder.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/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface ListSupportedDatabaseFlagsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + java.util.List getSupportedDatabaseFlagsList(); + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + com.google.cloud.alloydb.v1.SupportedDatabaseFlag getSupportedDatabaseFlags(int index); + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + int getSupportedDatabaseFlagsCount(); + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + java.util.List + getSupportedDatabaseFlagsOrBuilderList(); + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + com.google.cloud.alloydb.v1.SupportedDatabaseFlagOrBuilder getSupportedDatabaseFlagsOrBuilder( + int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/LocationName.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/LocationName.java new file mode 100644 index 000000000000..14342bbdbf6b --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/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.alloydb.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-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/MigrationSource.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/MigrationSource.java new file mode 100644 index 000000000000..cc19a154a703 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/MigrationSource.java @@ -0,0 +1,1137 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Subset of the source instance configuration that is available when reading
+ * the cluster resource.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.MigrationSource} + */ +public final class MigrationSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.MigrationSource) + MigrationSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use MigrationSource.newBuilder() to construct. + private MigrationSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MigrationSource() { + hostPort_ = ""; + referenceId_ = ""; + sourceType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MigrationSource(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_MigrationSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_MigrationSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.MigrationSource.class, + com.google.cloud.alloydb.v1.MigrationSource.Builder.class); + } + + /** + * + * + *
+   * Denote the type of migration source that created this cluster.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.MigrationSource.MigrationSourceType} + */ + public enum MigrationSourceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Migration source is unknown.
+     * 
+ * + * MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + */ + MIGRATION_SOURCE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * DMS source means the cluster was created via DMS migration job.
+     * 
+ * + * DMS = 1; + */ + DMS(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Migration source is unknown.
+     * 
+ * + * MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + */ + public static final int MIGRATION_SOURCE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * DMS source means the cluster was created via DMS migration job.
+     * 
+ * + * DMS = 1; + */ + public static final int DMS_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 MigrationSourceType 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 MigrationSourceType forNumber(int value) { + switch (value) { + case 0: + return MIGRATION_SOURCE_TYPE_UNSPECIFIED; + case 1: + return DMS; + 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 MigrationSourceType findValueByNumber(int number) { + return MigrationSourceType.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.alloydb.v1.MigrationSource.getDescriptor().getEnumTypes().get(0); + } + + private static final MigrationSourceType[] VALUES = values(); + + public static MigrationSourceType 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 MigrationSourceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1.MigrationSource.MigrationSourceType) + } + + public static final int HOST_PORT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object hostPort_ = ""; + /** + * + * + *
+   * Output only. The host and port of the on-premises instance in host:port
+   * format
+   * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The hostPort. + */ + @java.lang.Override + public java.lang.String getHostPort() { + java.lang.Object ref = hostPort_; + 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(); + hostPort_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The host and port of the on-premises instance in host:port
+   * format
+   * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for hostPort. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostPortBytes() { + java.lang.Object ref = hostPort_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostPort_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REFERENCE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object referenceId_ = ""; + /** + * + * + *
+   * Output only. Place holder for the external source identifier(e.g DMS job
+   * name) that created the cluster.
+   * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. Place holder for the external source identifier(e.g DMS job
+   * name) that created the cluster.
+   * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 SOURCE_TYPE_FIELD_NUMBER = 3; + private int sourceType_ = 0; + /** + * + * + *
+   * Output only. Type of migration source.
+   * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for sourceType. + */ + @java.lang.Override + public int getSourceTypeValue() { + return sourceType_; + } + /** + * + * + *
+   * Output only. Type of migration source.
+   * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType getSourceType() { + com.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType result = + com.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType.forNumber(sourceType_); + return result == null + ? com.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType.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(hostPort_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, hostPort_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, referenceId_); + } + if (sourceType_ + != com.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType + .MIGRATION_SOURCE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, sourceType_); + } + 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(hostPort_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, hostPort_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, referenceId_); + } + if (sourceType_ + != com.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType + .MIGRATION_SOURCE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, sourceType_); + } + 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.alloydb.v1.MigrationSource)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.MigrationSource other = + (com.google.cloud.alloydb.v1.MigrationSource) obj; + + if (!getHostPort().equals(other.getHostPort())) return false; + if (!getReferenceId().equals(other.getReferenceId())) return false; + if (sourceType_ != other.sourceType_) 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) + HOST_PORT_FIELD_NUMBER; + hash = (53 * hash) + getHostPort().hashCode(); + hash = (37 * hash) + REFERENCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getReferenceId().hashCode(); + hash = (37 * hash) + SOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + sourceType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.MigrationSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.MigrationSource 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.alloydb.v1.MigrationSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.MigrationSource 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.alloydb.v1.MigrationSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.MigrationSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.MigrationSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.MigrationSource 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.alloydb.v1.MigrationSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.MigrationSource 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.alloydb.v1.MigrationSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.MigrationSource 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.alloydb.v1.MigrationSource 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; + } + /** + * + * + *
+   * Subset of the source instance configuration that is available when reading
+   * the cluster resource.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.MigrationSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.MigrationSource) + com.google.cloud.alloydb.v1.MigrationSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_MigrationSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_MigrationSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.MigrationSource.class, + com.google.cloud.alloydb.v1.MigrationSource.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.MigrationSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + hostPort_ = ""; + referenceId_ = ""; + sourceType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_MigrationSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.MigrationSource getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.MigrationSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.MigrationSource build() { + com.google.cloud.alloydb.v1.MigrationSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.MigrationSource buildPartial() { + com.google.cloud.alloydb.v1.MigrationSource result = + new com.google.cloud.alloydb.v1.MigrationSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.MigrationSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.hostPort_ = hostPort_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.referenceId_ = referenceId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sourceType_ = sourceType_; + } + } + + @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.alloydb.v1.MigrationSource) { + return mergeFrom((com.google.cloud.alloydb.v1.MigrationSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.MigrationSource other) { + if (other == com.google.cloud.alloydb.v1.MigrationSource.getDefaultInstance()) return this; + if (!other.getHostPort().isEmpty()) { + hostPort_ = other.hostPort_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getReferenceId().isEmpty()) { + referenceId_ = other.referenceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.sourceType_ != 0) { + setSourceTypeValue(other.getSourceTypeValue()); + } + 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: + { + hostPort_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + referenceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + sourceType_ = input.readEnum(); + bitField0_ |= 0x00000004; + 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 java.lang.Object hostPort_ = ""; + /** + * + * + *
+     * Output only. The host and port of the on-premises instance in host:port
+     * format
+     * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The hostPort. + */ + public java.lang.String getHostPort() { + java.lang.Object ref = hostPort_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostPort_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The host and port of the on-premises instance in host:port
+     * format
+     * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for hostPort. + */ + public com.google.protobuf.ByteString getHostPortBytes() { + java.lang.Object ref = hostPort_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostPort_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The host and port of the on-premises instance in host:port
+     * format
+     * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The hostPort to set. + * @return This builder for chaining. + */ + public Builder setHostPort(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + hostPort_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The host and port of the on-premises instance in host:port
+     * format
+     * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearHostPort() { + hostPort_ = getDefaultInstance().getHostPort(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The host and port of the on-premises instance in host:port
+     * format
+     * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for hostPort to set. + * @return This builder for chaining. + */ + public Builder setHostPortBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + hostPort_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object referenceId_ = ""; + /** + * + * + *
+     * Output only. Place holder for the external source identifier(e.g DMS job
+     * name) that created the cluster.
+     * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. Place holder for the external source identifier(e.g DMS job
+     * name) that created the cluster.
+     * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. Place holder for the external source identifier(e.g DMS job
+     * name) that created the cluster.
+     * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Place holder for the external source identifier(e.g DMS job
+     * name) that created the cluster.
+     * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReferenceId() { + referenceId_ = getDefaultInstance().getReferenceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Place holder for the external source identifier(e.g DMS job
+     * name) that created the cluster.
+     * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int sourceType_ = 0; + /** + * + * + *
+     * Output only. Type of migration source.
+     * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for sourceType. + */ + @java.lang.Override + public int getSourceTypeValue() { + return sourceType_; + } + /** + * + * + *
+     * Output only. Type of migration source.
+     * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for sourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceTypeValue(int value) { + sourceType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of migration source.
+     * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType getSourceType() { + com.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType result = + com.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType.forNumber(sourceType_); + return result == null + ? com.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Type of migration source.
+     * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The sourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceType( + com.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + sourceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of migration source.
+     * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSourceType() { + bitField0_ = (bitField0_ & ~0x00000004); + sourceType_ = 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.alloydb.v1.MigrationSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.MigrationSource) + private static final com.google.cloud.alloydb.v1.MigrationSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.MigrationSource(); + } + + public static com.google.cloud.alloydb.v1.MigrationSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MigrationSource 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.alloydb.v1.MigrationSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/MigrationSourceOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/MigrationSourceOrBuilder.java new file mode 100644 index 000000000000..f50967c71b48 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/MigrationSourceOrBuilder.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/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public interface MigrationSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.MigrationSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The host and port of the on-premises instance in host:port
+   * format
+   * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The hostPort. + */ + java.lang.String getHostPort(); + /** + * + * + *
+   * Output only. The host and port of the on-premises instance in host:port
+   * format
+   * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for hostPort. + */ + com.google.protobuf.ByteString getHostPortBytes(); + + /** + * + * + *
+   * Output only. Place holder for the external source identifier(e.g DMS job
+   * name) that created the cluster.
+   * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The referenceId. + */ + java.lang.String getReferenceId(); + /** + * + * + *
+   * Output only. Place holder for the external source identifier(e.g DMS job
+   * name) that created the cluster.
+   * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for referenceId. + */ + com.google.protobuf.ByteString getReferenceIdBytes(); + + /** + * + * + *
+   * Output only. Type of migration source.
+   * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for sourceType. + */ + int getSourceTypeValue(); + /** + * + * + *
+   * Output only. Type of migration source.
+   * 
+ * + * + * .google.cloud.alloydb.v1.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceType. + */ + com.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType getSourceType(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/OperationMetadata.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/OperationMetadata.java new file mode 100644 index 000000000000..a008937fa85d --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/OperationMetadata.java @@ -0,0 +1,2241 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.OperationMetadata.class, + com.google.cloud.alloydb.v1.OperationMetadata.Builder.class); + } + + private int requestSpecificCase_ = 0; + private java.lang.Object requestSpecific_; + + public enum RequestSpecificCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BATCH_CREATE_INSTANCES_METADATA(8), + REQUESTSPECIFIC_NOT_SET(0); + private final int value; + + private RequestSpecificCase(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 RequestSpecificCase valueOf(int value) { + return forNumber(value); + } + + public static RequestSpecificCase forNumber(int value) { + switch (value) { + case 8: + return BATCH_CREATE_INSTANCES_METADATA; + case 0: + return REQUESTSPECIFIC_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RequestSpecificCase getRequestSpecificCase() { + return RequestSpecificCase.forNumber(requestSpecificCase_); + } + + public static final int BATCH_CREATE_INSTANCES_METADATA_FIELD_NUMBER = 8; + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the batchCreateInstancesMetadata field is set. + */ + @java.lang.Override + public boolean hasBatchCreateInstancesMetadata() { + return requestSpecificCase_ == 8; + } + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The batchCreateInstancesMetadata. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata + getBatchCreateInstancesMetadata() { + if (requestSpecificCase_ == 8) { + return (com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) requestSpecific_; + } + return com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstancesMetadataOrBuilder + getBatchCreateInstancesMetadataOrBuilder() { + if (requestSpecificCase_ == 8) { + return (com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) requestSpecific_; + } + return com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.getDefaultInstance(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int TARGET_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object verb_ = ""; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object statusMessage_ = ""; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + 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(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_ = false; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiVersion_ = ""; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + if (requestSpecificCase_ == 8) { + output.writeMessage( + 8, (com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) requestSpecific_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + if (requestSpecificCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) requestSpecific_); + } + 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.alloydb.v1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.OperationMetadata other = + (com.google.cloud.alloydb.v1.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (!getRequestSpecificCase().equals(other.getRequestSpecificCase())) return false; + switch (requestSpecificCase_) { + case 8: + if (!getBatchCreateInstancesMetadata().equals(other.getBatchCreateInstancesMetadata())) + 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(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + switch (requestSpecificCase_) { + case 8: + hash = (37 * hash) + BATCH_CREATE_INSTANCES_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getBatchCreateInstancesMetadata().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.OperationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.OperationMetadata 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.alloydb.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.OperationMetadata 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.alloydb.v1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.OperationMetadata 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.alloydb.v1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.OperationMetadata 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.alloydb.v1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.OperationMetadata 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.alloydb.v1.OperationMetadata 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 metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.OperationMetadata) + com.google.cloud.alloydb.v1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.OperationMetadata.class, + com.google.cloud.alloydb.v1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.OperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (batchCreateInstancesMetadataBuilder_ != null) { + batchCreateInstancesMetadataBuilder_.clear(); + } + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + requestedCancellation_ = false; + apiVersion_ = ""; + requestSpecificCase_ = 0; + requestSpecific_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.OperationMetadata build() { + com.google.cloud.alloydb.v1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.OperationMetadata buildPartial() { + com.google.cloud.alloydb.v1.OperationMetadata result = + new com.google.cloud.alloydb.v1.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.OperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.verb_ = verb_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.statusMessage_ = statusMessage_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.apiVersion_ = apiVersion_; + } + } + + private void buildPartialOneofs(com.google.cloud.alloydb.v1.OperationMetadata result) { + result.requestSpecificCase_ = requestSpecificCase_; + result.requestSpecific_ = this.requestSpecific_; + if (requestSpecificCase_ == 8 && batchCreateInstancesMetadataBuilder_ != null) { + result.requestSpecific_ = batchCreateInstancesMetadataBuilder_.build(); + } + } + + @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.alloydb.v1.OperationMetadata) { + return mergeFrom((com.google.cloud.alloydb.v1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.OperationMetadata other) { + if (other == com.google.cloud.alloydb.v1.OperationMetadata.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + bitField0_ |= 0x00000080; + onChanged(); + } + switch (other.getRequestSpecificCase()) { + case BATCH_CREATE_INSTANCES_METADATA: + { + mergeBatchCreateInstancesMetadata(other.getBatchCreateInstancesMetadata()); + break; + } + case REQUESTSPECIFIC_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(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 26: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + verb_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + statusMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 48: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 48 + case 58: + { + apiVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + input.readMessage( + getBatchCreateInstancesMetadataFieldBuilder().getBuilder(), extensionRegistry); + requestSpecificCase_ = 8; + break; + } // case 66 + 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 requestSpecificCase_ = 0; + private java.lang.Object requestSpecific_; + + public RequestSpecificCase getRequestSpecificCase() { + return RequestSpecificCase.forNumber(requestSpecificCase_); + } + + public Builder clearRequestSpecific() { + requestSpecificCase_ = 0; + requestSpecific_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata, + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.Builder, + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadataOrBuilder> + batchCreateInstancesMetadataBuilder_; + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the batchCreateInstancesMetadata field is set. + */ + @java.lang.Override + public boolean hasBatchCreateInstancesMetadata() { + return requestSpecificCase_ == 8; + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The batchCreateInstancesMetadata. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata + getBatchCreateInstancesMetadata() { + if (batchCreateInstancesMetadataBuilder_ == null) { + if (requestSpecificCase_ == 8) { + return (com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) requestSpecific_; + } + return com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.getDefaultInstance(); + } else { + if (requestSpecificCase_ == 8) { + return batchCreateInstancesMetadataBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBatchCreateInstancesMetadata( + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata value) { + if (batchCreateInstancesMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestSpecific_ = value; + onChanged(); + } else { + batchCreateInstancesMetadataBuilder_.setMessage(value); + } + requestSpecificCase_ = 8; + return this; + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBatchCreateInstancesMetadata( + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.Builder builderForValue) { + if (batchCreateInstancesMetadataBuilder_ == null) { + requestSpecific_ = builderForValue.build(); + onChanged(); + } else { + batchCreateInstancesMetadataBuilder_.setMessage(builderForValue.build()); + } + requestSpecificCase_ = 8; + return this; + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeBatchCreateInstancesMetadata( + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata value) { + if (batchCreateInstancesMetadataBuilder_ == null) { + if (requestSpecificCase_ == 8 + && requestSpecific_ + != com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.getDefaultInstance()) { + requestSpecific_ = + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.newBuilder( + (com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) requestSpecific_) + .mergeFrom(value) + .buildPartial(); + } else { + requestSpecific_ = value; + } + onChanged(); + } else { + if (requestSpecificCase_ == 8) { + batchCreateInstancesMetadataBuilder_.mergeFrom(value); + } else { + batchCreateInstancesMetadataBuilder_.setMessage(value); + } + } + requestSpecificCase_ = 8; + return this; + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearBatchCreateInstancesMetadata() { + if (batchCreateInstancesMetadataBuilder_ == null) { + if (requestSpecificCase_ == 8) { + requestSpecificCase_ = 0; + requestSpecific_ = null; + onChanged(); + } + } else { + if (requestSpecificCase_ == 8) { + requestSpecificCase_ = 0; + requestSpecific_ = null; + } + batchCreateInstancesMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.Builder + getBatchCreateInstancesMetadataBuilder() { + return getBatchCreateInstancesMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BatchCreateInstancesMetadataOrBuilder + getBatchCreateInstancesMetadataOrBuilder() { + if ((requestSpecificCase_ == 8) && (batchCreateInstancesMetadataBuilder_ != null)) { + return batchCreateInstancesMetadataBuilder_.getMessageOrBuilder(); + } else { + if (requestSpecificCase_ == 8) { + return (com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) requestSpecific_; + } + return com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata, + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.Builder, + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadataOrBuilder> + getBatchCreateInstancesMetadataFieldBuilder() { + if (batchCreateInstancesMetadataBuilder_ == null) { + if (!(requestSpecificCase_ == 8)) { + requestSpecific_ = + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.getDefaultInstance(); + } + batchCreateInstancesMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata, + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.Builder, + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadataOrBuilder>( + (com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) requestSpecific_, + getParentForChildren(), + isClean()); + requestSpecific_ = null; + } + requestSpecificCase_ = 8; + onChanged(); + return batchCreateInstancesMetadataBuilder_; + } + + 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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000002); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + target_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + verb_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + verb_ = getDefaultInstance().getVerb(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + verb_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + statusMessage_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + statusMessage_ = getDefaultInstance().getStatusMessage(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + statusMessage_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + bitField0_ = (bitField0_ & ~0x00000040); + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiVersion_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + apiVersion_ = getDefaultInstance().getApiVersion(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiVersion_ = value; + bitField0_ |= 0x00000080; + 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.alloydb.v1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.OperationMetadata) + private static final com.google.cloud.alloydb.v1.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.OperationMetadata(); + } + + public static com.google.cloud.alloydb.v1.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata 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.alloydb.v1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/OperationMetadataOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..e1bf7851b3e2 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/OperationMetadataOrBuilder.java @@ -0,0 +1,262 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the batchCreateInstancesMetadata field is set. + */ + boolean hasBatchCreateInstancesMetadata(); + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The batchCreateInstancesMetadata. + */ + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadata getBatchCreateInstancesMetadata(); + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1.BatchCreateInstancesMetadataOrBuilder + getBatchCreateInstancesMetadataOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); + + public com.google.cloud.alloydb.v1.OperationMetadata.RequestSpecificCase getRequestSpecificCase(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ResourcesProto.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ResourcesProto.java new file mode 100644 index 000000000000..630f48287b57 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ResourcesProto.java @@ -0,0 +1,747 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public final class ResourcesProto { + private ResourcesProto() {} + + 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_alloydb_v1_UserPassword_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_UserPassword_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_MigrationSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_MigrationSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_EncryptionConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_EncryptionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_EncryptionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_EncryptionInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_SslConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_SslConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_WeeklySchedule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_WeeklySchedule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_TimeBasedRetention_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_TimeBasedRetention_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_QuantityBasedRetention_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_QuantityBasedRetention_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_BackupSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_BackupSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Cluster_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Cluster_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Cluster_SecondaryConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Cluster_SecondaryConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Cluster_PrimaryConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Cluster_PrimaryConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Cluster_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Cluster_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Cluster_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Cluster_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Instance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Instance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Instance_MachineConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Instance_MachineConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Instance_Node_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Instance_Node_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Instance_QueryInsightsInstanceConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Instance_QueryInsightsInstanceConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Instance_ReadPoolConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Instance_ReadPoolConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Instance_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Instance_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Instance_DatabaseFlagsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Instance_DatabaseFlagsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Instance_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Instance_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Backup_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Backup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Backup_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Backup_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_Backup_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_Backup_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_StringRestrictions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_StringRestrictions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_IntegerRestrictions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_IntegerRestrictions_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/alloydb/v1/resources.prot" + + "o\022\027google.cloud.alloydb.v1\032\037google/api/f" + + "ield_behavior.proto\032\031google/api/resource" + + ".proto\032\036google/protobuf/duration.proto\032\037" + + "google/protobuf/timestamp.proto\032\036google/" + + "protobuf/wrappers.proto\032\033google/type/day" + + "ofweek.proto\032\033google/type/timeofday.prot" + + "o\".\n\014UserPassword\022\014\n\004user\030\001 \001(\t\022\020\n\010passw" + + "ord\030\002 \001(\t\"\343\001\n\017MigrationSource\022\026\n\thost_po" + + "rt\030\001 \001(\tB\003\340A\003\022\031\n\014reference_id\030\002 \001(\tB\003\340A\003" + + "\022V\n\013source_type\030\003 \001(\0162<.google.cloud.all" + + "oydb.v1.MigrationSource.MigrationSourceT" + + "ypeB\003\340A\003\"E\n\023MigrationSourceType\022%\n!MIGRA" + + "TION_SOURCE_TYPE_UNSPECIFIED\020\000\022\007\n\003DMS\020\001\"" + + "(\n\020EncryptionConfig\022\024\n\014kms_key_name\030\001 \001(" + + "\t\"\206\002\n\016EncryptionInfo\022J\n\017encryption_type\030" + + "\001 \001(\0162,.google.cloud.alloydb.v1.Encrypti" + + "onInfo.TypeB\003\340A\003\022J\n\020kms_key_versions\030\002 \003" + + "(\tB0\340A\003\372A*\n(cloudkms.googleapis.com/Cryp" + + "toKeyVersion\"\\\n\004Type\022\024\n\020TYPE_UNSPECIFIED" + + "\020\000\022\035\n\031GOOGLE_DEFAULT_ENCRYPTION\020\001\022\037\n\033CUS" + + "TOMER_MANAGED_ENCRYPTION\020\002\"\270\002\n\tSslConfig" + + "\022A\n\010ssl_mode\030\001 \001(\0162*.google.cloud.alloyd" + + "b.v1.SslConfig.SslModeB\003\340A\001\022C\n\tca_source" + + "\030\002 \001(\0162+.google.cloud.alloydb.v1.SslConf" + + "ig.CaSourceB\003\340A\001\"e\n\007SslMode\022\030\n\024SSL_MODE_" + + "UNSPECIFIED\020\000\022\022\n\016SSL_MODE_ALLOW\020\001\022\024\n\020SSL" + + "_MODE_REQUIRE\020\002\022\026\n\022SSL_MODE_VERIFY_CA\020\003\"" + + "<\n\010CaSource\022\031\n\025CA_SOURCE_UNSPECIFIED\020\000\022\025" + + "\n\021CA_SOURCE_MANAGED\020\001\"\345\006\n\025AutomatedBacku" + + "pPolicy\022X\n\017weekly_schedule\030\002 \001(\0132=.googl" + + "e.cloud.alloydb.v1.AutomatedBackupPolicy" + + ".WeeklyScheduleH\000\022a\n\024time_based_retentio" + + "n\030\004 \001(\0132A.google.cloud.alloydb.v1.Automa" + + "tedBackupPolicy.TimeBasedRetentionH\001\022i\n\030" + + "quantity_based_retention\030\005 \001(\0132E.google." + + "cloud.alloydb.v1.AutomatedBackupPolicy.Q" + + "uantityBasedRetentionH\001\022\024\n\007enabled\030\001 \001(\010" + + "H\002\210\001\001\0220\n\rbackup_window\030\003 \001(\0132\031.google.pr" + + "otobuf.Duration\022I\n\021encryption_config\030\010 \001" + + "(\0132).google.cloud.alloydb.v1.EncryptionC" + + "onfigB\003\340A\001\022\020\n\010location\030\006 \001(\t\022J\n\006labels\030\007" + + " \003(\0132:.google.cloud.alloydb.v1.Automated" + + "BackupPolicy.LabelsEntry\032k\n\016WeeklySchedu" + + "le\022+\n\013start_times\030\001 \003(\0132\026.google.type.Ti" + + "meOfDay\022,\n\014days_of_week\030\002 \003(\0162\026.google.t" + + "ype.DayOfWeek\032I\n\022TimeBasedRetention\0223\n\020r" + + "etention_period\030\001 \001(\0132\031.google.protobuf." + + "Duration\032\'\n\026QuantityBasedRetention\022\r\n\005co" + + "unt\030\001 \001(\005\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001B\n\n\010scheduleB\013\n\tretentio" + + "nB\n\n\010_enabled\"c\n\014BackupSource\022\027\n\nbackup_" + + "uid\030\002 \001(\tB\003\340A\003\022:\n\013backup_name\030\001 \001(\tB%\340A\002" + + "\372A\037\n\035alloydb.googleapis.com/Backup\"\302\016\n\007C" + + "luster\022C\n\rbackup_source\030\017 \001(\0132%.google.c" + + "loud.alloydb.v1.BackupSourceB\003\340A\003H\000\022I\n\020m" + + "igration_source\030\020 \001(\0132(.google.cloud.all" + + "oydb.v1.MigrationSourceB\003\340A\003H\000\022\021\n\004name\030\001" + + " \001(\tB\003\340A\003\022\024\n\014display_name\030\002 \001(\t\022\020\n\003uid\030\003" + + " \001(\tB\003\340A\003\0224\n\013create_time\030\004 \001(\0132\032.google." + + "protobuf.TimestampB\003\340A\003\0224\n\013update_time\030\005" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013delete_time\030\006 \001(\0132\032.google.protobuf.Tim" + + "estampB\003\340A\003\022<\n\006labels\030\007 \003(\0132,.google.clo" + + "ud.alloydb.v1.Cluster.LabelsEntry\022:\n\005sta" + + "te\030\010 \001(\0162&.google.cloud.alloydb.v1.Clust" + + "er.StateB\003\340A\003\022G\n\014cluster_type\030\030 \001(\0162,.go" + + "ogle.cloud.alloydb.v1.Cluster.ClusterTyp" + + "eB\003\340A\003\022G\n\020database_version\030\t \001(\0162(.googl" + + "e.cloud.alloydb.v1.DatabaseVersionB\003\340A\003\022" + + "7\n\007network\030\n \001(\tB&\340A\002\372A \n\036compute.google" + + "apis.com/Network\022\014\n\004etag\030\013 \001(\t\022F\n\013annota" + + "tions\030\014 \003(\01321.google.cloud.alloydb.v1.Cl" + + "uster.AnnotationsEntry\022\030\n\013reconciling\030\r " + + "\001(\010B\003\340A\003\022@\n\014initial_user\030\016 \001(\0132%.google." + + "cloud.alloydb.v1.UserPasswordB\003\340A\004\022O\n\027au" + + "tomated_backup_policy\030\021 \001(\0132..google.clo" + + "ud.alloydb.v1.AutomatedBackupPolicy\0226\n\ns" + + "sl_config\030\022 \001(\0132\".google.cloud.alloydb.v" + + "1.SslConfig\022I\n\021encryption_config\030\023 \001(\0132)" + + ".google.cloud.alloydb.v1.EncryptionConfi" + + "gB\003\340A\001\022E\n\017encryption_info\030\024 \001(\0132\'.google" + + ".cloud.alloydb.v1.EncryptionInfoB\003\340A\003\022J\n" + + "\020secondary_config\030\026 \001(\01320.google.cloud.a" + + "lloydb.v1.Cluster.SecondaryConfig\022K\n\016pri" + + "mary_config\030\027 \001(\0132..google.cloud.alloydb" + + ".v1.Cluster.PrimaryConfigB\003\340A\003\032/\n\017Second" + + "aryConfig\022\034\n\024primary_cluster_name\030\001 \001(\t\032" + + "5\n\rPrimaryConfig\022$\n\027secondary_cluster_na" + + "mes\030\001 \003(\tB\003\340A\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001" + + "(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020AnnotationsEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\234\001\n\005St" + + "ate\022\025\n\021STATE_UNSPECIFIED\020\000\022\t\n\005READY\020\001\022\013\n" + + "\007STOPPED\020\002\022\t\n\005EMPTY\020\003\022\014\n\010CREATING\020\004\022\014\n\010D" + + "ELETING\020\005\022\n\n\006FAILED\020\006\022\021\n\rBOOTSTRAPPING\020\007" + + "\022\017\n\013MAINTENANCE\020\010\022\r\n\tPROMOTING\020\t\"G\n\013Clus" + + "terType\022\034\n\030CLUSTER_TYPE_UNSPECIFIED\020\000\022\013\n" + + "\007PRIMARY\020\001\022\r\n\tSECONDARY\020\002:b\352A_\n\036alloydb." + + "googleapis.com/Cluster\022:projects/{projec" + + "t}/locations/{location}/clusters/{cluste" + + "r}R\001\001B\010\n\006source\"\263\020\n\010Instance\022\021\n\004name\030\001 \001" + + "(\tB\003\340A\003\022\024\n\014display_name\030\002 \001(\t\022\020\n\003uid\030\003 \001" + + "(\tB\003\340A\003\0224\n\013create_time\030\004 \001(\0132\032.google.pr" + + "otobuf.TimestampB\003\340A\003\0224\n\013update_time\030\005 \001" + + "(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n\013d" + + "elete_time\030\006 \001(\0132\032.google.protobuf.Times" + + "tampB\003\340A\003\022=\n\006labels\030\007 \003(\0132-.google.cloud" + + ".alloydb.v1.Instance.LabelsEntry\022;\n\005stat" + + "e\030\010 \001(\0162\'.google.cloud.alloydb.v1.Instan" + + "ce.StateB\003\340A\003\022J\n\rinstance_type\030\t \001(\0162..g" + + "oogle.cloud.alloydb.v1.Instance.Instance" + + "TypeB\003\340A\002\022G\n\016machine_config\030\n \001(\0132/.goog" + + "le.cloud.alloydb.v1.Instance.MachineConf" + + "ig\022M\n\021availability_type\030\013 \001(\01622.google.c" + + "loud.alloydb.v1.Instance.AvailabilityTyp" + + "e\022\020\n\010gce_zone\030\014 \001(\t\022L\n\016database_flags\030\r " + + "\003(\01324.google.cloud.alloydb.v1.Instance.D" + + "atabaseFlagsEntry\022B\n\rwritable_node\030\023 \001(\013" + + "2&.google.cloud.alloydb.v1.Instance.Node" + + "B\003\340A\003\022:\n\005nodes\030\024 \003(\0132&.google.cloud.allo" + + "ydb.v1.Instance.NodeB\003\340A\003\022\\\n\025query_insig" + + "hts_config\030\025 \001(\0132=.google.cloud.alloydb." + + "v1.Instance.QueryInsightsInstanceConfig\022" + + "J\n\020read_pool_config\030\016 \001(\01320.google.cloud" + + ".alloydb.v1.Instance.ReadPoolConfig\022\027\n\ni" + + "p_address\030\017 \001(\tB\003\340A\003\022\030\n\013reconciling\030\020 \001(" + + "\010B\003\340A\003\022\014\n\004etag\030\021 \001(\t\022G\n\013annotations\030\022 \003(" + + "\01322.google.cloud.alloydb.v1.Instance.Ann" + + "otationsEntry\032\"\n\rMachineConfig\022\021\n\tcpu_co" + + "unt\030\001 \001(\005\032>\n\004Node\022\017\n\007zone_id\030\001 \001(\t\022\n\n\002id" + + "\030\002 \001(\t\022\n\n\002ip\030\003 \001(\t\022\r\n\005state\030\004 \001(\t\032\372\001\n\033Qu" + + "eryInsightsInstanceConfig\022$\n\027record_appl" + + "ication_tags\030\002 \001(\010H\000\210\001\001\022\"\n\025record_client" + + "_address\030\003 \001(\010H\001\210\001\001\022\033\n\023query_string_leng" + + "th\030\004 \001(\r\022#\n\026query_plans_per_minute\030\005 \001(\r" + + "H\002\210\001\001B\032\n\030_record_application_tagsB\030\n\026_re" + + "cord_client_addressB\031\n\027_query_plans_per_" + + "minute\032$\n\016ReadPoolConfig\022\022\n\nnode_count\030\001" + + " \001(\005\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" + + "e\030\002 \001(\t:\0028\001\0324\n\022DatabaseFlagsEntry\022\013\n\003key" + + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020Annotations" + + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\221\001" + + "\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\t\n\005READY\020" + + "\001\022\013\n\007STOPPED\020\002\022\014\n\010CREATING\020\003\022\014\n\010DELETING" + + "\020\004\022\017\n\013MAINTENANCE\020\005\022\n\n\006FAILED\020\006\022\021\n\rBOOTS" + + "TRAPPING\020\010\022\r\n\tPROMOTING\020\t\"X\n\014InstanceTyp" + + "e\022\035\n\031INSTANCE_TYPE_UNSPECIFIED\020\000\022\013\n\007PRIM" + + "ARY\020\001\022\r\n\tREAD_POOL\020\002\022\r\n\tSECONDARY\020\003\"N\n\020A" + + "vailabilityType\022!\n\035AVAILABILITY_TYPE_UNS" + + "PECIFIED\020\000\022\t\n\005ZONAL\020\001\022\014\n\010REGIONAL\020\002:x\352Au" + + "\n\037alloydb.googleapis.com/Instance\022Oproje" + + "cts/{project}/locations/{location}/clust" + + "ers/{cluster}/instances/{instance}R\001\001\"\261\t" + + "\n\006Backup\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\024\n\014display_n" + + "ame\030\002 \001(\t\022\020\n\003uid\030\003 \001(\tB\003\340A\003\0224\n\013create_ti" + + "me\030\004 \001(\0132\032.google.protobuf.TimestampB\003\340A" + + "\003\0224\n\013update_time\030\005 \001(\0132\032.google.protobuf" + + ".TimestampB\003\340A\003\0224\n\013delete_time\030\017 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\003\340A\003\022;\n\006labels\030" + + "\006 \003(\0132+.google.cloud.alloydb.v1.Backup.L" + + "abelsEntry\0229\n\005state\030\007 \001(\0162%.google.cloud" + + ".alloydb.v1.Backup.StateB\003\340A\003\0222\n\004type\030\010 " + + "\001(\0162$.google.cloud.alloydb.v1.Backup.Typ" + + "e\022\023\n\013description\030\t \001(\t\022\030\n\013cluster_uid\030\022 " + + "\001(\tB\003\340A\003\022<\n\014cluster_name\030\n \001(\tB&\340A\002\372A \n\036" + + "alloydb.googleapis.com/Cluster\022\030\n\013reconc" + + "iling\030\013 \001(\010B\003\340A\003\022I\n\021encryption_config\030\014 " + + "\001(\0132).google.cloud.alloydb.v1.Encryption" + + "ConfigB\003\340A\001\022E\n\017encryption_info\030\r \001(\0132\'.g" + + "oogle.cloud.alloydb.v1.EncryptionInfoB\003\340" + + "A\003\022\014\n\004etag\030\016 \001(\t\022E\n\013annotations\030\020 \003(\01320." + + "google.cloud.alloydb.v1.Backup.Annotatio" + + "nsEntry\022\027\n\nsize_bytes\030\021 \001(\003B\003\340A\003\0224\n\013expi" + + "ry_time\030\023 \001(\0132\032.google.protobuf.Timestam" + + "pB\003\340A\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" + + "lue\030\002 \001(\t:\0028\001\0322\n\020AnnotationsEntry\022\013\n\003key" + + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"Q\n\005State\022\025\n\021ST" + + "ATE_UNSPECIFIED\020\000\022\t\n\005READY\020\001\022\014\n\010CREATING" + + "\020\002\022\n\n\006FAILED\020\003\022\014\n\010DELETING\020\004\"J\n\004Type\022\024\n\020" + + "TYPE_UNSPECIFIED\020\000\022\r\n\tON_DEMAND\020\001\022\r\n\tAUT" + + "OMATED\020\002\022\016\n\nCONTINUOUS\020\003:_\352A\\\n\035alloydb.g" + + "oogleapis.com/Backup\0228projects/{project}" + + "/locations/{location}/backups/{backup}R\001" + + "\001\"\310\006\n\025SupportedDatabaseFlag\022`\n\023string_re" + + "strictions\030\007 \001(\0132A.google.cloud.alloydb." + + "v1.SupportedDatabaseFlag.StringRestricti" + + "onsH\000\022b\n\024integer_restrictions\030\010 \001(\0132B.go" + + "ogle.cloud.alloydb.v1.SupportedDatabaseF" + + "lag.IntegerRestrictionsH\000\022\014\n\004name\030\001 \001(\t\022" + + "\021\n\tflag_name\030\002 \001(\t\022L\n\nvalue_type\030\003 \001(\01628" + + ".google.cloud.alloydb.v1.SupportedDataba" + + "seFlag.ValueType\022\037\n\027accepts_multiple_val" + + "ues\030\004 \001(\010\022G\n\025supported_db_versions\030\005 \003(\016" + + "2(.google.cloud.alloydb.v1.DatabaseVersi" + + "on\022\033\n\023requires_db_restart\030\006 \001(\010\032,\n\022Strin" + + "gRestrictions\022\026\n\016allowed_values\030\001 \003(\t\032u\n" + + "\023IntegerRestrictions\022.\n\tmin_value\030\001 \001(\0132" + + "\033.google.protobuf.Int64Value\022.\n\tmax_valu" + + "e\030\002 \001(\0132\033.google.protobuf.Int64Value\"U\n\t" + + "ValueType\022\032\n\026VALUE_TYPE_UNSPECIFIED\020\000\022\n\n" + + "\006STRING\020\001\022\013\n\007INTEGER\020\002\022\t\n\005FLOAT\020\003\022\010\n\004NON" + + "E\020\004:g\352Ad\n,alloydb.googleapis.com/Support" + + "edDatabaseFlag\0224projects/{project}/locat" + + "ions/{location}/flags/{flag}B\016\n\014restrict" + + "ions*Y\n\017DatabaseVersion\022 \n\034DATABASE_VERS" + + "ION_UNSPECIFIED\020\000\022\023\n\013POSTGRES_13\020\001\032\002\010\001\022\017" + + "\n\013POSTGRES_14\020\002*^\n\014InstanceView\022\035\n\031INSTA" + + "NCE_VIEW_UNSPECIFIED\020\000\022\027\n\023INSTANCE_VIEW_" + + "BASIC\020\001\022\026\n\022INSTANCE_VIEW_FULL\020\002B\262\003\n\033com." + + "google.cloud.alloydb.v1B\016ResourcesProtoP" + + "\001Z5cloud.google.com/go/alloydb/apiv1/all" + + "oydbpb;alloydbpb\252\002\027Google.Cloud.AlloyDb." + + "V1\312\002\027Google\\Cloud\\AlloyDb\\V1\352\002\032Google::C" + + "loud::AlloyDb::V1\352A\246\001\n(cloudkms.googleap" + + "is.com/CryptoKeyVersion\022zprojects/{proje" + + "ct}/locations/{location}/keyRings/{key_r" + + "ing}/cryptoKeys/{crypto_key}/cryptoKeyVe" + + "rsions/{crypto_key_version}\352AN\n\036compute." + + "googleapis.com/Network\022,projects/{projec" + + "t}/global/networks/{network}b\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.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + com.google.type.DayOfWeekProto.getDescriptor(), + com.google.type.TimeOfDayProto.getDescriptor(), + }); + internal_static_google_cloud_alloydb_v1_UserPassword_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_alloydb_v1_UserPassword_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_UserPassword_descriptor, + new java.lang.String[] { + "User", "Password", + }); + internal_static_google_cloud_alloydb_v1_MigrationSource_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_alloydb_v1_MigrationSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_MigrationSource_descriptor, + new java.lang.String[] { + "HostPort", "ReferenceId", "SourceType", + }); + internal_static_google_cloud_alloydb_v1_EncryptionConfig_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_alloydb_v1_EncryptionConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_EncryptionConfig_descriptor, + new java.lang.String[] { + "KmsKeyName", + }); + internal_static_google_cloud_alloydb_v1_EncryptionInfo_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_alloydb_v1_EncryptionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_EncryptionInfo_descriptor, + new java.lang.String[] { + "EncryptionType", "KmsKeyVersions", + }); + internal_static_google_cloud_alloydb_v1_SslConfig_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_alloydb_v1_SslConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_SslConfig_descriptor, + new java.lang.String[] { + "SslMode", "CaSource", + }); + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_descriptor, + new java.lang.String[] { + "WeeklySchedule", + "TimeBasedRetention", + "QuantityBasedRetention", + "Enabled", + "BackupWindow", + "EncryptionConfig", + "Location", + "Labels", + "Schedule", + "Retention", + "Enabled", + }); + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_WeeklySchedule_descriptor = + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_WeeklySchedule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_WeeklySchedule_descriptor, + new java.lang.String[] { + "StartTimes", "DaysOfWeek", + }); + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_TimeBasedRetention_descriptor = + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_TimeBasedRetention_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_TimeBasedRetention_descriptor, + new java.lang.String[] { + "RetentionPeriod", + }); + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_QuantityBasedRetention_descriptor = + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_QuantityBasedRetention_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_QuantityBasedRetention_descriptor, + new java.lang.String[] { + "Count", + }); + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_descriptor + .getNestedTypes() + .get(3); + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1_BackupSource_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_alloydb_v1_BackupSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_BackupSource_descriptor, + new java.lang.String[] { + "BackupUid", "BackupName", + }); + internal_static_google_cloud_alloydb_v1_Cluster_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_alloydb_v1_Cluster_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Cluster_descriptor, + new java.lang.String[] { + "BackupSource", + "MigrationSource", + "Name", + "DisplayName", + "Uid", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Labels", + "State", + "ClusterType", + "DatabaseVersion", + "Network", + "Etag", + "Annotations", + "Reconciling", + "InitialUser", + "AutomatedBackupPolicy", + "SslConfig", + "EncryptionConfig", + "EncryptionInfo", + "SecondaryConfig", + "PrimaryConfig", + "Source", + }); + internal_static_google_cloud_alloydb_v1_Cluster_SecondaryConfig_descriptor = + internal_static_google_cloud_alloydb_v1_Cluster_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_alloydb_v1_Cluster_SecondaryConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Cluster_SecondaryConfig_descriptor, + new java.lang.String[] { + "PrimaryClusterName", + }); + internal_static_google_cloud_alloydb_v1_Cluster_PrimaryConfig_descriptor = + internal_static_google_cloud_alloydb_v1_Cluster_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_alloydb_v1_Cluster_PrimaryConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Cluster_PrimaryConfig_descriptor, + new java.lang.String[] { + "SecondaryClusterNames", + }); + internal_static_google_cloud_alloydb_v1_Cluster_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1_Cluster_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_alloydb_v1_Cluster_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Cluster_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1_Cluster_AnnotationsEntry_descriptor = + internal_static_google_cloud_alloydb_v1_Cluster_descriptor.getNestedTypes().get(3); + internal_static_google_cloud_alloydb_v1_Cluster_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Cluster_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1_Instance_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_alloydb_v1_Instance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Instance_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Uid", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Labels", + "State", + "InstanceType", + "MachineConfig", + "AvailabilityType", + "GceZone", + "DatabaseFlags", + "WritableNode", + "Nodes", + "QueryInsightsConfig", + "ReadPoolConfig", + "IpAddress", + "Reconciling", + "Etag", + "Annotations", + }); + internal_static_google_cloud_alloydb_v1_Instance_MachineConfig_descriptor = + internal_static_google_cloud_alloydb_v1_Instance_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_alloydb_v1_Instance_MachineConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Instance_MachineConfig_descriptor, + new java.lang.String[] { + "CpuCount", + }); + internal_static_google_cloud_alloydb_v1_Instance_Node_descriptor = + internal_static_google_cloud_alloydb_v1_Instance_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_alloydb_v1_Instance_Node_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Instance_Node_descriptor, + new java.lang.String[] { + "ZoneId", "Id", "Ip", "State", + }); + internal_static_google_cloud_alloydb_v1_Instance_QueryInsightsInstanceConfig_descriptor = + internal_static_google_cloud_alloydb_v1_Instance_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_alloydb_v1_Instance_QueryInsightsInstanceConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Instance_QueryInsightsInstanceConfig_descriptor, + new java.lang.String[] { + "RecordApplicationTags", + "RecordClientAddress", + "QueryStringLength", + "QueryPlansPerMinute", + "RecordApplicationTags", + "RecordClientAddress", + "QueryPlansPerMinute", + }); + internal_static_google_cloud_alloydb_v1_Instance_ReadPoolConfig_descriptor = + internal_static_google_cloud_alloydb_v1_Instance_descriptor.getNestedTypes().get(3); + internal_static_google_cloud_alloydb_v1_Instance_ReadPoolConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Instance_ReadPoolConfig_descriptor, + new java.lang.String[] { + "NodeCount", + }); + internal_static_google_cloud_alloydb_v1_Instance_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1_Instance_descriptor.getNestedTypes().get(4); + internal_static_google_cloud_alloydb_v1_Instance_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Instance_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1_Instance_DatabaseFlagsEntry_descriptor = + internal_static_google_cloud_alloydb_v1_Instance_descriptor.getNestedTypes().get(5); + internal_static_google_cloud_alloydb_v1_Instance_DatabaseFlagsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Instance_DatabaseFlagsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1_Instance_AnnotationsEntry_descriptor = + internal_static_google_cloud_alloydb_v1_Instance_descriptor.getNestedTypes().get(6); + internal_static_google_cloud_alloydb_v1_Instance_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Instance_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1_Backup_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_alloydb_v1_Backup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Backup_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Uid", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Labels", + "State", + "Type", + "Description", + "ClusterUid", + "ClusterName", + "Reconciling", + "EncryptionConfig", + "EncryptionInfo", + "Etag", + "Annotations", + "SizeBytes", + "ExpiryTime", + }); + internal_static_google_cloud_alloydb_v1_Backup_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1_Backup_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_alloydb_v1_Backup_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Backup_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1_Backup_AnnotationsEntry_descriptor = + internal_static_google_cloud_alloydb_v1_Backup_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_alloydb_v1_Backup_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_Backup_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_descriptor, + new java.lang.String[] { + "StringRestrictions", + "IntegerRestrictions", + "Name", + "FlagName", + "ValueType", + "AcceptsMultipleValues", + "SupportedDbVersions", + "RequiresDbRestart", + "Restrictions", + }); + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_StringRestrictions_descriptor = + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_StringRestrictions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_StringRestrictions_descriptor, + new java.lang.String[] { + "AllowedValues", + }); + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_IntegerRestrictions_descriptor = + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_IntegerRestrictions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_IntegerRestrictions_descriptor, + new java.lang.String[] { + "MinValue", "MaxValue", + }); + 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.resourceDefinition); + 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.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + com.google.type.DayOfWeekProto.getDescriptor(); + com.google.type.TimeOfDayProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestartInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestartInstanceRequest.java new file mode 100644 index 000000000000..225208311e60 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestartInstanceRequest.java @@ -0,0 +1,983 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** Protobuf type {@code google.cloud.alloydb.v1.RestartInstanceRequest} */ +public final class RestartInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.RestartInstanceRequest) + RestartInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RestartInstanceRequest.newBuilder() to construct. + private RestartInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestartInstanceRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestartInstanceRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_RestartInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_RestartInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.RestartInstanceRequest.class, + com.google.cloud.alloydb.v1.RestartInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the restart.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + 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.alloydb.v1.RestartInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.RestartInstanceRequest other = + (com.google.cloud.alloydb.v1.RestartInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.RestartInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.RestartInstanceRequest 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.alloydb.v1.RestartInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.RestartInstanceRequest 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.alloydb.v1.RestartInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.RestartInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.RestartInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.RestartInstanceRequest 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.alloydb.v1.RestartInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.RestartInstanceRequest 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.alloydb.v1.RestartInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.RestartInstanceRequest 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.alloydb.v1.RestartInstanceRequest 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.alloydb.v1.RestartInstanceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.RestartInstanceRequest) + com.google.cloud.alloydb.v1.RestartInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_RestartInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_RestartInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.RestartInstanceRequest.class, + com.google.cloud.alloydb.v1.RestartInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.RestartInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_RestartInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.RestartInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.RestartInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.RestartInstanceRequest build() { + com.google.cloud.alloydb.v1.RestartInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.RestartInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1.RestartInstanceRequest result = + new com.google.cloud.alloydb.v1.RestartInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.RestartInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1.RestartInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.RestartInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.RestartInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1.RestartInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + 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 java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the restart.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the restart.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the restart.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = 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.alloydb.v1.RestartInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.RestartInstanceRequest) + private static final com.google.cloud.alloydb.v1.RestartInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.RestartInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1.RestartInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestartInstanceRequest 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.alloydb.v1.RestartInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestartInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestartInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..f10fe531dbcc --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestartInstanceRequestOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface RestartInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.RestartInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the restart.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestoreClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestoreClusterRequest.java new file mode 100644 index 000000000000..85f30dd733c7 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestoreClusterRequest.java @@ -0,0 +1,1832 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for restoring a Cluster from a backup or another cluster at a given
+ * point in time.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.RestoreClusterRequest} + */ +public final class RestoreClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.RestoreClusterRequest) + RestoreClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RestoreClusterRequest.newBuilder() to construct. + private RestoreClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestoreClusterRequest() { + parent_ = ""; + clusterId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestoreClusterRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_RestoreClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_RestoreClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.RestoreClusterRequest.class, + com.google.cloud.alloydb.v1.RestoreClusterRequest.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BACKUP_SOURCE(4), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 4: + return BACKUP_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int BACKUP_SOURCE_FIELD_NUMBER = 4; + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1.BackupSource backup_source = 4; + * + * @return Whether the backupSource field is set. + */ + @java.lang.Override + public boolean hasBackupSource() { + return sourceCase_ == 4; + } + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1.BackupSource backup_source = 4; + * + * @return The backupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BackupSource getBackupSource() { + if (sourceCase_ == 4) { + return (com.google.cloud.alloydb.v1.BackupSource) source_; + } + return com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance(); + } + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1.BackupSource backup_source = 4; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BackupSourceOrBuilder getBackupSourceOrBuilder() { + if (sourceCase_ == 4) { + return (com.google.cloud.alloydb.v1.BackupSource) source_; + } + return com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance(); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 CLUSTER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + @java.lang.Override + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + 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(); + clusterId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1.Cluster cluster_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + @java.lang.Override + public boolean hasCluster() { + return cluster_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster getCluster() { + return cluster_ == null ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() : cluster_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 6; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the import
+   * request.
+   * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clusterId_); + } + if (cluster_ != null) { + output.writeMessage(3, getCluster()); + } + if (sourceCase_ == 4) { + output.writeMessage(4, (com.google.cloud.alloydb.v1.BackupSource) source_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(6, validateOnly_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clusterId_); + } + if (cluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCluster()); + } + if (sourceCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.alloydb.v1.BackupSource) source_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, validateOnly_); + } + 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.alloydb.v1.RestoreClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.RestoreClusterRequest other = + (com.google.cloud.alloydb.v1.RestoreClusterRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getClusterId().equals(other.getClusterId())) return false; + if (hasCluster() != other.hasCluster()) return false; + if (hasCluster()) { + if (!getCluster().equals(other.getCluster())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 4: + if (!getBackupSource().equals(other.getBackupSource())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getClusterId().hashCode(); + if (hasCluster()) { + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + switch (sourceCase_) { + case 4: + hash = (37 * hash) + BACKUP_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getBackupSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.RestoreClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.RestoreClusterRequest 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.alloydb.v1.RestoreClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.RestoreClusterRequest 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.alloydb.v1.RestoreClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.RestoreClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.RestoreClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.RestoreClusterRequest 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.alloydb.v1.RestoreClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.RestoreClusterRequest 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.alloydb.v1.RestoreClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.RestoreClusterRequest 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.alloydb.v1.RestoreClusterRequest 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; + } + /** + * + * + *
+   * Message for restoring a Cluster from a backup or another cluster at a given
+   * point in time.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.RestoreClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.RestoreClusterRequest) + com.google.cloud.alloydb.v1.RestoreClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_RestoreClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_RestoreClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.RestoreClusterRequest.class, + com.google.cloud.alloydb.v1.RestoreClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.RestoreClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (backupSourceBuilder_ != null) { + backupSourceBuilder_.clear(); + } + parent_ = ""; + clusterId_ = ""; + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_RestoreClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.RestoreClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.RestoreClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.RestoreClusterRequest build() { + com.google.cloud.alloydb.v1.RestoreClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.RestoreClusterRequest buildPartial() { + com.google.cloud.alloydb.v1.RestoreClusterRequest result = + new com.google.cloud.alloydb.v1.RestoreClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.RestoreClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.clusterId_ = clusterId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + private void buildPartialOneofs(com.google.cloud.alloydb.v1.RestoreClusterRequest result) { + result.sourceCase_ = sourceCase_; + result.source_ = this.source_; + if (sourceCase_ == 4 && backupSourceBuilder_ != null) { + result.source_ = backupSourceBuilder_.build(); + } + } + + @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.alloydb.v1.RestoreClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.RestoreClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.RestoreClusterRequest other) { + if (other == com.google.cloud.alloydb.v1.RestoreClusterRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getClusterId().isEmpty()) { + clusterId_ = other.clusterId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCluster()) { + mergeCluster(other.getCluster()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + switch (other.getSourceCase()) { + case BACKUP_SOURCE: + { + mergeBackupSource(other.getBackupSource()); + break; + } + case SOURCE_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: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + clusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 26: + { + input.readMessage(getClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + input.readMessage(getBackupSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 4; + break; + } // case 34 + case 42: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + 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 sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.BackupSource, + com.google.cloud.alloydb.v1.BackupSource.Builder, + com.google.cloud.alloydb.v1.BackupSourceOrBuilder> + backupSourceBuilder_; + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1.BackupSource backup_source = 4; + * + * @return Whether the backupSource field is set. + */ + @java.lang.Override + public boolean hasBackupSource() { + return sourceCase_ == 4; + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1.BackupSource backup_source = 4; + * + * @return The backupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BackupSource getBackupSource() { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 4) { + return (com.google.cloud.alloydb.v1.BackupSource) source_; + } + return com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance(); + } else { + if (sourceCase_ == 4) { + return backupSourceBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1.BackupSource backup_source = 4; + */ + public Builder setBackupSource(com.google.cloud.alloydb.v1.BackupSource value) { + if (backupSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + backupSourceBuilder_.setMessage(value); + } + sourceCase_ = 4; + return this; + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1.BackupSource backup_source = 4; + */ + public Builder setBackupSource( + com.google.cloud.alloydb.v1.BackupSource.Builder builderForValue) { + if (backupSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + backupSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 4; + return this; + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1.BackupSource backup_source = 4; + */ + public Builder mergeBackupSource(com.google.cloud.alloydb.v1.BackupSource value) { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 4 + && source_ != com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance()) { + source_ = + com.google.cloud.alloydb.v1.BackupSource.newBuilder( + (com.google.cloud.alloydb.v1.BackupSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 4) { + backupSourceBuilder_.mergeFrom(value); + } else { + backupSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 4; + return this; + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1.BackupSource backup_source = 4; + */ + public Builder clearBackupSource() { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 4) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 4) { + sourceCase_ = 0; + source_ = null; + } + backupSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1.BackupSource backup_source = 4; + */ + public com.google.cloud.alloydb.v1.BackupSource.Builder getBackupSourceBuilder() { + return getBackupSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1.BackupSource backup_source = 4; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BackupSourceOrBuilder getBackupSourceOrBuilder() { + if ((sourceCase_ == 4) && (backupSourceBuilder_ != null)) { + return backupSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 4) { + return (com.google.cloud.alloydb.v1.BackupSource) source_; + } + return com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1.BackupSource backup_source = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.BackupSource, + com.google.cloud.alloydb.v1.BackupSource.Builder, + com.google.cloud.alloydb.v1.BackupSourceOrBuilder> + getBackupSourceFieldBuilder() { + if (backupSourceBuilder_ == null) { + if (!(sourceCase_ == 4)) { + source_ = com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance(); + } + backupSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.BackupSource, + com.google.cloud.alloydb.v1.BackupSource.Builder, + com.google.cloud.alloydb.v1.BackupSourceOrBuilder>( + (com.google.cloud.alloydb.v1.BackupSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 4; + onChanged(); + return backupSourceBuilder_; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object clusterId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearClusterId() { + clusterId_ = getDefaultInstance().getClusterId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster, + com.google.cloud.alloydb.v1.Cluster.Builder, + com.google.cloud.alloydb.v1.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.alloydb.v1.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.alloydb.v1.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.alloydb.v1.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCluster() { + bitField0_ = (bitField0_ & ~0x00000008); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster, + com.google.cloud.alloydb.v1.Cluster.Builder, + com.google.cloud.alloydb.v1.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster, + com.google.cloud.alloydb.v1.Cluster.Builder, + com.google.cloud.alloydb.v1.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the import
+     * request.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the import
+     * request.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the import
+     * request.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000020); + validateOnly_ = 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.alloydb.v1.RestoreClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.RestoreClusterRequest) + private static final com.google.cloud.alloydb.v1.RestoreClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.RestoreClusterRequest(); + } + + public static com.google.cloud.alloydb.v1.RestoreClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestoreClusterRequest 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.alloydb.v1.RestoreClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestoreClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestoreClusterRequestOrBuilder.java new file mode 100644 index 000000000000..600a66af8684 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestoreClusterRequestOrBuilder.java @@ -0,0 +1,216 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface RestoreClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.RestoreClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1.BackupSource backup_source = 4; + * + * @return Whether the backupSource field is set. + */ + boolean hasBackupSource(); + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1.BackupSource backup_source = 4; + * + * @return The backupSource. + */ + com.google.cloud.alloydb.v1.BackupSource getBackupSource(); + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1.BackupSource backup_source = 4; + */ + com.google.cloud.alloydb.v1.BackupSourceOrBuilder getBackupSourceOrBuilder(); + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.alloydb.v1.Cluster getCluster(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the import
+   * request.
+   * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + public com.google.cloud.alloydb.v1.RestoreClusterRequest.SourceCase getSourceCase(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ServiceProto.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ServiceProto.java new file mode 100644 index 000000000000..b2ebbf4cc094 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ServiceProto.java @@ -0,0 +1,702 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public final class ServiceProto { + private ServiceProto() {} + + 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_alloydb_v1_ListClustersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_ListClustersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_ListClustersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_ListClustersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_GetClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_GetClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_CreateClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_CreateClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_UpdateClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_UpdateClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_DeleteClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_DeleteClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_RestoreClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_RestoreClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_ListInstancesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_ListInstancesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_ListInstancesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_ListInstancesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_GetInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_GetInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_CreateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_CreateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_CreateInstanceRequests_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_CreateInstanceRequests_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_InstanceStatusesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_InstanceStatusesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_BatchCreateInstanceStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_BatchCreateInstanceStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_UpdateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_UpdateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_DeleteInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_DeleteInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_FailoverInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_FailoverInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_RestartInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_RestartInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_ListBackupsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_ListBackupsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_ListBackupsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_ListBackupsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_GetBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_GetBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_CreateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_CreateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_UpdateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_UpdateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_DeleteBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_DeleteBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_OperationMetadata_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/alloydb/v1/service.proto\022" + + "\027google.cloud.alloydb.v1\032\034google/api/ann" + + "otations.proto\032\027google/api/client.proto\032" + + "\037google/api/field_behavior.proto\032\031google" + + "/api/resource.proto\032\'google/cloud/alloyd" + + "b/v1/resources.proto\032#google/longrunning" + + "/operations.proto\032\033google/protobuf/empty" + + ".proto\032 google/protobuf/field_mask.proto" + + "\032\037google/protobuf/timestamp.proto\032\027googl" + + "e/rpc/status.proto\"\245\001\n\023ListClustersReque" + + "st\0226\n\006parent\030\001 \001(\tB&\340A\002\372A \022\036alloydb.goog" + + "leapis.com/Cluster\022\026\n\tpage_size\030\002 \001(\005B\003\340" + + "A\001\022\022\n\npage_token\030\003 \001(\t\022\023\n\006filter\030\004 \001(\tB\003" + + "\340A\001\022\025\n\010order_by\030\005 \001(\tB\003\340A\001\"x\n\024ListCluste" + + "rsResponse\0222\n\010clusters\030\001 \003(\0132 .google.cl" + + "oud.alloydb.v1.Cluster\022\027\n\017next_page_toke" + + "n\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"I\n\021GetClust" + + "erRequest\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n\036alloydb" + + ".googleapis.com/Cluster\"\324\001\n\024CreateCluste" + + "rRequest\0226\n\006parent\030\001 \001(\tB&\340A\002\372A \022\036alloyd" + + "b.googleapis.com/Cluster\022\027\n\ncluster_id\030\002" + + " \001(\tB\003\340A\002\0226\n\007cluster\030\003 \001(\0132 .google.clou" + + "d.alloydb.v1.ClusterB\003\340A\002\022\027\n\nrequest_id\030" + + "\004 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\005 \001(\010B\003\340A\001\"\325" + + "\001\n\024UpdateClusterRequest\0224\n\013update_mask\030\001" + + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\0226\n" + + "\007cluster\030\002 \001(\0132 .google.cloud.alloydb.v1" + + ".ClusterB\003\340A\002\022\027\n\nrequest_id\030\003 \001(\tB\003\340A\001\022\032" + + "\n\rvalidate_only\030\004 \001(\010B\003\340A\001\022\032\n\rallow_miss" + + "ing\030\005 \001(\010B\003\340A\001\"\250\001\n\024DeleteClusterRequest\022" + + "4\n\004name\030\001 \001(\tB&\340A\002\372A \n\036alloydb.googleapi" + + "s.com/Cluster\022\027\n\nrequest_id\030\002 \001(\tB\003\340A\001\022\021" + + "\n\004etag\030\003 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\004 \001(\010" + + "B\003\340A\001\022\022\n\005force\030\005 \001(\010B\003\340A\001\"\237\002\n\025RestoreClu" + + "sterRequest\022>\n\rbackup_source\030\004 \001(\0132%.goo" + + "gle.cloud.alloydb.v1.BackupSourceH\000\0226\n\006p" + + "arent\030\001 \001(\tB&\340A\002\372A \022\036alloydb.googleapis." + + "com/Cluster\022\027\n\ncluster_id\030\002 \001(\tB\003\340A\002\0226\n\007" + + "cluster\030\003 \001(\0132 .google.cloud.alloydb.v1." + + "ClusterB\003\340A\002\022\027\n\nrequest_id\030\005 \001(\tB\003\340A\001\022\032\n" + + "\rvalidate_only\030\006 \001(\010B\003\340A\001B\010\n\006source\"\247\001\n\024" + + "ListInstancesRequest\0227\n\006parent\030\001 \001(\tB\'\340A" + + "\002\372A!\022\037alloydb.googleapis.com/Instance\022\026\n" + + "\tpage_size\030\002 \001(\005B\003\340A\001\022\022\n\npage_token\030\003 \001(" + + "\t\022\023\n\006filter\030\004 \001(\tB\003\340A\001\022\025\n\010order_by\030\005 \001(\t" + + "B\003\340A\001\"{\n\025ListInstancesResponse\0224\n\tinstan" + + "ces\030\001 \003(\0132!.google.cloud.alloydb.v1.Inst" + + "ance\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreach" + + "able\030\003 \003(\t\"\200\001\n\022GetInstanceRequest\0225\n\004nam" + + "e\030\001 \001(\tB\'\340A\002\372A!\n\037alloydb.googleapis.com/" + + "Instance\0223\n\004view\030\002 \001(\0162%.google.cloud.al" + + "loydb.v1.InstanceView\"\331\001\n\025CreateInstance" + + "Request\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037alloydb" + + ".googleapis.com/Instance\022\030\n\013instance_id\030" + + "\002 \001(\tB\003\340A\002\0228\n\010instance\030\003 \001(\0132!.google.cl" + + "oud.alloydb.v1.InstanceB\003\340A\002\022\027\n\nrequest_" + + "id\030\004 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\005 \001(\010B\003\340A" + + "\001\"o\n\026CreateInstanceRequests\022U\n\030create_in" + + "stance_requests\030\001 \003(\0132..google.cloud.all" + + "oydb.v1.CreateInstanceRequestB\003\340A\002\"\267\001\n\033B" + + "atchCreateInstancesRequest\0227\n\006parent\030\001 \001" + + "(\tB\'\340A\002\372A!\022\037alloydb.googleapis.com/Insta" + + "nce\022F\n\010requests\030\002 \001(\0132/.google.cloud.all" + + "oydb.v1.CreateInstanceRequestsB\003\340A\002\022\027\n\nr" + + "equest_id\030\003 \001(\tB\003\340A\001\"T\n\034BatchCreateInsta" + + "ncesResponse\0224\n\tinstances\030\001 \003(\0132!.google" + + ".cloud.alloydb.v1.Instance\"\215\002\n\034BatchCrea" + + "teInstancesMetadata\022\030\n\020instance_targets\030" + + "\001 \003(\t\022f\n\021instance_statuses\030\002 \003(\0132K.googl" + + "e.cloud.alloydb.v1.BatchCreateInstancesM" + + "etadata.InstanceStatusesEntry\032k\n\025Instanc" + + "eStatusesEntry\022\013\n\003key\030\001 \001(\t\022A\n\005value\030\002 \001" + + "(\01322.google.cloud.alloydb.v1.BatchCreate" + + "InstanceStatus:\0028\001\"\320\002\n\031BatchCreateInstan" + + "ceStatus\022G\n\005state\030\001 \001(\01628.google.cloud.a" + + "lloydb.v1.BatchCreateInstanceStatus.Stat" + + "e\022\021\n\terror_msg\030\002 \001(\t\022!\n\005error\030\004 \001(\0132\022.go" + + "ogle.rpc.Status\022<\n\004type\030\003 \001(\0162..google.c" + + "loud.alloydb.v1.Instance.InstanceType\"v\n" + + "\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\022\n\016PENDING" + + "_CREATE\020\001\022\t\n\005READY\020\002\022\014\n\010CREATING\020\003\022\014\n\010DE" + + "LETING\020\004\022\n\n\006FAILED\020\005\022\017\n\013ROLLED_BACK\020\006\"\330\001" + + "\n\025UpdateInstanceRequest\0224\n\013update_mask\030\001" + + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\0228\n" + + "\010instance\030\002 \001(\0132!.google.cloud.alloydb.v" + + "1.InstanceB\003\340A\002\022\027\n\nrequest_id\030\003 \001(\tB\003\340A\001" + + "\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\001\022\032\n\rallow_mi" + + "ssing\030\005 \001(\010B\003\340A\001\"\226\001\n\025DeleteInstanceReque" + + "st\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037alloydb.google" + + "apis.com/Instance\022\027\n\nrequest_id\030\002 \001(\tB\003\340" + + "A\001\022\021\n\004etag\030\003 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\004" + + " \001(\010B\003\340A\001\"\205\001\n\027FailoverInstanceRequest\0225\n" + + "\004name\030\001 \001(\tB\'\340A\002\372A!\n\037alloydb.googleapis." + + "com/Instance\022\027\n\nrequest_id\030\002 \001(\tB\003\340A\001\022\032\n" + + "\rvalidate_only\030\003 \001(\010B\003\340A\001\"\204\001\n\026RestartIns" + + "tanceRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037allo" + + "ydb.googleapis.com/Instance\022\027\n\nrequest_i" + + "d\030\002 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\003 \001(\010B\003\340A\001" + + "\"\224\001\n\022ListBackupsRequest\0225\n\006parent\030\001 \001(\tB" + + "%\340A\002\372A\037\022\035alloydb.googleapis.com/Backup\022\021" + + "\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n" + + "\006filter\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"u\n\023ListB" + + "ackupsResponse\0220\n\007backups\030\001 \003(\0132\037.google" + + ".cloud.alloydb.v1.Backup\022\027\n\017next_page_to" + + "ken\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"G\n\020GetBac" + + "kupRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035alloyd" + + "b.googleapis.com/Backup\"\317\001\n\023CreateBackup" + + "Request\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\022\035alloydb" + + ".googleapis.com/Backup\022\026\n\tbackup_id\030\002 \001(" + + "\tB\003\340A\002\0224\n\006backup\030\003 \001(\0132\037.google.cloud.al" + + "loydb.v1.BackupB\003\340A\002\022\027\n\nrequest_id\030\004 \001(\t" + + "B\003\340A\001\022\032\n\rvalidate_only\030\005 \001(\010B\003\340A\001\"\322\001\n\023Up" + + "dateBackupRequest\0224\n\013update_mask\030\001 \001(\0132\032" + + ".google.protobuf.FieldMaskB\003\340A\001\0224\n\006backu" + + "p\030\002 \001(\0132\037.google.cloud.alloydb.v1.Backup" + + "B\003\340A\002\022\027\n\nrequest_id\030\003 \001(\tB\003\340A\001\022\032\n\rvalida" + + "te_only\030\004 \001(\010B\003\340A\001\022\032\n\rallow_missing\030\005 \001(" + + "\010B\003\340A\001\"\222\001\n\023DeleteBackupRequest\0223\n\004name\030\001" + + " \001(\tB%\340A\002\372A\037\n\035alloydb.googleapis.com/Bac" + + "kup\022\027\n\nrequest_id\030\002 \001(\tB\003\340A\001\022\032\n\rvalidate" + + "_only\030\003 \001(\010B\003\340A\001\022\021\n\004etag\030\004 \001(\tB\003\340A\001\"\220\001\n!" + + "ListSupportedDatabaseFlagsRequest\022D\n\006par" + + "ent\030\001 \001(\tB4\340A\002\372A.\022,alloydb.googleapis.co" + + "m/SupportedDatabaseFlag\022\021\n\tpage_size\030\002 \001" + + "(\005\022\022\n\npage_token\030\003 \001(\t\"\217\001\n\"ListSupported" + + "DatabaseFlagsResponse\022P\n\030supported_datab" + + "ase_flags\030\001 \003(\0132..google.cloud.alloydb.v" + + "1.SupportedDatabaseFlag\022\027\n\017next_page_tok" + + "en\030\002 \001(\t\"\373\002\n\021OperationMetadata\022e\n\037batch_" + + "create_instances_metadata\030\010 \001(\01325.google" + + ".cloud.alloydb.v1.BatchCreateInstancesMe" + + "tadataB\003\340A\003H\000\0224\n\013create_time\030\001 \001(\0132\032.goo" + + "gle.protobuf.TimestampB\003\340A\003\0221\n\010end_time\030" + + "\002 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\023" + + "\n\006target\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\033" + + "\n\016status_message\030\005 \001(\tB\003\340A\003\022#\n\026requested" + + "_cancellation\030\006 \001(\010B\003\340A\003\022\030\n\013api_version\030" + + "\007 \001(\tB\003\340A\003B\022\n\020request_specific2\275 \n\014Alloy" + + "DBAdmin\022\252\001\n\014ListClusters\022,.google.cloud." + + "alloydb.v1.ListClustersRequest\032-.google." + + "cloud.alloydb.v1.ListClustersResponse\"=\202" + + "\323\344\223\002.\022,/v1/{parent=projects/*/locations/" + + "*}/clusters\332A\006parent\022\227\001\n\nGetCluster\022*.go" + + "ogle.cloud.alloydb.v1.GetClusterRequest\032" + + " .google.cloud.alloydb.v1.Cluster\";\202\323\344\223\002" + + ".\022,/v1/{name=projects/*/locations/*/clus" + + "ters/*}\332A\004name\022\327\001\n\rCreateCluster\022-.googl" + + "e.cloud.alloydb.v1.CreateClusterRequest\032" + + "\035.google.longrunning.Operation\"x\202\323\344\223\0027\"," + + "/v1/{parent=projects/*/locations/*}/clus" + + "ters:\007cluster\332A\031parent,cluster,cluster_i" + + "d\312A\034\n\007Cluster\022\021OperationMetadata\022\331\001\n\rUpd" + + "ateCluster\022-.google.cloud.alloydb.v1.Upd" + + "ateClusterRequest\032\035.google.longrunning.O" + + "peration\"z\202\323\344\223\002?24/v1/{cluster.name=proj" + + "ects/*/locations/*/clusters/*}:\007cluster\332" + + "A\023cluster,update_mask\312A\034\n\007Cluster\022\021Opera" + + "tionMetadata\022\307\001\n\rDeleteCluster\022-.google." + + "cloud.alloydb.v1.DeleteClusterRequest\032\035." + + "google.longrunning.Operation\"h\202\323\344\223\002.*,/v" + + "1/{name=projects/*/locations/*/clusters/" + + "*}\332A\004name\312A*\n\025google.protobuf.Empty\022\021Ope" + + "rationMetadata\022\277\001\n\016RestoreCluster\022..goog" + + "le.cloud.alloydb.v1.RestoreClusterReques" + + "t\032\035.google.longrunning.Operation\"^\202\323\344\223\0029" + + "\"4/v1/{parent=projects/*/locations/*}/cl" + + "usters:restore:\001*\312A\034\n\007Cluster\022\021Operation" + + "Metadata\022\271\001\n\rListInstances\022-.google.clou" + + "d.alloydb.v1.ListInstancesRequest\032..goog" + + "le.cloud.alloydb.v1.ListInstancesRespons" + + "e\"I\202\323\344\223\002:\0228/v1/{parent=projects/*/locati" + + "ons/*/clusters/*}/instances\332A\006parent\022\246\001\n" + + "\013GetInstance\022+.google.cloud.alloydb.v1.G" + + "etInstanceRequest\032!.google.cloud.alloydb" + + ".v1.Instance\"G\202\323\344\223\002:\0228/v1/{name=projects" + + "/*/locations/*/clusters/*/instances/*}\332A" + + "\004name\022\352\001\n\016CreateInstance\022..google.cloud." + + "alloydb.v1.CreateInstanceRequest\032\035.googl" + + "e.longrunning.Operation\"\210\001\202\323\344\223\002D\"8/v1/{p" + + "arent=projects/*/locations/*/clusters/*}" + + "/instances:\010instance\332A\033parent,instance,i" + + "nstance_id\312A\035\n\010Instance\022\021OperationMetada" + + "ta\022\370\001\n\024BatchCreateInstances\0224.google.clo" + + "ud.alloydb.v1.BatchCreateInstancesReques" + + "t\032\035.google.longrunning.Operation\"\212\001\202\323\344\223\002" + + "P\"D/v1/{parent=projects/*/locations/*/cl" + + "usters/*}/instances:batchCreate:\010request" + + "s\312A1\n\034BatchCreateInstancesResponse\022\021Oper" + + "ationMetadata\022\354\001\n\016UpdateInstance\022..googl" + + "e.cloud.alloydb.v1.UpdateInstanceRequest" + + "\032\035.google.longrunning.Operation\"\212\001\202\323\344\223\002M" + + "2A/v1/{instance.name=projects/*/location" + + "s/*/clusters/*/instances/*}:\010instance\332A\024" + + "instance,update_mask\312A\035\n\010Instance\022\021Opera" + + "tionMetadata\022\325\001\n\016DeleteInstance\022..google" + + ".cloud.alloydb.v1.DeleteInstanceRequest\032" + + "\035.google.longrunning.Operation\"t\202\323\344\223\002:*8" + + "/v1/{name=projects/*/locations/*/cluster" + + "s/*/instances/*}\332A\004name\312A*\n\025google.proto" + + "buf.Empty\022\021OperationMetadata\022\330\001\n\020Failove" + + "rInstance\0220.google.cloud.alloydb.v1.Fail" + + "overInstanceRequest\032\035.google.longrunning" + + ".Operation\"s\202\323\344\223\002F\"A/v1/{name=projects/*" + + "/locations/*/clusters/*/instances/*}:fai" + + "lover:\001*\332A\004name\312A\035\n\010Instance\022\021OperationM" + + "etadata\022\325\001\n\017RestartInstance\022/.google.clo" + + "ud.alloydb.v1.RestartInstanceRequest\032\035.g" + + "oogle.longrunning.Operation\"r\202\323\344\223\002E\"@/v1" + + "/{name=projects/*/locations/*/clusters/*" + + "/instances/*}:restart:\001*\332A\004name\312A\035\n\010Inst" + + "ance\022\021OperationMetadata\022\246\001\n\013ListBackups\022" + + "+.google.cloud.alloydb.v1.ListBackupsReq" + + "uest\032,.google.cloud.alloydb.v1.ListBacku" + + "psResponse\"<\202\323\344\223\002-\022+/v1/{parent=projects" + + "/*/locations/*}/backups\332A\006parent\022\223\001\n\tGet" + + "Backup\022).google.cloud.alloydb.v1.GetBack" + + "upRequest\032\037.google.cloud.alloydb.v1.Back" + + "up\":\202\323\344\223\002-\022+/v1/{name=projects/*/locatio" + + "ns/*/backups/*}\332A\004name\022\320\001\n\014CreateBackup\022" + + ",.google.cloud.alloydb.v1.CreateBackupRe" + + "quest\032\035.google.longrunning.Operation\"s\202\323" + + "\344\223\0025\"+/v1/{parent=projects/*/locations/*" + + "}/backups:\006backup\332A\027parent,backup,backup" + + "_id\312A\033\n\006Backup\022\021OperationMetadata\022\322\001\n\014Up" + + "dateBackup\022,.google.cloud.alloydb.v1.Upd" + + "ateBackupRequest\032\035.google.longrunning.Op" + + "eration\"u\202\323\344\223\002<22/v1/{backup.name=projec" + + "ts/*/locations/*/backups/*}:\006backup\332A\022ba" + + "ckup,update_mask\312A\033\n\006Backup\022\021OperationMe" + + "tadata\022\304\001\n\014DeleteBackup\022,.google.cloud.a" + + "lloydb.v1.DeleteBackupRequest\032\035.google.l" + + "ongrunning.Operation\"g\202\323\344\223\002-*+/v1/{name=" + + "projects/*/locations/*/backups/*}\332A\004name" + + "\312A*\n\025google.protobuf.Empty\022\021OperationMet" + + "adata\022\342\001\n\032ListSupportedDatabaseFlags\022:.g" + + "oogle.cloud.alloydb.v1.ListSupportedData" + + "baseFlagsRequest\032;.google.cloud.alloydb." + + "v1.ListSupportedDatabaseFlagsResponse\"K\202" + + "\323\344\223\002<\022:/v1/{parent=projects/*/locations/" + + "*}/supportedDatabaseFlags\332A\006parent\032J\312A\026a" + + "lloydb.googleapis.com\322A.https://www.goog" + + "leapis.com/auth/cloud-platformB\265\001\n\033com.g" + + "oogle.cloud.alloydb.v1B\014ServiceProtoP\001Z5" + + "cloud.google.com/go/alloydb/apiv1/alloyd" + + "bpb;alloydbpb\252\002\027Google.Cloud.AlloyDb.V1\312" + + "\002\027Google\\Cloud\\AlloyDb\\V1\352\002\032Google::Clou" + + "d::AlloyDb::V1b\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.alloydb.v1.ResourcesProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_cloud_alloydb_v1_ListClustersRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_alloydb_v1_ListClustersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_ListClustersRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_alloydb_v1_ListClustersResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_alloydb_v1_ListClustersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_ListClustersResponse_descriptor, + new java.lang.String[] { + "Clusters", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_alloydb_v1_GetClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_alloydb_v1_GetClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_GetClusterRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_alloydb_v1_CreateClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_alloydb_v1_CreateClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_CreateClusterRequest_descriptor, + new java.lang.String[] { + "Parent", "ClusterId", "Cluster", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1_UpdateClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_alloydb_v1_UpdateClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_UpdateClusterRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Cluster", "RequestId", "ValidateOnly", "AllowMissing", + }); + internal_static_google_cloud_alloydb_v1_DeleteClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_alloydb_v1_DeleteClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_DeleteClusterRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "Etag", "ValidateOnly", "Force", + }); + internal_static_google_cloud_alloydb_v1_RestoreClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_alloydb_v1_RestoreClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_RestoreClusterRequest_descriptor, + new java.lang.String[] { + "BackupSource", + "Parent", + "ClusterId", + "Cluster", + "RequestId", + "ValidateOnly", + "Source", + }); + internal_static_google_cloud_alloydb_v1_ListInstancesRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_alloydb_v1_ListInstancesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_ListInstancesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_alloydb_v1_ListInstancesResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_alloydb_v1_ListInstancesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_ListInstancesResponse_descriptor, + new java.lang.String[] { + "Instances", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_alloydb_v1_GetInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_alloydb_v1_GetInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_GetInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "View", + }); + internal_static_google_cloud_alloydb_v1_CreateInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_alloydb_v1_CreateInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_CreateInstanceRequest_descriptor, + new java.lang.String[] { + "Parent", "InstanceId", "Instance", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1_CreateInstanceRequests_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_alloydb_v1_CreateInstanceRequests_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_CreateInstanceRequests_descriptor, + new java.lang.String[] { + "CreateInstanceRequests", + }); + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesRequest_descriptor, + new java.lang.String[] { + "Parent", "Requests", "RequestId", + }); + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesResponse_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesResponse_descriptor, + new java.lang.String[] { + "Instances", + }); + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_descriptor, + new java.lang.String[] { + "InstanceTargets", "InstanceStatuses", + }); + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_InstanceStatusesEntry_descriptor = + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_InstanceStatusesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_BatchCreateInstancesMetadata_InstanceStatusesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1_BatchCreateInstanceStatus_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_alloydb_v1_BatchCreateInstanceStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_BatchCreateInstanceStatus_descriptor, + new java.lang.String[] { + "State", "ErrorMsg", "Error", "Type", + }); + internal_static_google_cloud_alloydb_v1_UpdateInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_alloydb_v1_UpdateInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_UpdateInstanceRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Instance", "RequestId", "ValidateOnly", "AllowMissing", + }); + internal_static_google_cloud_alloydb_v1_DeleteInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_alloydb_v1_DeleteInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_DeleteInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "Etag", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1_FailoverInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_alloydb_v1_FailoverInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_FailoverInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1_RestartInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_alloydb_v1_RestartInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_RestartInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1_ListBackupsRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_alloydb_v1_ListBackupsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_ListBackupsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_alloydb_v1_ListBackupsResponse_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_alloydb_v1_ListBackupsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_ListBackupsResponse_descriptor, + new java.lang.String[] { + "Backups", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_alloydb_v1_GetBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_alloydb_v1_GetBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_GetBackupRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_alloydb_v1_CreateBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_alloydb_v1_CreateBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_CreateBackupRequest_descriptor, + new java.lang.String[] { + "Parent", "BackupId", "Backup", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1_UpdateBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_alloydb_v1_UpdateBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_UpdateBackupRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Backup", "RequestId", "ValidateOnly", "AllowMissing", + }); + internal_static_google_cloud_alloydb_v1_DeleteBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_alloydb_v1_DeleteBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_DeleteBackupRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "ValidateOnly", "Etag", + }); + internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsRequest_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsResponse_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_ListSupportedDatabaseFlagsResponse_descriptor, + new java.lang.String[] { + "SupportedDatabaseFlags", "NextPageToken", + }); + internal_static_google_cloud_alloydb_v1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_google_cloud_alloydb_v1_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_OperationMetadata_descriptor, + new java.lang.String[] { + "BatchCreateInstancesMetadata", + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + "RequestSpecific", + }); + 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); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + 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.alloydb.v1.ResourcesProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/SslConfig.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/SslConfig.java new file mode 100644 index 000000000000..5723322bf03d --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/SslConfig.java @@ -0,0 +1,1103 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * SSL configuration for an AlloyDB Cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.SslConfig} + */ +public final class SslConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.SslConfig) + SslConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use SslConfig.newBuilder() to construct. + private SslConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SslConfig() { + sslMode_ = 0; + caSource_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SslConfig(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SslConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SslConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.SslConfig.class, + com.google.cloud.alloydb.v1.SslConfig.Builder.class); + } + + /** + * + * + *
+   * SSL mode options.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.SslConfig.SslMode} + */ + public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * SSL mode not specified. Defaults to SSL_MODE_ALLOW.
+     * 
+ * + * SSL_MODE_UNSPECIFIED = 0; + */ + SSL_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * SSL connections are optional. CA verification not enforced.
+     * 
+ * + * SSL_MODE_ALLOW = 1; + */ + SSL_MODE_ALLOW(1), + /** + * + * + *
+     * SSL connections are required. CA verification not enforced.
+     * Clients may use locally self-signed certificates (default psql client
+     * behavior).
+     * 
+ * + * SSL_MODE_REQUIRE = 2; + */ + SSL_MODE_REQUIRE(2), + /** + * + * + *
+     * SSL connections are required. CA verification enforced.
+     * Clients must have certificates signed by a Cluster CA, e.g. via
+     * GenerateClientCertificate.
+     * 
+ * + * SSL_MODE_VERIFY_CA = 3; + */ + SSL_MODE_VERIFY_CA(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * SSL mode not specified. Defaults to SSL_MODE_ALLOW.
+     * 
+ * + * SSL_MODE_UNSPECIFIED = 0; + */ + public static final int SSL_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * SSL connections are optional. CA verification not enforced.
+     * 
+ * + * SSL_MODE_ALLOW = 1; + */ + public static final int SSL_MODE_ALLOW_VALUE = 1; + /** + * + * + *
+     * SSL connections are required. CA verification not enforced.
+     * Clients may use locally self-signed certificates (default psql client
+     * behavior).
+     * 
+ * + * SSL_MODE_REQUIRE = 2; + */ + public static final int SSL_MODE_REQUIRE_VALUE = 2; + /** + * + * + *
+     * SSL connections are required. CA verification enforced.
+     * Clients must have certificates signed by a Cluster CA, e.g. via
+     * GenerateClientCertificate.
+     * 
+ * + * SSL_MODE_VERIFY_CA = 3; + */ + public static final int SSL_MODE_VERIFY_CA_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 SslMode 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 SslMode forNumber(int value) { + switch (value) { + case 0: + return SSL_MODE_UNSPECIFIED; + case 1: + return SSL_MODE_ALLOW; + case 2: + return SSL_MODE_REQUIRE; + case 3: + return SSL_MODE_VERIFY_CA; + 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 SslMode findValueByNumber(int number) { + return SslMode.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.alloydb.v1.SslConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final SslMode[] VALUES = values(); + + public static SslMode 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 SslMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1.SslConfig.SslMode) + } + + /** + * + * + *
+   * Certificate Authority (CA) source for SSL/TLS certificates.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.SslConfig.CaSource} + */ + public enum CaSource implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Certificate Authority (CA) source not specified. Defaults to
+     * CA_SOURCE_MANAGED.
+     * 
+ * + * CA_SOURCE_UNSPECIFIED = 0; + */ + CA_SOURCE_UNSPECIFIED(0), + /** + * + * + *
+     * Certificate Authority (CA) managed by the AlloyDB Cluster.
+     * 
+ * + * CA_SOURCE_MANAGED = 1; + */ + CA_SOURCE_MANAGED(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Certificate Authority (CA) source not specified. Defaults to
+     * CA_SOURCE_MANAGED.
+     * 
+ * + * CA_SOURCE_UNSPECIFIED = 0; + */ + public static final int CA_SOURCE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Certificate Authority (CA) managed by the AlloyDB Cluster.
+     * 
+ * + * CA_SOURCE_MANAGED = 1; + */ + public static final int CA_SOURCE_MANAGED_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 CaSource 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 CaSource forNumber(int value) { + switch (value) { + case 0: + return CA_SOURCE_UNSPECIFIED; + case 1: + return CA_SOURCE_MANAGED; + 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 CaSource findValueByNumber(int number) { + return CaSource.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.alloydb.v1.SslConfig.getDescriptor().getEnumTypes().get(1); + } + + private static final CaSource[] VALUES = values(); + + public static CaSource 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 CaSource(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1.SslConfig.CaSource) + } + + public static final int SSL_MODE_FIELD_NUMBER = 1; + private int sslMode_ = 0; + /** + * + * + *
+   * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for sslMode. + */ + @java.lang.Override + public int getSslModeValue() { + return sslMode_; + } + /** + * + * + *
+   * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sslMode. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SslConfig.SslMode getSslMode() { + com.google.cloud.alloydb.v1.SslConfig.SslMode result = + com.google.cloud.alloydb.v1.SslConfig.SslMode.forNumber(sslMode_); + return result == null ? com.google.cloud.alloydb.v1.SslConfig.SslMode.UNRECOGNIZED : result; + } + + public static final int CA_SOURCE_FIELD_NUMBER = 2; + private int caSource_ = 0; + /** + * + * + *
+   * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+   * supported currently, and is the default value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for caSource. + */ + @java.lang.Override + public int getCaSourceValue() { + return caSource_; + } + /** + * + * + *
+   * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+   * supported currently, and is the default value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The caSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SslConfig.CaSource getCaSource() { + com.google.cloud.alloydb.v1.SslConfig.CaSource result = + com.google.cloud.alloydb.v1.SslConfig.CaSource.forNumber(caSource_); + return result == null ? com.google.cloud.alloydb.v1.SslConfig.CaSource.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 (sslMode_ + != com.google.cloud.alloydb.v1.SslConfig.SslMode.SSL_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, sslMode_); + } + if (caSource_ + != com.google.cloud.alloydb.v1.SslConfig.CaSource.CA_SOURCE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, caSource_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sslMode_ + != com.google.cloud.alloydb.v1.SslConfig.SslMode.SSL_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, sslMode_); + } + if (caSource_ + != com.google.cloud.alloydb.v1.SslConfig.CaSource.CA_SOURCE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, caSource_); + } + 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.alloydb.v1.SslConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.SslConfig other = (com.google.cloud.alloydb.v1.SslConfig) obj; + + if (sslMode_ != other.sslMode_) return false; + if (caSource_ != other.caSource_) 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) + SSL_MODE_FIELD_NUMBER; + hash = (53 * hash) + sslMode_; + hash = (37 * hash) + CA_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + caSource_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.SslConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.SslConfig 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.alloydb.v1.SslConfig parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.SslConfig 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.alloydb.v1.SslConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.SslConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.SslConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.SslConfig 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.alloydb.v1.SslConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.SslConfig 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.alloydb.v1.SslConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.SslConfig 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.alloydb.v1.SslConfig 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; + } + /** + * + * + *
+   * SSL configuration for an AlloyDB Cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.SslConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.SslConfig) + com.google.cloud.alloydb.v1.SslConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SslConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SslConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.SslConfig.class, + com.google.cloud.alloydb.v1.SslConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.SslConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sslMode_ = 0; + caSource_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SslConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.SslConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.SslConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.SslConfig build() { + com.google.cloud.alloydb.v1.SslConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.SslConfig buildPartial() { + com.google.cloud.alloydb.v1.SslConfig result = + new com.google.cloud.alloydb.v1.SslConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.SslConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sslMode_ = sslMode_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.caSource_ = caSource_; + } + } + + @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.alloydb.v1.SslConfig) { + return mergeFrom((com.google.cloud.alloydb.v1.SslConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.SslConfig other) { + if (other == com.google.cloud.alloydb.v1.SslConfig.getDefaultInstance()) return this; + if (other.sslMode_ != 0) { + setSslModeValue(other.getSslModeValue()); + } + if (other.caSource_ != 0) { + setCaSourceValue(other.getCaSourceValue()); + } + 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: + { + sslMode_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + caSource_ = input.readEnum(); + 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 int sslMode_ = 0; + /** + * + * + *
+     * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for sslMode. + */ + @java.lang.Override + public int getSslModeValue() { + return sslMode_; + } + /** + * + * + *
+     * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for sslMode to set. + * @return This builder for chaining. + */ + public Builder setSslModeValue(int value) { + sslMode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sslMode. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SslConfig.SslMode getSslMode() { + com.google.cloud.alloydb.v1.SslConfig.SslMode result = + com.google.cloud.alloydb.v1.SslConfig.SslMode.forNumber(sslMode_); + return result == null ? com.google.cloud.alloydb.v1.SslConfig.SslMode.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The sslMode to set. + * @return This builder for chaining. + */ + public Builder setSslMode(com.google.cloud.alloydb.v1.SslConfig.SslMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + sslMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSslMode() { + bitField0_ = (bitField0_ & ~0x00000001); + sslMode_ = 0; + onChanged(); + return this; + } + + private int caSource_ = 0; + /** + * + * + *
+     * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+     * supported currently, and is the default value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for caSource. + */ + @java.lang.Override + public int getCaSourceValue() { + return caSource_; + } + /** + * + * + *
+     * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+     * supported currently, and is the default value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for caSource to set. + * @return This builder for chaining. + */ + public Builder setCaSourceValue(int value) { + caSource_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+     * supported currently, and is the default value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The caSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SslConfig.CaSource getCaSource() { + com.google.cloud.alloydb.v1.SslConfig.CaSource result = + com.google.cloud.alloydb.v1.SslConfig.CaSource.forNumber(caSource_); + return result == null ? com.google.cloud.alloydb.v1.SslConfig.CaSource.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+     * supported currently, and is the default value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The caSource to set. + * @return This builder for chaining. + */ + public Builder setCaSource(com.google.cloud.alloydb.v1.SslConfig.CaSource value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + caSource_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+     * supported currently, and is the default value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearCaSource() { + bitField0_ = (bitField0_ & ~0x00000002); + caSource_ = 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.alloydb.v1.SslConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.SslConfig) + private static final com.google.cloud.alloydb.v1.SslConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.SslConfig(); + } + + public static com.google.cloud.alloydb.v1.SslConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SslConfig 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.alloydb.v1.SslConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/SslConfigOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/SslConfigOrBuilder.java new file mode 100644 index 000000000000..07f2d0a8924d --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/SslConfigOrBuilder.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/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public interface SslConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.SslConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for sslMode. + */ + int getSslModeValue(); + /** + * + * + *
+   * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sslMode. + */ + com.google.cloud.alloydb.v1.SslConfig.SslMode getSslMode(); + + /** + * + * + *
+   * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+   * supported currently, and is the default value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for caSource. + */ + int getCaSourceValue(); + /** + * + * + *
+   * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+   * supported currently, and is the default value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The caSource. + */ + com.google.cloud.alloydb.v1.SslConfig.CaSource getCaSource(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/SupportedDatabaseFlag.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/SupportedDatabaseFlag.java new file mode 100644 index 000000000000..2c5e0a977baf --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/SupportedDatabaseFlag.java @@ -0,0 +1,4359 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * SupportedDatabaseFlag gives general information about a database flag,
+ * like type and allowed values. This is a static value that is defined
+ * on the server side, and it cannot be modified by callers.
+ * To set the Database flags on a particular Instance, a caller should modify
+ * the Instance.database_flags field.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.SupportedDatabaseFlag} + */ +public final class SupportedDatabaseFlag extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.SupportedDatabaseFlag) + SupportedDatabaseFlagOrBuilder { + private static final long serialVersionUID = 0L; + // Use SupportedDatabaseFlag.newBuilder() to construct. + private SupportedDatabaseFlag(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SupportedDatabaseFlag() { + name_ = ""; + flagName_ = ""; + valueType_ = 0; + supportedDbVersions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SupportedDatabaseFlag(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.class, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.Builder.class); + } + + /** + * + * + *
+   * ValueType describes the semantic type of the value that the flag accepts.
+   * Regardless of the ValueType, the Instance.database_flags field accepts the
+   * stringified version of the value, i.e. "20" or "3.14".
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType} + */ + public enum ValueType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * This is an unknown flag type.
+     * 
+ * + * VALUE_TYPE_UNSPECIFIED = 0; + */ + VALUE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * String type flag.
+     * 
+ * + * STRING = 1; + */ + STRING(1), + /** + * + * + *
+     * Integer type flag.
+     * 
+ * + * INTEGER = 2; + */ + INTEGER(2), + /** + * + * + *
+     * Float type flag.
+     * 
+ * + * FLOAT = 3; + */ + FLOAT(3), + /** + * + * + *
+     * Denotes that the flag does not accept any values.
+     * 
+ * + * NONE = 4; + */ + NONE(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * This is an unknown flag type.
+     * 
+ * + * VALUE_TYPE_UNSPECIFIED = 0; + */ + public static final int VALUE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * String type flag.
+     * 
+ * + * STRING = 1; + */ + public static final int STRING_VALUE = 1; + /** + * + * + *
+     * Integer type flag.
+     * 
+ * + * INTEGER = 2; + */ + public static final int INTEGER_VALUE = 2; + /** + * + * + *
+     * Float type flag.
+     * 
+ * + * FLOAT = 3; + */ + public static final int FLOAT_VALUE = 3; + /** + * + * + *
+     * Denotes that the flag does not accept any values.
+     * 
+ * + * NONE = 4; + */ + public static final int NONE_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 ValueType 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 ValueType forNumber(int value) { + switch (value) { + case 0: + return VALUE_TYPE_UNSPECIFIED; + case 1: + return STRING; + case 2: + return INTEGER; + case 3: + return FLOAT; + case 4: + return NONE; + 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 ValueType findValueByNumber(int number) { + return ValueType.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.alloydb.v1.SupportedDatabaseFlag.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ValueType[] VALUES = values(); + + public static ValueType 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 ValueType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType) + } + + public interface StringRestrictionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return A list containing the allowedValues. + */ + java.util.List getAllowedValuesList(); + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return The count of allowedValues. + */ + int getAllowedValuesCount(); + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the element to return. + * @return The allowedValues at the given index. + */ + java.lang.String getAllowedValues(int index); + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the allowedValues at the given index. + */ + com.google.protobuf.ByteString getAllowedValuesBytes(int index); + } + /** + * + * + *
+   * Restrictions on STRING type values
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} + */ + public static final class StringRestrictions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) + StringRestrictionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use StringRestrictions.newBuilder() to construct. + private StringRestrictions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StringRestrictions() { + allowedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StringRestrictions(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_StringRestrictions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_StringRestrictions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.class, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.Builder.class); + } + + public static final int ALLOWED_VALUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList allowedValues_; + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return A list containing the allowedValues. + */ + public com.google.protobuf.ProtocolStringList getAllowedValuesList() { + return allowedValues_; + } + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return The count of allowedValues. + */ + public int getAllowedValuesCount() { + return allowedValues_.size(); + } + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the element to return. + * @return The allowedValues at the given index. + */ + public java.lang.String getAllowedValues(int index) { + return allowedValues_.get(index); + } + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the allowedValues at the given index. + */ + public com.google.protobuf.ByteString getAllowedValuesBytes(int index) { + return allowedValues_.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 < allowedValues_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allowedValues_.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 < allowedValues_.size(); i++) { + dataSize += computeStringSizeNoTag(allowedValues_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowedValuesList().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.alloydb.v1.SupportedDatabaseFlag.StringRestrictions)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions other = + (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) obj; + + if (!getAllowedValuesList().equals(other.getAllowedValuesList())) 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 (getAllowedValuesCount() > 0) { + hash = (37 * hash) + ALLOWED_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions 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.alloydb.v1.SupportedDatabaseFlag.StringRestrictions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions 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.alloydb.v1.SupportedDatabaseFlag.StringRestrictions parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions 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.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + 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.alloydb.v1.SupportedDatabaseFlag.StringRestrictions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions 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.alloydb.v1.SupportedDatabaseFlag.StringRestrictions 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; + } + /** + * + * + *
+     * Restrictions on STRING type values
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_StringRestrictions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_StringRestrictions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.class, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.Builder.class); + } + + // Construct using + // com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + allowedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_StringRestrictions_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions build() { + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions buildPartial() { + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions result = + new com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions result) { + if (((bitField0_ & 0x00000001) != 0)) { + allowedValues_ = allowedValues_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.allowedValues_ = allowedValues_; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions result) { + int from_bitField0_ = bitField0_; + } + + @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.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) { + return mergeFrom( + (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions other) { + if (other + == com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance()) return this; + if (!other.allowedValues_.isEmpty()) { + if (allowedValues_.isEmpty()) { + allowedValues_ = other.allowedValues_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAllowedValuesIsMutable(); + allowedValues_.addAll(other.allowedValues_); + } + 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(); + ensureAllowedValuesIsMutable(); + allowedValues_.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 allowedValues_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAllowedValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + allowedValues_ = new com.google.protobuf.LazyStringArrayList(allowedValues_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @return A list containing the allowedValues. + */ + public com.google.protobuf.ProtocolStringList getAllowedValuesList() { + return allowedValues_.getUnmodifiableView(); + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @return The count of allowedValues. + */ + public int getAllowedValuesCount() { + return allowedValues_.size(); + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the element to return. + * @return The allowedValues at the given index. + */ + public java.lang.String getAllowedValues(int index) { + return allowedValues_.get(index); + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the allowedValues at the given index. + */ + public com.google.protobuf.ByteString getAllowedValuesBytes(int index) { + return allowedValues_.getByteString(index); + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index to set the value at. + * @param value The allowedValues to set. + * @return This builder for chaining. + */ + public Builder setAllowedValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedValuesIsMutable(); + allowedValues_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param value The allowedValues to add. + * @return This builder for chaining. + */ + public Builder addAllowedValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedValuesIsMutable(); + allowedValues_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param values The allowedValues to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedValues(java.lang.Iterable values) { + ensureAllowedValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedValues_); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @return This builder for chaining. + */ + public Builder clearAllowedValues() { + allowedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param value The bytes of the allowedValues to add. + * @return This builder for chaining. + */ + public Builder addAllowedValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowedValuesIsMutable(); + allowedValues_.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.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) + private static final com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions(); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringRestrictions 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.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface IntegerRestrictionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return Whether the minValue field is set. + */ + boolean hasMinValue(); + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return The minValue. + */ + com.google.protobuf.Int64Value getMinValue(); + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + com.google.protobuf.Int64ValueOrBuilder getMinValueOrBuilder(); + + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return Whether the maxValue field is set. + */ + boolean hasMaxValue(); + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return The maxValue. + */ + com.google.protobuf.Int64Value getMaxValue(); + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + com.google.protobuf.Int64ValueOrBuilder getMaxValueOrBuilder(); + } + /** + * + * + *
+   * Restrictions on INTEGER type values.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} + */ + public static final class IntegerRestrictions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) + IntegerRestrictionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use IntegerRestrictions.newBuilder() to construct. + private IntegerRestrictions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IntegerRestrictions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IntegerRestrictions(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_IntegerRestrictions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_IntegerRestrictions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.class, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.Builder.class); + } + + public static final int MIN_VALUE_FIELD_NUMBER = 1; + private com.google.protobuf.Int64Value minValue_; + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return Whether the minValue field is set. + */ + @java.lang.Override + public boolean hasMinValue() { + return minValue_ != null; + } + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return The minValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getMinValue() { + return minValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : minValue_; + } + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getMinValueOrBuilder() { + return minValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : minValue_; + } + + public static final int MAX_VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.Int64Value maxValue_; + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return Whether the maxValue field is set. + */ + @java.lang.Override + public boolean hasMaxValue() { + return maxValue_ != null; + } + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return The maxValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getMaxValue() { + return maxValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : maxValue_; + } + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getMaxValueOrBuilder() { + return maxValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : maxValue_; + } + + 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 (minValue_ != null) { + output.writeMessage(1, getMinValue()); + } + if (maxValue_ != null) { + output.writeMessage(2, getMaxValue()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minValue_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMinValue()); + } + if (maxValue_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMaxValue()); + } + 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.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions other = + (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) obj; + + if (hasMinValue() != other.hasMinValue()) return false; + if (hasMinValue()) { + if (!getMinValue().equals(other.getMinValue())) return false; + } + if (hasMaxValue() != other.hasMaxValue()) return false; + if (hasMaxValue()) { + if (!getMaxValue().equals(other.getMaxValue())) 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 (hasMinValue()) { + hash = (37 * hash) + MIN_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getMinValue().hashCode(); + } + if (hasMaxValue()) { + hash = (37 * hash) + MAX_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getMaxValue().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions 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.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions 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.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions 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.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + 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.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions 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.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions 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; + } + /** + * + * + *
+     * Restrictions on INTEGER type values.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_IntegerRestrictions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_IntegerRestrictions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.class, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.Builder + .class); + } + + // Construct using + // com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minValue_ = null; + if (minValueBuilder_ != null) { + minValueBuilder_.dispose(); + minValueBuilder_ = null; + } + maxValue_ = null; + if (maxValueBuilder_ != null) { + maxValueBuilder_.dispose(); + maxValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_IntegerRestrictions_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions build() { + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions buildPartial() { + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions result = + new com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.minValue_ = minValueBuilder_ == null ? minValue_ : minValueBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxValue_ = maxValueBuilder_ == null ? maxValue_ : maxValueBuilder_.build(); + } + } + + @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.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) { + return mergeFrom( + (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions other) { + if (other + == com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance()) return this; + if (other.hasMinValue()) { + mergeMinValue(other.getMinValue()); + } + if (other.hasMaxValue()) { + mergeMaxValue(other.getMaxValue()); + } + 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(getMinValueFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getMaxValueFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + 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.protobuf.Int64Value minValue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + minValueBuilder_; + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return Whether the minValue field is set. + */ + public boolean hasMinValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return The minValue. + */ + public com.google.protobuf.Int64Value getMinValue() { + if (minValueBuilder_ == null) { + return minValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : minValue_; + } else { + return minValueBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public Builder setMinValue(com.google.protobuf.Int64Value value) { + if (minValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minValue_ = value; + } else { + minValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public Builder setMinValue(com.google.protobuf.Int64Value.Builder builderForValue) { + if (minValueBuilder_ == null) { + minValue_ = builderForValue.build(); + } else { + minValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public Builder mergeMinValue(com.google.protobuf.Int64Value value) { + if (minValueBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && minValue_ != null + && minValue_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getMinValueBuilder().mergeFrom(value); + } else { + minValue_ = value; + } + } else { + minValueBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public Builder clearMinValue() { + bitField0_ = (bitField0_ & ~0x00000001); + minValue_ = null; + if (minValueBuilder_ != null) { + minValueBuilder_.dispose(); + minValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public com.google.protobuf.Int64Value.Builder getMinValueBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMinValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public com.google.protobuf.Int64ValueOrBuilder getMinValueOrBuilder() { + if (minValueBuilder_ != null) { + return minValueBuilder_.getMessageOrBuilder(); + } else { + return minValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : minValue_; + } + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + getMinValueFieldBuilder() { + if (minValueBuilder_ == null) { + minValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getMinValue(), getParentForChildren(), isClean()); + minValue_ = null; + } + return minValueBuilder_; + } + + private com.google.protobuf.Int64Value maxValue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + maxValueBuilder_; + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return Whether the maxValue field is set. + */ + public boolean hasMaxValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return The maxValue. + */ + public com.google.protobuf.Int64Value getMaxValue() { + if (maxValueBuilder_ == null) { + return maxValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : maxValue_; + } else { + return maxValueBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public Builder setMaxValue(com.google.protobuf.Int64Value value) { + if (maxValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maxValue_ = value; + } else { + maxValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public Builder setMaxValue(com.google.protobuf.Int64Value.Builder builderForValue) { + if (maxValueBuilder_ == null) { + maxValue_ = builderForValue.build(); + } else { + maxValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public Builder mergeMaxValue(com.google.protobuf.Int64Value value) { + if (maxValueBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && maxValue_ != null + && maxValue_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getMaxValueBuilder().mergeFrom(value); + } else { + maxValue_ = value; + } + } else { + maxValueBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public Builder clearMaxValue() { + bitField0_ = (bitField0_ & ~0x00000002); + maxValue_ = null; + if (maxValueBuilder_ != null) { + maxValueBuilder_.dispose(); + maxValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public com.google.protobuf.Int64Value.Builder getMaxValueBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getMaxValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public com.google.protobuf.Int64ValueOrBuilder getMaxValueOrBuilder() { + if (maxValueBuilder_ != null) { + return maxValueBuilder_.getMessageOrBuilder(); + } else { + return maxValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : maxValue_; + } + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + getMaxValueFieldBuilder() { + if (maxValueBuilder_ == null) { + maxValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getMaxValue(), getParentForChildren(), isClean()); + maxValue_ = null; + } + return maxValueBuilder_; + } + + @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.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) + private static final com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions(); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IntegerRestrictions 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.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int restrictionsCase_ = 0; + private java.lang.Object restrictions_; + + public enum RestrictionsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STRING_RESTRICTIONS(7), + INTEGER_RESTRICTIONS(8), + RESTRICTIONS_NOT_SET(0); + private final int value; + + private RestrictionsCase(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 RestrictionsCase valueOf(int value) { + return forNumber(value); + } + + public static RestrictionsCase forNumber(int value) { + switch (value) { + case 7: + return STRING_RESTRICTIONS; + case 8: + return INTEGER_RESTRICTIONS; + case 0: + return RESTRICTIONS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RestrictionsCase getRestrictionsCase() { + return RestrictionsCase.forNumber(restrictionsCase_); + } + + public static final int STRING_RESTRICTIONS_FIELD_NUMBER = 7; + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return Whether the stringRestrictions field is set. + */ + @java.lang.Override + public boolean hasStringRestrictions() { + return restrictionsCase_ == 7; + } + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return The stringRestrictions. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + getStringRestrictions() { + if (restrictionsCase_ == 7) { + return (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) restrictions_; + } + return com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictionsOrBuilder + getStringRestrictionsOrBuilder() { + if (restrictionsCase_ == 7) { + return (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) restrictions_; + } + return com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + + public static final int INTEGER_RESTRICTIONS_FIELD_NUMBER = 8; + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return Whether the integerRestrictions field is set. + */ + @java.lang.Override + public boolean hasIntegerRestrictions() { + return restrictionsCase_ == 8; + } + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return The integerRestrictions. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + getIntegerRestrictions() { + if (restrictionsCase_ == 8) { + return (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) restrictions_; + } + return com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder + getIntegerRestrictionsOrBuilder() { + if (restrictionsCase_ == 8) { + return (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) restrictions_; + } + return com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * The name of the flag resource, following Google Cloud conventions, e.g.:
+   *  * projects/{project}/locations/{location}/flags/{flag}
+   * This field currently has no semantic meaning.
+   * 
+ * + * 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 name of the flag resource, following Google Cloud conventions, e.g.:
+   *  * projects/{project}/locations/{location}/flags/{flag}
+   * This field currently has no semantic meaning.
+   * 
+ * + * 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 FLAG_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object flagName_ = ""; + /** + * + * + *
+   * The name of the database flag, e.g. "max_allowed_packets".
+   * The is a possibly key for the Instance.database_flags map field.
+   * 
+ * + * string flag_name = 2; + * + * @return The flagName. + */ + @java.lang.Override + public java.lang.String getFlagName() { + java.lang.Object ref = flagName_; + 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(); + flagName_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the database flag, e.g. "max_allowed_packets".
+   * The is a possibly key for the Instance.database_flags map field.
+   * 
+ * + * string flag_name = 2; + * + * @return The bytes for flagName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFlagNameBytes() { + java.lang.Object ref = flagName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + flagName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_TYPE_FIELD_NUMBER = 3; + private int valueType_ = 0; + /** + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The enum numeric value on the wire for valueType. + */ + @java.lang.Override + public int getValueTypeValue() { + return valueType_; + } + /** + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The valueType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType getValueType() { + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType result = + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType.forNumber(valueType_); + return result == null + ? com.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType.UNRECOGNIZED + : result; + } + + public static final int ACCEPTS_MULTIPLE_VALUES_FIELD_NUMBER = 4; + private boolean acceptsMultipleValues_ = false; + /** + * + * + *
+   * Whether the database flag accepts multiple values. If true,
+   * a comma-separated list of stringified values may be specified.
+   * 
+ * + * bool accepts_multiple_values = 4; + * + * @return The acceptsMultipleValues. + */ + @java.lang.Override + public boolean getAcceptsMultipleValues() { + return acceptsMultipleValues_; + } + + public static final int SUPPORTED_DB_VERSIONS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List supportedDbVersions_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.alloydb.v1.DatabaseVersion> + supportedDbVersions_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.alloydb.v1.DatabaseVersion>() { + public com.google.cloud.alloydb.v1.DatabaseVersion convert(java.lang.Integer from) { + com.google.cloud.alloydb.v1.DatabaseVersion result = + com.google.cloud.alloydb.v1.DatabaseVersion.forNumber(from); + return result == null + ? com.google.cloud.alloydb.v1.DatabaseVersion.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the supportedDbVersions. + */ + @java.lang.Override + public java.util.List getSupportedDbVersionsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.alloydb.v1.DatabaseVersion>( + supportedDbVersions_, supportedDbVersions_converter_); + } + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @return The count of supportedDbVersions. + */ + @java.lang.Override + public int getSupportedDbVersionsCount() { + return supportedDbVersions_.size(); + } + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the element to return. + * @return The supportedDbVersions at the given index. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.DatabaseVersion getSupportedDbVersions(int index) { + return supportedDbVersions_converter_.convert(supportedDbVersions_.get(index)); + } + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the enum numeric values on the wire for supportedDbVersions. + */ + @java.lang.Override + public java.util.List getSupportedDbVersionsValueList() { + return supportedDbVersions_; + } + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of supportedDbVersions at the given index. + */ + @java.lang.Override + public int getSupportedDbVersionsValue(int index) { + return supportedDbVersions_.get(index); + } + + private int supportedDbVersionsMemoizedSerializedSize; + + public static final int REQUIRES_DB_RESTART_FIELD_NUMBER = 6; + private boolean requiresDbRestart_ = false; + /** + * + * + *
+   * Whether setting or updating this flag on an Instance requires a database
+   * restart. If a flag that requires database restart is set, the backend
+   * will automatically restart the database (making sure to satisfy any
+   * availability SLO's).
+   * 
+ * + * bool requires_db_restart = 6; + * + * @return The requiresDbRestart. + */ + @java.lang.Override + public boolean getRequiresDbRestart() { + return requiresDbRestart_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(flagName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, flagName_); + } + if (valueType_ + != com.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType.VALUE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, valueType_); + } + if (acceptsMultipleValues_ != false) { + output.writeBool(4, acceptsMultipleValues_); + } + if (getSupportedDbVersionsList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(supportedDbVersionsMemoizedSerializedSize); + } + for (int i = 0; i < supportedDbVersions_.size(); i++) { + output.writeEnumNoTag(supportedDbVersions_.get(i)); + } + if (requiresDbRestart_ != false) { + output.writeBool(6, requiresDbRestart_); + } + if (restrictionsCase_ == 7) { + output.writeMessage( + 7, (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) restrictions_); + } + if (restrictionsCase_ == 8) { + output.writeMessage( + 8, (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) restrictions_); + } + 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(flagName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, flagName_); + } + if (valueType_ + != com.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType.VALUE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, valueType_); + } + if (acceptsMultipleValues_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, acceptsMultipleValues_); + } + { + int dataSize = 0; + for (int i = 0; i < supportedDbVersions_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(supportedDbVersions_.get(i)); + } + size += dataSize; + if (!getSupportedDbVersionsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + supportedDbVersionsMemoizedSerializedSize = dataSize; + } + if (requiresDbRestart_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requiresDbRestart_); + } + if (restrictionsCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, + (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) restrictions_); + } + if (restrictionsCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, + (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_); + } + 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.alloydb.v1.SupportedDatabaseFlag)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.SupportedDatabaseFlag other = + (com.google.cloud.alloydb.v1.SupportedDatabaseFlag) obj; + + if (!getName().equals(other.getName())) return false; + if (!getFlagName().equals(other.getFlagName())) return false; + if (valueType_ != other.valueType_) return false; + if (getAcceptsMultipleValues() != other.getAcceptsMultipleValues()) return false; + if (!supportedDbVersions_.equals(other.supportedDbVersions_)) return false; + if (getRequiresDbRestart() != other.getRequiresDbRestart()) return false; + if (!getRestrictionsCase().equals(other.getRestrictionsCase())) return false; + switch (restrictionsCase_) { + case 7: + if (!getStringRestrictions().equals(other.getStringRestrictions())) return false; + break; + case 8: + if (!getIntegerRestrictions().equals(other.getIntegerRestrictions())) 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) + FLAG_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFlagName().hashCode(); + hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + valueType_; + hash = (37 * hash) + ACCEPTS_MULTIPLE_VALUES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAcceptsMultipleValues()); + if (getSupportedDbVersionsCount() > 0) { + hash = (37 * hash) + SUPPORTED_DB_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + supportedDbVersions_.hashCode(); + } + hash = (37 * hash) + REQUIRES_DB_RESTART_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequiresDbRestart()); + switch (restrictionsCase_) { + case 7: + hash = (37 * hash) + STRING_RESTRICTIONS_FIELD_NUMBER; + hash = (53 * hash) + getStringRestrictions().hashCode(); + break; + case 8: + hash = (37 * hash) + INTEGER_RESTRICTIONS_FIELD_NUMBER; + hash = (53 * hash) + getIntegerRestrictions().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag 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.alloydb.v1.SupportedDatabaseFlag parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag 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.alloydb.v1.SupportedDatabaseFlag parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag 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.alloydb.v1.SupportedDatabaseFlag parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag 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.alloydb.v1.SupportedDatabaseFlag parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag 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.alloydb.v1.SupportedDatabaseFlag 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; + } + /** + * + * + *
+   * SupportedDatabaseFlag gives general information about a database flag,
+   * like type and allowed values. This is a static value that is defined
+   * on the server side, and it cannot be modified by callers.
+   * To set the Database flags on a particular Instance, a caller should modify
+   * the Instance.database_flags field.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.SupportedDatabaseFlag} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.SupportedDatabaseFlag) + com.google.cloud.alloydb.v1.SupportedDatabaseFlagOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.class, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.SupportedDatabaseFlag.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (stringRestrictionsBuilder_ != null) { + stringRestrictionsBuilder_.clear(); + } + if (integerRestrictionsBuilder_ != null) { + integerRestrictionsBuilder_.clear(); + } + name_ = ""; + flagName_ = ""; + valueType_ = 0; + acceptsMultipleValues_ = false; + supportedDbVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + requiresDbRestart_ = false; + restrictionsCase_ = 0; + restrictions_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.SupportedDatabaseFlag.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag build() { + com.google.cloud.alloydb.v1.SupportedDatabaseFlag result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag buildPartial() { + com.google.cloud.alloydb.v1.SupportedDatabaseFlag result = + new com.google.cloud.alloydb.v1.SupportedDatabaseFlag(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag result) { + if (((bitField0_ & 0x00000040) != 0)) { + supportedDbVersions_ = java.util.Collections.unmodifiableList(supportedDbVersions_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.supportedDbVersions_ = supportedDbVersions_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.SupportedDatabaseFlag result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.flagName_ = flagName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.valueType_ = valueType_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.acceptsMultipleValues_ = acceptsMultipleValues_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.requiresDbRestart_ = requiresDbRestart_; + } + } + + private void buildPartialOneofs(com.google.cloud.alloydb.v1.SupportedDatabaseFlag result) { + result.restrictionsCase_ = restrictionsCase_; + result.restrictions_ = this.restrictions_; + if (restrictionsCase_ == 7 && stringRestrictionsBuilder_ != null) { + result.restrictions_ = stringRestrictionsBuilder_.build(); + } + if (restrictionsCase_ == 8 && integerRestrictionsBuilder_ != null) { + result.restrictions_ = integerRestrictionsBuilder_.build(); + } + } + + @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.alloydb.v1.SupportedDatabaseFlag) { + return mergeFrom((com.google.cloud.alloydb.v1.SupportedDatabaseFlag) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.SupportedDatabaseFlag other) { + if (other == com.google.cloud.alloydb.v1.SupportedDatabaseFlag.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFlagName().isEmpty()) { + flagName_ = other.flagName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.valueType_ != 0) { + setValueTypeValue(other.getValueTypeValue()); + } + if (other.getAcceptsMultipleValues() != false) { + setAcceptsMultipleValues(other.getAcceptsMultipleValues()); + } + if (!other.supportedDbVersions_.isEmpty()) { + if (supportedDbVersions_.isEmpty()) { + supportedDbVersions_ = other.supportedDbVersions_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.addAll(other.supportedDbVersions_); + } + onChanged(); + } + if (other.getRequiresDbRestart() != false) { + setRequiresDbRestart(other.getRequiresDbRestart()); + } + switch (other.getRestrictionsCase()) { + case STRING_RESTRICTIONS: + { + mergeStringRestrictions(other.getStringRestrictions()); + break; + } + case INTEGER_RESTRICTIONS: + { + mergeIntegerRestrictions(other.getIntegerRestrictions()); + break; + } + case RESTRICTIONS_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(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 18: + { + flagName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 24: + { + valueType_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 24 + case 32: + { + acceptsMultipleValues_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 32 + case 40: + { + int tmpRaw = input.readEnum(); + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.add(tmpRaw); + break; + } // case 40 + case 42: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 42 + case 48: + { + requiresDbRestart_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 48 + case 58: + { + input.readMessage( + getStringRestrictionsFieldBuilder().getBuilder(), extensionRegistry); + restrictionsCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage( + getIntegerRestrictionsFieldBuilder().getBuilder(), extensionRegistry); + restrictionsCase_ = 8; + break; + } // case 66 + 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 restrictionsCase_ = 0; + private java.lang.Object restrictions_; + + public RestrictionsCase getRestrictionsCase() { + return RestrictionsCase.forNumber(restrictionsCase_); + } + + public Builder clearRestrictions() { + restrictionsCase_ = 0; + restrictions_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.Builder, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictionsOrBuilder> + stringRestrictionsBuilder_; + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return Whether the stringRestrictions field is set. + */ + @java.lang.Override + public boolean hasStringRestrictions() { + return restrictionsCase_ == 7; + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return The stringRestrictions. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + getStringRestrictions() { + if (stringRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 7) { + return (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } else { + if (restrictionsCase_ == 7) { + return stringRestrictionsBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + public Builder setStringRestrictions( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions value) { + if (stringRestrictionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + restrictions_ = value; + onChanged(); + } else { + stringRestrictionsBuilder_.setMessage(value); + } + restrictionsCase_ = 7; + return this; + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + public Builder setStringRestrictions( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.Builder + builderForValue) { + if (stringRestrictionsBuilder_ == null) { + restrictions_ = builderForValue.build(); + onChanged(); + } else { + stringRestrictionsBuilder_.setMessage(builderForValue.build()); + } + restrictionsCase_ = 7; + return this; + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + public Builder mergeStringRestrictions( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions value) { + if (stringRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 7 + && restrictions_ + != com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance()) { + restrictions_ = + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.newBuilder( + (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) + restrictions_) + .mergeFrom(value) + .buildPartial(); + } else { + restrictions_ = value; + } + onChanged(); + } else { + if (restrictionsCase_ == 7) { + stringRestrictionsBuilder_.mergeFrom(value); + } else { + stringRestrictionsBuilder_.setMessage(value); + } + } + restrictionsCase_ = 7; + return this; + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + public Builder clearStringRestrictions() { + if (stringRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 7) { + restrictionsCase_ = 0; + restrictions_ = null; + onChanged(); + } + } else { + if (restrictionsCase_ == 7) { + restrictionsCase_ = 0; + restrictions_ = null; + } + stringRestrictionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.Builder + getStringRestrictionsBuilder() { + return getStringRestrictionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictionsOrBuilder + getStringRestrictionsOrBuilder() { + if ((restrictionsCase_ == 7) && (stringRestrictionsBuilder_ != null)) { + return stringRestrictionsBuilder_.getMessageOrBuilder(); + } else { + if (restrictionsCase_ == 7) { + return (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.Builder, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictionsOrBuilder> + getStringRestrictionsFieldBuilder() { + if (stringRestrictionsBuilder_ == null) { + if (!(restrictionsCase_ == 7)) { + restrictions_ = + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + stringRestrictionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.Builder, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictionsOrBuilder>( + (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) + restrictions_, + getParentForChildren(), + isClean()); + restrictions_ = null; + } + restrictionsCase_ = 7; + onChanged(); + return stringRestrictionsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.Builder, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder> + integerRestrictionsBuilder_; + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return Whether the integerRestrictions field is set. + */ + @java.lang.Override + public boolean hasIntegerRestrictions() { + return restrictionsCase_ == 8; + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return The integerRestrictions. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + getIntegerRestrictions() { + if (integerRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 8) { + return (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } else { + if (restrictionsCase_ == 8) { + return integerRestrictionsBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + public Builder setIntegerRestrictions( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions value) { + if (integerRestrictionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + restrictions_ = value; + onChanged(); + } else { + integerRestrictionsBuilder_.setMessage(value); + } + restrictionsCase_ = 8; + return this; + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + public Builder setIntegerRestrictions( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.Builder + builderForValue) { + if (integerRestrictionsBuilder_ == null) { + restrictions_ = builderForValue.build(); + onChanged(); + } else { + integerRestrictionsBuilder_.setMessage(builderForValue.build()); + } + restrictionsCase_ = 8; + return this; + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + public Builder mergeIntegerRestrictions( + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions value) { + if (integerRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 8 + && restrictions_ + != com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance()) { + restrictions_ = + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.newBuilder( + (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_) + .mergeFrom(value) + .buildPartial(); + } else { + restrictions_ = value; + } + onChanged(); + } else { + if (restrictionsCase_ == 8) { + integerRestrictionsBuilder_.mergeFrom(value); + } else { + integerRestrictionsBuilder_.setMessage(value); + } + } + restrictionsCase_ = 8; + return this; + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + public Builder clearIntegerRestrictions() { + if (integerRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 8) { + restrictionsCase_ = 0; + restrictions_ = null; + onChanged(); + } + } else { + if (restrictionsCase_ == 8) { + restrictionsCase_ = 0; + restrictions_ = null; + } + integerRestrictionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.Builder + getIntegerRestrictionsBuilder() { + return getIntegerRestrictionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder + getIntegerRestrictionsOrBuilder() { + if ((restrictionsCase_ == 8) && (integerRestrictionsBuilder_ != null)) { + return integerRestrictionsBuilder_.getMessageOrBuilder(); + } else { + if (restrictionsCase_ == 8) { + return (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.Builder, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder> + getIntegerRestrictionsFieldBuilder() { + if (integerRestrictionsBuilder_ == null) { + if (!(restrictionsCase_ == 8)) { + restrictions_ = + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + integerRestrictionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.Builder, + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder>( + (com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_, + getParentForChildren(), + isClean()); + restrictions_ = null; + } + restrictionsCase_ = 8; + onChanged(); + return integerRestrictionsBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the flag resource, following Google Cloud conventions, e.g.:
+     *  * projects/{project}/locations/{location}/flags/{flag}
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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 name of the flag resource, following Google Cloud conventions, e.g.:
+     *  * projects/{project}/locations/{location}/flags/{flag}
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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 name of the flag resource, following Google Cloud conventions, e.g.:
+     *  * projects/{project}/locations/{location}/flags/{flag}
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the flag resource, following Google Cloud conventions, e.g.:
+     *  * projects/{project}/locations/{location}/flags/{flag}
+     * This field currently has no semantic meaning.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the flag resource, following Google Cloud conventions, e.g.:
+     *  * projects/{project}/locations/{location}/flags/{flag}
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object flagName_ = ""; + /** + * + * + *
+     * The name of the database flag, e.g. "max_allowed_packets".
+     * The is a possibly key for the Instance.database_flags map field.
+     * 
+ * + * string flag_name = 2; + * + * @return The flagName. + */ + public java.lang.String getFlagName() { + java.lang.Object ref = flagName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + flagName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the database flag, e.g. "max_allowed_packets".
+     * The is a possibly key for the Instance.database_flags map field.
+     * 
+ * + * string flag_name = 2; + * + * @return The bytes for flagName. + */ + public com.google.protobuf.ByteString getFlagNameBytes() { + java.lang.Object ref = flagName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + flagName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the database flag, e.g. "max_allowed_packets".
+     * The is a possibly key for the Instance.database_flags map field.
+     * 
+ * + * string flag_name = 2; + * + * @param value The flagName to set. + * @return This builder for chaining. + */ + public Builder setFlagName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + flagName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the database flag, e.g. "max_allowed_packets".
+     * The is a possibly key for the Instance.database_flags map field.
+     * 
+ * + * string flag_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearFlagName() { + flagName_ = getDefaultInstance().getFlagName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the database flag, e.g. "max_allowed_packets".
+     * The is a possibly key for the Instance.database_flags map field.
+     * 
+ * + * string flag_name = 2; + * + * @param value The bytes for flagName to set. + * @return This builder for chaining. + */ + public Builder setFlagNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + flagName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private int valueType_ = 0; + /** + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The enum numeric value on the wire for valueType. + */ + @java.lang.Override + public int getValueTypeValue() { + return valueType_; + } + /** + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @param value The enum numeric value on the wire for valueType to set. + * @return This builder for chaining. + */ + public Builder setValueTypeValue(int value) { + valueType_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The valueType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType getValueType() { + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType result = + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType.forNumber(valueType_); + return result == null + ? com.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType.UNRECOGNIZED + : result; + } + /** + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @param value The valueType to set. + * @return This builder for chaining. + */ + public Builder setValueType(com.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + valueType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return This builder for chaining. + */ + public Builder clearValueType() { + bitField0_ = (bitField0_ & ~0x00000010); + valueType_ = 0; + onChanged(); + return this; + } + + private boolean acceptsMultipleValues_; + /** + * + * + *
+     * Whether the database flag accepts multiple values. If true,
+     * a comma-separated list of stringified values may be specified.
+     * 
+ * + * bool accepts_multiple_values = 4; + * + * @return The acceptsMultipleValues. + */ + @java.lang.Override + public boolean getAcceptsMultipleValues() { + return acceptsMultipleValues_; + } + /** + * + * + *
+     * Whether the database flag accepts multiple values. If true,
+     * a comma-separated list of stringified values may be specified.
+     * 
+ * + * bool accepts_multiple_values = 4; + * + * @param value The acceptsMultipleValues to set. + * @return This builder for chaining. + */ + public Builder setAcceptsMultipleValues(boolean value) { + + acceptsMultipleValues_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the database flag accepts multiple values. If true,
+     * a comma-separated list of stringified values may be specified.
+     * 
+ * + * bool accepts_multiple_values = 4; + * + * @return This builder for chaining. + */ + public Builder clearAcceptsMultipleValues() { + bitField0_ = (bitField0_ & ~0x00000020); + acceptsMultipleValues_ = false; + onChanged(); + return this; + } + + private java.util.List supportedDbVersions_ = + java.util.Collections.emptyList(); + + private void ensureSupportedDbVersionsIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + supportedDbVersions_ = new java.util.ArrayList(supportedDbVersions_); + bitField0_ |= 0x00000040; + } + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the supportedDbVersions. + */ + public java.util.List + getSupportedDbVersionsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.alloydb.v1.DatabaseVersion>( + supportedDbVersions_, supportedDbVersions_converter_); + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @return The count of supportedDbVersions. + */ + public int getSupportedDbVersionsCount() { + return supportedDbVersions_.size(); + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the element to return. + * @return The supportedDbVersions at the given index. + */ + public com.google.cloud.alloydb.v1.DatabaseVersion getSupportedDbVersions(int index) { + return supportedDbVersions_converter_.convert(supportedDbVersions_.get(index)); + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @param index The index to set the value at. + * @param value The supportedDbVersions to set. + * @return This builder for chaining. + */ + public Builder setSupportedDbVersions( + int index, com.google.cloud.alloydb.v1.DatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @param value The supportedDbVersions to add. + * @return This builder for chaining. + */ + public Builder addSupportedDbVersions(com.google.cloud.alloydb.v1.DatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @param values The supportedDbVersions to add. + * @return This builder for chaining. + */ + public Builder addAllSupportedDbVersions( + java.lang.Iterable values) { + ensureSupportedDbVersionsIsMutable(); + for (com.google.cloud.alloydb.v1.DatabaseVersion value : values) { + supportedDbVersions_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @return This builder for chaining. + */ + public Builder clearSupportedDbVersions() { + supportedDbVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the enum numeric values on the wire for supportedDbVersions. + */ + public java.util.List getSupportedDbVersionsValueList() { + return java.util.Collections.unmodifiableList(supportedDbVersions_); + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of supportedDbVersions at the given index. + */ + public int getSupportedDbVersionsValue(int index) { + return supportedDbVersions_.get(index); + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for supportedDbVersions to set. + * @return This builder for chaining. + */ + public Builder setSupportedDbVersionsValue(int index, int value) { + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @param value The enum numeric value on the wire for supportedDbVersions to add. + * @return This builder for chaining. + */ + public Builder addSupportedDbVersionsValue(int value) { + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @param values The enum numeric values on the wire for supportedDbVersions to add. + * @return This builder for chaining. + */ + public Builder addAllSupportedDbVersionsValue(java.lang.Iterable values) { + ensureSupportedDbVersionsIsMutable(); + for (int value : values) { + supportedDbVersions_.add(value); + } + onChanged(); + return this; + } + + private boolean requiresDbRestart_; + /** + * + * + *
+     * Whether setting or updating this flag on an Instance requires a database
+     * restart. If a flag that requires database restart is set, the backend
+     * will automatically restart the database (making sure to satisfy any
+     * availability SLO's).
+     * 
+ * + * bool requires_db_restart = 6; + * + * @return The requiresDbRestart. + */ + @java.lang.Override + public boolean getRequiresDbRestart() { + return requiresDbRestart_; + } + /** + * + * + *
+     * Whether setting or updating this flag on an Instance requires a database
+     * restart. If a flag that requires database restart is set, the backend
+     * will automatically restart the database (making sure to satisfy any
+     * availability SLO's).
+     * 
+ * + * bool requires_db_restart = 6; + * + * @param value The requiresDbRestart to set. + * @return This builder for chaining. + */ + public Builder setRequiresDbRestart(boolean value) { + + requiresDbRestart_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether setting or updating this flag on an Instance requires a database
+     * restart. If a flag that requires database restart is set, the backend
+     * will automatically restart the database (making sure to satisfy any
+     * availability SLO's).
+     * 
+ * + * bool requires_db_restart = 6; + * + * @return This builder for chaining. + */ + public Builder clearRequiresDbRestart() { + bitField0_ = (bitField0_ & ~0x00000080); + requiresDbRestart_ = 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.alloydb.v1.SupportedDatabaseFlag) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.SupportedDatabaseFlag) + private static final com.google.cloud.alloydb.v1.SupportedDatabaseFlag DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.SupportedDatabaseFlag(); + } + + public static com.google.cloud.alloydb.v1.SupportedDatabaseFlag getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SupportedDatabaseFlag 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.alloydb.v1.SupportedDatabaseFlag getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/SupportedDatabaseFlagName.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/SupportedDatabaseFlagName.java new file mode 100644 index 000000000000..34cb4796c3d6 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/SupportedDatabaseFlagName.java @@ -0,0 +1,218 @@ +/* + * 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.alloydb.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 SupportedDatabaseFlagName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_FLAG = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/flags/{flag}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String flag; + + @Deprecated + protected SupportedDatabaseFlagName() { + project = null; + location = null; + flag = null; + } + + private SupportedDatabaseFlagName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + flag = Preconditions.checkNotNull(builder.getFlag()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFlag() { + return flag; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SupportedDatabaseFlagName of(String project, String location, String flag) { + return newBuilder().setProject(project).setLocation(location).setFlag(flag).build(); + } + + public static String format(String project, String location, String flag) { + return newBuilder().setProject(project).setLocation(location).setFlag(flag).build().toString(); + } + + public static SupportedDatabaseFlagName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_FLAG.validatedMatch( + formattedString, + "SupportedDatabaseFlagName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("flag")); + } + + 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 (SupportedDatabaseFlagName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_FLAG.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 (flag != null) { + fieldMapBuilder.put("flag", flag); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_FLAG.instantiate( + "project", project, "location", location, "flag", flag); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SupportedDatabaseFlagName that = ((SupportedDatabaseFlagName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.flag, that.flag); + } + 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(flag); + return h; + } + + /** Builder for projects/{project}/locations/{location}/flags/{flag}. */ + public static class Builder { + private String project; + private String location; + private String flag; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFlag() { + return flag; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setFlag(String flag) { + this.flag = flag; + return this; + } + + private Builder(SupportedDatabaseFlagName supportedDatabaseFlagName) { + this.project = supportedDatabaseFlagName.project; + this.location = supportedDatabaseFlagName.location; + this.flag = supportedDatabaseFlagName.flag; + } + + public SupportedDatabaseFlagName build() { + return new SupportedDatabaseFlagName(this); + } + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/SupportedDatabaseFlagOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/SupportedDatabaseFlagOrBuilder.java new file mode 100644 index 000000000000..ee2d340c755c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/SupportedDatabaseFlagOrBuilder.java @@ -0,0 +1,273 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public interface SupportedDatabaseFlagOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.SupportedDatabaseFlag) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return Whether the stringRestrictions field is set. + */ + boolean hasStringRestrictions(); + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return The stringRestrictions. + */ + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions getStringRestrictions(); + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictionsOrBuilder + getStringRestrictionsOrBuilder(); + + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return Whether the integerRestrictions field is set. + */ + boolean hasIntegerRestrictions(); + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return The integerRestrictions. + */ + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions getIntegerRestrictions(); + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder + getIntegerRestrictionsOrBuilder(); + + /** + * + * + *
+   * The name of the flag resource, following Google Cloud conventions, e.g.:
+   *  * projects/{project}/locations/{location}/flags/{flag}
+   * This field currently has no semantic meaning.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the flag resource, following Google Cloud conventions, e.g.:
+   *  * projects/{project}/locations/{location}/flags/{flag}
+   * This field currently has no semantic meaning.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The name of the database flag, e.g. "max_allowed_packets".
+   * The is a possibly key for the Instance.database_flags map field.
+   * 
+ * + * string flag_name = 2; + * + * @return The flagName. + */ + java.lang.String getFlagName(); + /** + * + * + *
+   * The name of the database flag, e.g. "max_allowed_packets".
+   * The is a possibly key for the Instance.database_flags map field.
+   * 
+ * + * string flag_name = 2; + * + * @return The bytes for flagName. + */ + com.google.protobuf.ByteString getFlagNameBytes(); + + /** + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The enum numeric value on the wire for valueType. + */ + int getValueTypeValue(); + /** + * .google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The valueType. + */ + com.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType getValueType(); + + /** + * + * + *
+   * Whether the database flag accepts multiple values. If true,
+   * a comma-separated list of stringified values may be specified.
+   * 
+ * + * bool accepts_multiple_values = 4; + * + * @return The acceptsMultipleValues. + */ + boolean getAcceptsMultipleValues(); + + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the supportedDbVersions. + */ + java.util.List getSupportedDbVersionsList(); + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @return The count of supportedDbVersions. + */ + int getSupportedDbVersionsCount(); + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the element to return. + * @return The supportedDbVersions at the given index. + */ + com.google.cloud.alloydb.v1.DatabaseVersion getSupportedDbVersions(int index); + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the enum numeric values on the wire for supportedDbVersions. + */ + java.util.List getSupportedDbVersionsValueList(); + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of supportedDbVersions at the given index. + */ + int getSupportedDbVersionsValue(int index); + + /** + * + * + *
+   * Whether setting or updating this flag on an Instance requires a database
+   * restart. If a flag that requires database restart is set, the backend
+   * will automatically restart the database (making sure to satisfy any
+   * availability SLO's).
+   * 
+ * + * bool requires_db_restart = 6; + * + * @return The requiresDbRestart. + */ + boolean getRequiresDbRestart(); + + public com.google.cloud.alloydb.v1.SupportedDatabaseFlag.RestrictionsCase getRestrictionsCase(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateBackupRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateBackupRequest.java new file mode 100644 index 000000000000..6f276422d253 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateBackupRequest.java @@ -0,0 +1,1481 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for updating a Backup
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.UpdateBackupRequest} + */ +public final class UpdateBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.UpdateBackupRequest) + UpdateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateBackupRequest.newBuilder() to construct. + private UpdateBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateBackupRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateBackupRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.UpdateBackupRequest.class, + com.google.cloud.alloydb.v1.UpdateBackupRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int BACKUP_FIELD_NUMBER = 2; + private com.google.cloud.alloydb.v1.Backup backup_; + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return backup_ != null; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Backup getBackup() { + return backup_ == null ? com.google.cloud.alloydb.v1.Backup.getDefaultInstance() : backup_; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.BackupOrBuilder getBackupOrBuilder() { + return backup_ == null ? com.google.cloud.alloydb.v1.Backup.getDefaultInstance() : backup_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_ = false; + /** + * + * + *
+   * Optional. If set to true, update succeeds even if instance is not found. In
+   * that case, a new backup is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (backup_ != null) { + output.writeMessage(2, getBackup()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (backup_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBackup()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + 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.alloydb.v1.UpdateBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.UpdateBackupRequest other = + (com.google.cloud.alloydb.v1.UpdateBackupRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) 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 (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.UpdateBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.UpdateBackupRequest 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.alloydb.v1.UpdateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.UpdateBackupRequest 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.alloydb.v1.UpdateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.UpdateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.UpdateBackupRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.UpdateBackupRequest 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.alloydb.v1.UpdateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.UpdateBackupRequest 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.alloydb.v1.UpdateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.UpdateBackupRequest 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.alloydb.v1.UpdateBackupRequest 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; + } + /** + * + * + *
+   * Message for updating a Backup
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.UpdateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.UpdateBackupRequest) + com.google.cloud.alloydb.v1.UpdateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.UpdateBackupRequest.class, + com.google.cloud.alloydb.v1.UpdateBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.UpdateBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UpdateBackupRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.UpdateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UpdateBackupRequest build() { + com.google.cloud.alloydb.v1.UpdateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UpdateBackupRequest buildPartial() { + com.google.cloud.alloydb.v1.UpdateBackupRequest result = + new com.google.cloud.alloydb.v1.UpdateBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.UpdateBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backup_ = backupBuilder_ == null ? backup_ : backupBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @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.alloydb.v1.UpdateBackupRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.UpdateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.UpdateBackupRequest other) { + if (other == com.google.cloud.alloydb.v1.UpdateBackupRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getBackupFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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.alloydb.v1.Backup backup_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Backup, + com.google.cloud.alloydb.v1.Backup.Builder, + com.google.cloud.alloydb.v1.BackupOrBuilder> + backupBuilder_; + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.cloud.alloydb.v1.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null ? com.google.cloud.alloydb.v1.Backup.getDefaultInstance() : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.alloydb.v1.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + } else { + backupBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.alloydb.v1.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.cloud.alloydb.v1.Backup value) { + if (backupBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && backup_ != null + && backup_ != com.google.cloud.alloydb.v1.Backup.getDefaultInstance()) { + getBackupBuilder().mergeFrom(value); + } else { + backup_ = value; + } + } else { + backupBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + bitField0_ = (bitField0_ & ~0x00000002); + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.Backup.Builder getBackupBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getBackupFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null ? com.google.cloud.alloydb.v1.Backup.getDefaultInstance() : backup_; + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Backup, + com.google.cloud.alloydb.v1.Backup.Builder, + com.google.cloud.alloydb.v1.BackupOrBuilder> + getBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Backup, + com.google.cloud.alloydb.v1.Backup.Builder, + com.google.cloud.alloydb.v1.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new backup is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new backup is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new backup is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000010); + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.UpdateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.UpdateBackupRequest) + private static final com.google.cloud.alloydb.v1.UpdateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.UpdateBackupRequest(); + } + + public static com.google.cloud.alloydb.v1.UpdateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBackupRequest 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.alloydb.v1.UpdateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateBackupRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateBackupRequestOrBuilder.java new file mode 100644 index 000000000000..9b91ae88fa5e --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateBackupRequestOrBuilder.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/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface UpdateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.UpdateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.cloud.alloydb.v1.Backup getBackup(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1.BackupOrBuilder getBackupOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. If set to true, update succeeds even if instance is not found. In
+   * that case, a new backup is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateClusterRequest.java new file mode 100644 index 000000000000..1a7fd7317465 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateClusterRequest.java @@ -0,0 +1,1489 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for updating a Cluster
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.UpdateClusterRequest} + */ +public final class UpdateClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.UpdateClusterRequest) + UpdateClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateClusterRequest.newBuilder() to construct. + private UpdateClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateClusterRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateClusterRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.UpdateClusterRequest.class, + com.google.cloud.alloydb.v1.UpdateClusterRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int CLUSTER_FIELD_NUMBER = 2; + private com.google.cloud.alloydb.v1.Cluster cluster_; + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + @java.lang.Override + public boolean hasCluster() { + return cluster_ != null; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster getCluster() { + return cluster_ == null ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() : cluster_; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the update
+   * request.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_ = false; + /** + * + * + *
+   * Optional. If set to true, update succeeds even if cluster is not found. In
+   * that case, a new cluster is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (cluster_ != null) { + output.writeMessage(2, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (cluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + 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.alloydb.v1.UpdateClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.UpdateClusterRequest other = + (com.google.cloud.alloydb.v1.UpdateClusterRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasCluster() != other.hasCluster()) return false; + if (hasCluster()) { + if (!getCluster().equals(other.getCluster())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) 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 (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasCluster()) { + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.UpdateClusterRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.UpdateClusterRequest 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.alloydb.v1.UpdateClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.UpdateClusterRequest 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.alloydb.v1.UpdateClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.UpdateClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.UpdateClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.UpdateClusterRequest 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.alloydb.v1.UpdateClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.UpdateClusterRequest 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.alloydb.v1.UpdateClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.UpdateClusterRequest 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.alloydb.v1.UpdateClusterRequest 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; + } + /** + * + * + *
+   * Message for updating a Cluster
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.UpdateClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.UpdateClusterRequest) + com.google.cloud.alloydb.v1.UpdateClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.UpdateClusterRequest.class, + com.google.cloud.alloydb.v1.UpdateClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.UpdateClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UpdateClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.UpdateClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UpdateClusterRequest build() { + com.google.cloud.alloydb.v1.UpdateClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UpdateClusterRequest buildPartial() { + com.google.cloud.alloydb.v1.UpdateClusterRequest result = + new com.google.cloud.alloydb.v1.UpdateClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.UpdateClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @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.alloydb.v1.UpdateClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.UpdateClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.UpdateClusterRequest other) { + if (other == com.google.cloud.alloydb.v1.UpdateClusterRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasCluster()) { + mergeCluster(other.getCluster()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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.alloydb.v1.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster, + com.google.cloud.alloydb.v1.Cluster.Builder, + com.google.cloud.alloydb.v1.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.alloydb.v1.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.alloydb.v1.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.alloydb.v1.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCluster() { + bitField0_ = (bitField0_ & ~0x00000002); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster, + com.google.cloud.alloydb.v1.Cluster.Builder, + com.google.cloud.alloydb.v1.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster, + com.google.cloud.alloydb.v1.Cluster.Builder, + com.google.cloud.alloydb.v1.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. If set to true, update succeeds even if cluster is not found. In
+     * that case, a new cluster is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if cluster is not found. In
+     * that case, a new cluster is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if cluster is not found. In
+     * that case, a new cluster is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000010); + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.UpdateClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.UpdateClusterRequest) + private static final com.google.cloud.alloydb.v1.UpdateClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.UpdateClusterRequest(); + } + + public static com.google.cloud.alloydb.v1.UpdateClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateClusterRequest 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.alloydb.v1.UpdateClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateClusterRequestOrBuilder.java new file mode 100644 index 000000000000..86ba4869f2bf --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateClusterRequestOrBuilder.java @@ -0,0 +1,187 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface UpdateClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.UpdateClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.alloydb.v1.Cluster getCluster(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the update
+   * request.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. If set to true, update succeeds even if cluster is not found. In
+   * that case, a new cluster is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateInstanceRequest.java new file mode 100644 index 000000000000..b32621689fb4 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateInstanceRequest.java @@ -0,0 +1,1502 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for updating a Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.UpdateInstanceRequest} + */ +public final class UpdateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.UpdateInstanceRequest) + UpdateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateInstanceRequest.newBuilder() to construct. + private UpdateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateInstanceRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateInstanceRequest(); + } + + @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.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.UpdateInstanceRequest.class, + com.google.cloud.alloydb.v1.UpdateInstanceRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + private com.google.cloud.alloydb.v1.Instance instance_; + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return instance_ != null; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance getInstance() { + return instance_ == null + ? com.google.cloud.alloydb.v1.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.InstanceOrBuilder getInstanceOrBuilder() { + return instance_ == null + ? com.google.cloud.alloydb.v1.Instance.getDefaultInstance() + : instance_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the update
+   * request.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_ = false; + /** + * + * + *
+   * Optional. If set to true, update succeeds even if instance is not found. In
+   * that case, a new instance is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (instance_ != null) { + output.writeMessage(2, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (instance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + 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.alloydb.v1.UpdateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.UpdateInstanceRequest other = + (com.google.cloud.alloydb.v1.UpdateInstanceRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) 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 (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.UpdateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.UpdateInstanceRequest 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.alloydb.v1.UpdateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.UpdateInstanceRequest 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.alloydb.v1.UpdateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.UpdateInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.UpdateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.UpdateInstanceRequest 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.alloydb.v1.UpdateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.UpdateInstanceRequest 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.alloydb.v1.UpdateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.UpdateInstanceRequest 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.alloydb.v1.UpdateInstanceRequest 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; + } + /** + * + * + *
+   * Message for updating a Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.UpdateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.UpdateInstanceRequest) + com.google.cloud.alloydb.v1.UpdateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.UpdateInstanceRequest.class, + com.google.cloud.alloydb.v1.UpdateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.UpdateInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UpdateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.UpdateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UpdateInstanceRequest build() { + com.google.cloud.alloydb.v1.UpdateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UpdateInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1.UpdateInstanceRequest result = + new com.google.cloud.alloydb.v1.UpdateInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.UpdateInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @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.alloydb.v1.UpdateInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.UpdateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.UpdateInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1.UpdateInstanceRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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.alloydb.v1.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance, + com.google.cloud.alloydb.v1.Instance.Builder, + com.google.cloud.alloydb.v1.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.alloydb.v1.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.alloydb.v1.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + } else { + instanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.alloydb.v1.Instance value) { + if (instanceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && instance_ != null + && instance_ != com.google.cloud.alloydb.v1.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); + } else { + instance_ = value; + } + } else { + instanceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + bitField0_ = (bitField0_ & ~0x00000002); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.Instance.Builder getInstanceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.alloydb.v1.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance, + com.google.cloud.alloydb.v1.Instance.Builder, + com.google.cloud.alloydb.v1.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance, + com.google.cloud.alloydb.v1.Instance.Builder, + com.google.cloud.alloydb.v1.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new instance is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new instance is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new instance is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000010); + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.UpdateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.UpdateInstanceRequest) + private static final com.google.cloud.alloydb.v1.UpdateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.UpdateInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1.UpdateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateInstanceRequest 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.alloydb.v1.UpdateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..23dc9afa96a4 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateInstanceRequestOrBuilder.java @@ -0,0 +1,187 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface UpdateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.UpdateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.alloydb.v1.Instance getInstance(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1.InstanceOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the update
+   * request.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. If set to true, update succeeds even if instance is not found. In
+   * that case, a new instance is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UserPassword.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UserPassword.java new file mode 100644 index 000000000000..9002150199d8 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UserPassword.java @@ -0,0 +1,811 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * The username/password for a database user. Used for specifying initial
+ * users at cluster creation time.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.UserPassword} + */ +public final class UserPassword extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.UserPassword) + UserPasswordOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserPassword.newBuilder() to construct. + private UserPassword(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserPassword() { + user_ = ""; + password_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserPassword(); + } + + @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.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_UserPassword_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_UserPassword_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.UserPassword.class, + com.google.cloud.alloydb.v1.UserPassword.Builder.class); + } + + public static final int USER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object user_ = ""; + /** + * + * + *
+   * The database username.
+   * 
+ * + * string user = 1; + * + * @return The user. + */ + @java.lang.Override + public java.lang.String getUser() { + java.lang.Object ref = user_; + 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(); + user_ = s; + return s; + } + } + /** + * + * + *
+   * The database username.
+   * 
+ * + * string user = 1; + * + * @return The bytes for user. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + /** + * + * + *
+   * The initial password for the user.
+   * 
+ * + * string password = 2; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + 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(); + password_ = s; + return s; + } + } + /** + * + * + *
+   * The initial password for the user.
+   * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = 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(user_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, user_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); + } + 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(user_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, user_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); + } + 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.alloydb.v1.UserPassword)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.UserPassword other = (com.google.cloud.alloydb.v1.UserPassword) obj; + + if (!getUser().equals(other.getUser())) return false; + if (!getPassword().equals(other.getPassword())) 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) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.UserPassword parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.UserPassword 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.alloydb.v1.UserPassword parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.UserPassword 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.alloydb.v1.UserPassword parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.UserPassword parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.UserPassword parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.UserPassword 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.alloydb.v1.UserPassword parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.UserPassword 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.alloydb.v1.UserPassword parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.UserPassword 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.alloydb.v1.UserPassword 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 username/password for a database user. Used for specifying initial
+   * users at cluster creation time.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.UserPassword} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.UserPassword) + com.google.cloud.alloydb.v1.UserPasswordOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_UserPassword_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_UserPassword_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.UserPassword.class, + com.google.cloud.alloydb.v1.UserPassword.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.UserPassword.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + user_ = ""; + password_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_UserPassword_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UserPassword getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.UserPassword.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UserPassword build() { + com.google.cloud.alloydb.v1.UserPassword result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UserPassword buildPartial() { + com.google.cloud.alloydb.v1.UserPassword result = + new com.google.cloud.alloydb.v1.UserPassword(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.UserPassword result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.user_ = user_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.password_ = password_; + } + } + + @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.alloydb.v1.UserPassword) { + return mergeFrom((com.google.cloud.alloydb.v1.UserPassword) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.UserPassword other) { + if (other == com.google.cloud.alloydb.v1.UserPassword.getDefaultInstance()) return this; + if (!other.getUser().isEmpty()) { + user_ = other.user_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000002; + 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: + { + user_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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 user_ = ""; + /** + * + * + *
+     * The database username.
+     * 
+ * + * string user = 1; + * + * @return The user. + */ + public java.lang.String getUser() { + java.lang.Object ref = user_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + user_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The database username.
+     * 
+ * + * string user = 1; + * + * @return The bytes for user. + */ + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The database username.
+     * 
+ * + * string user = 1; + * + * @param value The user to set. + * @return This builder for chaining. + */ + public Builder setUser(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The database username.
+     * 
+ * + * string user = 1; + * + * @return This builder for chaining. + */ + public Builder clearUser() { + user_ = getDefaultInstance().getUser(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The database username.
+     * 
+ * + * string user = 1; + * + * @param value The bytes for user to set. + * @return This builder for chaining. + */ + public Builder setUserBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + user_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + /** + * + * + *
+     * The initial password for the user.
+     * 
+ * + * string password = 2; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The initial password for the user.
+     * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The initial password for the user.
+     * 
+ * + * string password = 2; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The initial password for the user.
+     * 
+ * + * string password = 2; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The initial password for the user.
+     * 
+ * + * string password = 2; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000002; + 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.alloydb.v1.UserPassword) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.UserPassword) + private static final com.google.cloud.alloydb.v1.UserPassword DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.UserPassword(); + } + + public static com.google.cloud.alloydb.v1.UserPassword getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserPassword 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.alloydb.v1.UserPassword getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UserPasswordOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UserPasswordOrBuilder.java new file mode 100644 index 000000000000..9d1d6b876b4f --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UserPasswordOrBuilder.java @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public interface UserPasswordOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.UserPassword) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The database username.
+   * 
+ * + * string user = 1; + * + * @return The user. + */ + java.lang.String getUser(); + /** + * + * + *
+   * The database username.
+   * 
+ * + * string user = 1; + * + * @return The bytes for user. + */ + com.google.protobuf.ByteString getUserBytes(); + + /** + * + * + *
+   * The initial password for the user.
+   * 
+ * + * string password = 2; + * + * @return The password. + */ + java.lang.String getPassword(); + /** + * + * + *
+   * The initial password for the user.
+   * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/proto/google/cloud/alloydb/v1/resources.proto b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/proto/google/cloud/alloydb/v1/resources.proto new file mode 100644 index 000000000000..86885370d5e0 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/proto/google/cloud/alloydb/v1/resources.proto @@ -0,0 +1,945 @@ +// 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.alloydb.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1"; +option go_package = "cloud.google.com/go/alloydb/apiv1/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.cloud.alloydb.v1"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1"; +option ruby_package = "Google::Cloud::AlloyDb::V1"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; + +// The supported database engine versions. +enum DatabaseVersion { + // This is an unknown database version. + DATABASE_VERSION_UNSPECIFIED = 0; + + // DEPRECATED - The database version is Postgres 13. + POSTGRES_13 = 1 [deprecated = true]; + + // The database version is Postgres 14. + POSTGRES_14 = 2; +} + +// View on Instance. Pass this enum to rpcs that returns an Instance message to +// control which subsets of fields to get. +enum InstanceView { + // INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + INSTANCE_VIEW_UNSPECIFIED = 0; + + // BASIC server responses for a primary or read instance include all the + // relevant instance details, excluding the details of each node in the + // instance. The default value. + INSTANCE_VIEW_BASIC = 1; + + // FULL response is equivalent to BASIC for primary instance (for now). + // For read pool instance, this includes details of each node in the pool. + INSTANCE_VIEW_FULL = 2; +} + +// The username/password for a database user. Used for specifying initial +// users at cluster creation time. +message UserPassword { + // The database username. + string user = 1; + + // The initial password for the user. + string password = 2; +} + +// Subset of the source instance configuration that is available when reading +// the cluster resource. +message MigrationSource { + // Denote the type of migration source that created this cluster. + enum MigrationSourceType { + // Migration source is unknown. + MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + + // DMS source means the cluster was created via DMS migration job. + DMS = 1; + } + + // Output only. The host and port of the on-premises instance in host:port + // format + string host_port = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Place holder for the external source identifier(e.g DMS job + // name) that created the cluster. + string reference_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Type of migration source. + MigrationSourceType source_type = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// EncryptionConfig describes the encryption config of a cluster or a backup +// that is encrypted with a CMEK (customer-managed encryption key). +message EncryptionConfig { + // The fully-qualified resource name of the KMS key. + // Each Cloud KMS key is regionalized and has the following format: + // projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + string kms_key_name = 1; +} + +// EncryptionInfo describes the encryption information of a cluster or a backup. +message EncryptionInfo { + // Possible encryption types. + enum Type { + // Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. + TYPE_UNSPECIFIED = 0; + + // The data is encrypted at rest with a key that is fully managed by Google. + // No key version will be populated. This is the default state. + GOOGLE_DEFAULT_ENCRYPTION = 1; + + // The data is encrypted at rest with a key that is managed by the customer. + // KMS key versions will be populated. + CUSTOMER_MANAGED_ENCRYPTION = 2; + } + + // Output only. Type of encryption. + Type encryption_type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud KMS key versions that are being used to protect the + // database or the backup. + repeated string kms_key_versions = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// SSL configuration for an AlloyDB Cluster. +message SslConfig { + // SSL mode options. + enum SslMode { + // SSL mode not specified. Defaults to SSL_MODE_ALLOW. + SSL_MODE_UNSPECIFIED = 0; + + // SSL connections are optional. CA verification not enforced. + SSL_MODE_ALLOW = 1; + + // SSL connections are required. CA verification not enforced. + // Clients may use locally self-signed certificates (default psql client + // behavior). + SSL_MODE_REQUIRE = 2; + + // SSL connections are required. CA verification enforced. + // Clients must have certificates signed by a Cluster CA, e.g. via + // GenerateClientCertificate. + SSL_MODE_VERIFY_CA = 3; + } + + // Certificate Authority (CA) source for SSL/TLS certificates. + enum CaSource { + // Certificate Authority (CA) source not specified. Defaults to + // CA_SOURCE_MANAGED. + CA_SOURCE_UNSPECIFIED = 0; + + // Certificate Authority (CA) managed by the AlloyDB Cluster. + CA_SOURCE_MANAGED = 1; + } + + // Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + SslMode ssl_mode = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + // supported currently, and is the default value. + CaSource ca_source = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message describing the user-specified automated backup policy. +// +// All fields in the automated backup policy are optional. Defaults for each +// field are provided if they are not set. +message AutomatedBackupPolicy { + // A weekly schedule starts a backup at prescribed start times within a + // day, for the specified days of the week. + // + // The weekly schedule message is flexible and can be used to create many + // types of schedules. For example, to have a daily backup that starts at + // 22:00, configure the `start_times` field to have one element "22:00" and + // the `days_of_week` field to have all seven days of the week. + message WeeklySchedule { + // The times during the day to start a backup. The start times are assumed + // to be in UTC and to be an exact hour (e.g., 04:00:00). + // + // If no start times are provided, a single fixed start time is chosen + // arbitrarily. + repeated google.type.TimeOfDay start_times = 1; + + // The days of the week to perform a backup. + // + // If this field is left empty, the default of every day of the week is + // used. + repeated google.type.DayOfWeek days_of_week = 2; + } + + // A time based retention policy specifies that all backups within a certain + // time period should be retained. + message TimeBasedRetention { + // The retention period. + google.protobuf.Duration retention_period = 1; + } + + // A quantity based policy specifies that a certain number of the most recent + // successful backups should be retained. + message QuantityBasedRetention { + // The number of backups to retain. + int32 count = 1; + } + + // The schedule for this automated backup policy. + // + // A schedule specifies times at which to start a backup. If a backup + // window is also provided, the backup is guaranteed to be started and + // completed within the start time plus the backup window. If the backup is + // not completed within the backup window it is marked as failed. + // + // If not set, the schedule defaults to a weekly schedule with one backup + // per day and a start time chosen arbitrarily. + oneof schedule { + // Weekly schedule for the Backup. + WeeklySchedule weekly_schedule = 2; + } + + // The retention policy for automated backups. + // + // The retention policy for a backup is fixed at the time the backup is + // created. Changes to this field only apply to new backups taken with the + // policy; the retentions of existing backups remain unchanged. + // + // If no retention policy is set, a default of 14 days is used. + oneof retention { + // Time-based Backup retention policy. + TimeBasedRetention time_based_retention = 4; + + // Quantity-based Backup retention policy to retain recent backups. + QuantityBasedRetention quantity_based_retention = 5; + } + + // Whether automated automated backups are enabled. If not set, defaults to + // true. + optional bool enabled = 1; + + // The length of the time window during which a backup can be + // taken. If a backup does not succeed within this time window, it will be + // canceled and considered failed. + // + // The backup window must be at least 5 minutes long. There is no upper bound + // on the window. If not set, it defaults to 1 hour. + google.protobuf.Duration backup_window = 3; + + // Optional. The encryption config can be specified to encrypt the + // backups with a customer-managed encryption key (CMEK). When this field is + // not specified, the backup will then use default encryption scheme to + // protect the user data. + EncryptionConfig encryption_config = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // The location where the backup will be stored. Currently, the only supported + // option is to store the backup in the same region as the cluster. + // + // If empty, defaults to the region of the cluster. + string location = 6; + + // Labels to apply to backups created using this configuration. + map labels = 7; +} + +// Message describing a BackupSource. +message BackupSource { + // Output only. The system-generated UID of the backup which was used to + // create this resource. The UID is generated when the backup is created, and + // it is retained until the backup is deleted. + string backup_uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The name of the backup resource with the format: + // * projects/{project}/locations/{region}/backups/{backup_id} + string backup_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; +} + +// A cluster is a collection of regional AlloyDB resources. It can include a +// primary instance and one or more read pool instances. +// All cluster resources share a storage layer, which scales as needed. +message Cluster { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Cluster" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}" + style: DECLARATIVE_FRIENDLY + }; + + // Configuration information for the secondary cluster. This should be set + // if and only if the cluster is of type SECONDARY. + message SecondaryConfig { + // The name of the primary cluster name with the format: + // * projects/{project}/locations/{region}/clusters/{cluster_id} + string primary_cluster_name = 1; + } + + // Configuration for the primary cluster. It has the list of clusters that are + // replicating from this cluster. This should be set if and only if the + // cluster is of type PRIMARY. + message PrimaryConfig { + // Output only. Names of the clusters that are replicating from this + // cluster. + repeated string secondary_cluster_names = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Cluster State + enum State { + // The state of the cluster is unknown. + STATE_UNSPECIFIED = 0; + + // The cluster is active and running. + READY = 1; + + // The cluster is stopped. All instances in the cluster are stopped. + // Customers can start a stopped cluster at any point and all their + // instances will come back to life with same names and IP resources. In + // this state, customer pays for storage. + // Associated backups could also be present in a stopped cluster. + STOPPED = 2; + + // The cluster is empty and has no associated resources. + // All instances, associated storage and backups have been deleted. + EMPTY = 3; + + // The cluster is being created. + CREATING = 4; + + // The cluster is being deleted. + DELETING = 5; + + // The creation of the cluster failed. + FAILED = 6; + + // The cluster is bootstrapping with data from some other source. + // Direct mutations to the cluster (e.g. adding read pool) are not allowed. + BOOTSTRAPPING = 7; + + // The cluster is under maintenance. AlloyDB regularly performs maintenance + // and upgrades on customer clusters. Updates on the cluster are + // not allowed while the cluster is in this state. + MAINTENANCE = 8; + + // The cluster is being promoted. + PROMOTING = 9; + } + + // Type of Cluster + enum ClusterType { + // The type of the cluster is unknown. + CLUSTER_TYPE_UNSPECIFIED = 0; + + // Primary cluster that support read and write operations. + PRIMARY = 1; + + // Secondary cluster that is replicating from another region. + // This only supports read. + SECONDARY = 2; + } + + // In case of an imported cluster, this field contains information about the + // source this cluster was imported from. + oneof source { + // Output only. Cluster created from backup. + BackupSource backup_source = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cluster created via DMS migration. + MigrationSource migration_source = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The name of the cluster resource with the format: + // * projects/{project}/locations/{region}/clusters/{cluster_id} + // where the cluster ID segment should satisfy the regex expression + // `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + // The prefix of the cluster resource name is the name of the parent resource: + // * projects/{project}/locations/{region} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Cluster. + string display_name = 2; + + // Output only. The system-generated UID of the resource. The UID is assigned + // when the resource is created, and it is retained until it is deleted. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 7; + + // Output only. The current serving state of the cluster. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of the cluster. This is an output-only field and it's + // populated at the Cluster creation time or the Cluster promotion + // time. The cluster type is determined by which RPC was used to create + // the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + ClusterType cluster_type = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The database engine major version. This is an output-only + // field and it's populated at the Cluster creation time. This field cannot be + // changed after cluster creation. + DatabaseVersion database_version = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The resource link for the VPC network in which cluster resources + // are created and from which they are accessible via Private IP. The network + // must belong to the same project as the cluster. It is specified in the + // form: "projects/{project_number}/global/networks/{network_id}". This is + // required to create a cluster. It can be updated, but it cannot be removed. + string network = 10 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 11; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 12; + + // Output only. Reconciling (https://google.aip.dev/128#reconciliation). + // Set to true if the current state of Cluster does not match the user's + // intended state, and the service is actively updating the resource to + // reconcile them. This can happen due to user-triggered updates or + // system actions like failover or maintenance. + bool reconciling = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Initial user to setup during cluster creation. Required. + // If used in `RestoreCluster` this is ignored. + UserPassword initial_user = 14 [(google.api.field_behavior) = INPUT_ONLY]; + + // The automated backup policy for this cluster. + // + // If no policy is provided then the default policy will be used. If backups + // are supported for the cluster, the default policy takes one backup a day, + // has a backup window of 1 hour, and retains backups for 14 days. + // For more information on the defaults, consult the + // documentation for the message type. + AutomatedBackupPolicy automated_backup_policy = 17; + + // SSL configuration for this AlloyDB Cluster. + SslConfig ssl_config = 18; + + // Optional. The encryption config can be specified to encrypt the data disks + // and other persistent data resources of a cluster with a + // customer-managed encryption key (CMEK). When this field is not + // specified, the cluster will then use default encryption scheme to + // protect the user data. + EncryptionConfig encryption_config = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The encryption information for the cluster. + EncryptionInfo encryption_info = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cross Region replication config specific to SECONDARY cluster. + SecondaryConfig secondary_config = 22; + + // Output only. Cross Region replication config specific to PRIMARY cluster. + PrimaryConfig primary_config = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// An Instance is a computing unit that an end customer can connect to. +// It's the main unit of computing resources in AlloyDB. +message Instance { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}" + style: DECLARATIVE_FRIENDLY + }; + + // MachineConfig describes the configuration of a machine. + message MachineConfig { + // The number of CPU's in the VM instance. + int32 cpu_count = 1; + } + + // Details of a single node in the instance. + // Nodes in an AlloyDB instance are ephemereal, they can change during + // update, failover, autohealing and resize operations. + message Node { + // The Compute Engine zone of the VM e.g. "us-central1-b". + string zone_id = 1; + + // The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + string id = 2; + + // The private IP address of the VM e.g. "10.57.0.34". + string ip = 3; + + // Determined by state of the compute VM and postgres-service health. + // Compute VM state can have values listed in + // https://cloud.google.com/compute/docs/instances/instance-life-cycle and + // postgres-service health can have values: HEALTHY and UNHEALTHY. + string state = 4; + } + + // QueryInsights Instance specific configuration. + message QueryInsightsInstanceConfig { + // Record application tags for an instance. + // This flag is turned "on" by default. + optional bool record_application_tags = 2; + + // Record client address for an instance. Client address is PII information. + // This flag is turned "on" by default. + optional bool record_client_address = 3; + + // Query string length. The default value is 1024. + // Any integer between 256 and 4500 is considered valid. + uint32 query_string_length = 4; + + // Number of query execution plans captured by Insights per minute + // for all queries combined. The default value is 5. + // Any integer between 0 and 20 is considered valid. + optional uint32 query_plans_per_minute = 5; + } + + // Configuration for a read pool instance. + message ReadPoolConfig { + // Read capacity, i.e. number of nodes in a read pool instance. + int32 node_count = 1; + } + + // Instance State + enum State { + // The state of the instance is unknown. + STATE_UNSPECIFIED = 0; + + // The instance is active and running. + READY = 1; + + // The instance is stopped. Instance name and IP resources are preserved. + STOPPED = 2; + + // The instance is being created. + CREATING = 3; + + // The instance is being deleted. + DELETING = 4; + + // The instance is down for maintenance. + MAINTENANCE = 5; + + // The creation of the instance failed or a fatal error occurred during + // an operation on the instance. + // Note: Instances in this state would tried to be auto-repaired. And + // Customers should be able to restart, update or delete these instances. + FAILED = 6; + + // Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that + // index unused in case that state also needs to exposed via consumer apis + // in future. + // The instance has been configured to sync data from some other source. + BOOTSTRAPPING = 8; + + // The instance is being promoted. + PROMOTING = 9; + } + + // Type of an Instance + enum InstanceType { + // The type of the instance is unknown. + INSTANCE_TYPE_UNSPECIFIED = 0; + + // PRIMARY instances support read and write operations. + PRIMARY = 1; + + // READ POOL instances support read operations only. Each read pool instance + // consists of one or more homogeneous nodes. + // * Read pool of size 1 can only have zonal availability. + // * Read pools with node count of 2 or more can have regional + // availability (nodes are present in 2 or more zones in a region). + READ_POOL = 2; + + // SECONDARY instances support read operations only. SECONDARY instance + // is a cross-region read replica + SECONDARY = 3; + } + + // The Availability type of an instance. Potential values: + //
ZONAL: The instance serves data from only one zone. + // Outages in that zone affect instance availability. + //
REGIONAL: The instance can serve data from more than one zone + // in a region (it is highly available). + enum AvailabilityType { + // This is an unknown Availability type. + AVAILABILITY_TYPE_UNSPECIFIED = 0; + + // Zonal available instance. + ZONAL = 1; + + // Regional (or Highly) available instance. + REGIONAL = 2; + } + + // Output only. The name of the instance resource with the format: + // * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} + // where the cluster and instance ID segments should satisfy the regex + // expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + // lowercase letters, numbers, and dashes, starting with a letter, and ending + // with a letter or number. For more details see https://google.aip.dev/122. + // The prefix of the instance resource name is the name of the parent + // resource: + // * projects/{project}/locations/{region}/clusters/{cluster_id} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Instance. + string display_name = 2; + + // Output only. The system-generated UID of the resource. The UID is assigned + // when the resource is created, and it is retained until it is deleted. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 7; + + // Output only. The current serving state of the instance. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The type of the instance. Specified at creation time. + InstanceType instance_type = 9 [(google.api.field_behavior) = REQUIRED]; + + // Configurations for the machines that host the underlying + // database engine. + MachineConfig machine_config = 10; + + // Availability type of an Instance. + // Defaults to REGIONAL for both primary and read instances. + // Note that primary and read instances can have different availability types. + AvailabilityType availability_type = 11; + + // The Compute Engine zone that the instance should serve from, per + // https://cloud.google.com/compute/docs/regions-zones + // This can ONLY be specified for ZONAL instances. + // If present for a REGIONAL instance, an error will be thrown. + // If this is absent for a ZONAL instance, instance is created in a random + // zone with available capacity. + string gce_zone = 12; + + // Database flags. Set at instance level. + // * They are copied from primary instance on read instance creation. + // * Read instances can set new or override existing flags that are relevant + // for reads, e.g. for enabling columnar cache on a read instance. Flags + // set on read instance may or may not be present on primary. + // + // + // This is a list of "key": "value" pairs. + // "key": The name of the flag. These flags are passed at instance setup time, + // so include both server options and system variables for Postgres. Flags are + // specified with underscores, not hyphens. + // "value": The value of the flag. Booleans are set to **on** for true + // and **off** for false. This field must be omitted if the flag + // doesn't take a value. + map database_flags = 13; + + // Output only. This is set for the read-write VM of the PRIMARY instance + // only. + Node writable_node = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of available read-only VMs in this instance, including + // the standby for a PRIMARY instance. + repeated Node nodes = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration for query insights. + QueryInsightsInstanceConfig query_insights_config = 21; + + // Read pool specific config. + ReadPoolConfig read_pool_config = 14; + + // Output only. The IP address for the Instance. + // This is the connection endpoint for an end-user application. + string ip_address = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reconciling (https://google.aip.dev/128#reconciliation). + // Set to true if the current state of Instance does not match the user's + // intended state, and the service is actively updating the resource to + // reconcile them. This can happen due to user-triggered updates or + // system actions like failover or maintenance. + bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 17; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 18; +} + +// Message describing Backup object +message Backup { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backups/{backup}" + style: DECLARATIVE_FRIENDLY + }; + + // Backup State + enum State { + // The state of the backup is unknown. + STATE_UNSPECIFIED = 0; + + // The backup is ready. + READY = 1; + + // The backup is creating. + CREATING = 2; + + // The backup failed. + FAILED = 3; + + // The backup is being deleted. + DELETING = 4; + } + + // Backup Type + enum Type { + // Backup Type is unknown. + TYPE_UNSPECIFIED = 0; + + // ON_DEMAND backups that were triggered by the customer (e.g., not + // AUTOMATED). + ON_DEMAND = 1; + + // AUTOMATED backups triggered by the automated backups scheduler pursuant + // to an automated backup policy. + AUTOMATED = 2; + + // CONTINUOUS backups triggered by the automated backups scheduler + // due to a continuous backup policy. + CONTINUOUS = 3; + } + + // Output only. The name of the backup resource with the format: + // * projects/{project}/locations/{region}/backups/{backup_id} + // where the cluster and backup ID segments should satisfy the regex + // expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + // lowercase letters, numbers, and dashes, starting with a letter, and ending + // with a letter or number. For more details see https://google.aip.dev/122. + // The prefix of the backup resource name is the name of the parent + // resource: + // * projects/{project}/locations/{region} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Backup. + string display_name = 2; + + // Output only. The system-generated UID of the resource. The UID is assigned + // when the resource is created, and it is retained until it is deleted. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 6; + + // Output only. The current state of the backup. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The backup type, which suggests the trigger for the backup. + Type type = 8; + + // User-provided description of the backup. + string description = 9; + + // Output only. The system-generated UID of the cluster which was used to + // create this resource. + string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The full resource name of the backup source cluster + // (e.g., projects//locations//clusters/). + string cluster_name = 10 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + // true, indicates that the service is actively updating the resource. This + // can happen due to user-triggered updates or system actions like failover or + // maintenance. + bool reconciling = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The encryption config can be specified to encrypt the + // backup with a customer-managed encryption key (CMEK). When this field is + // not specified, the backup will then use default encryption scheme to + // protect the user data. + EncryptionConfig encryption_config = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The encryption information for the backup. + EncryptionInfo encryption_info = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 14; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 16; + + // Output only. The size of the backup in bytes. + int64 size_bytes = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which after the backup is eligible to be garbage + // collected. It is the duration specified by the backup's retention policy, + // added to the backup's create_time. + google.protobuf.Timestamp expiry_time = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// SupportedDatabaseFlag gives general information about a database flag, +// like type and allowed values. This is a static value that is defined +// on the server side, and it cannot be modified by callers. +// To set the Database flags on a particular Instance, a caller should modify +// the Instance.database_flags field. +message SupportedDatabaseFlag { + option (google.api.resource) = { + type: "alloydb.googleapis.com/SupportedDatabaseFlag" + pattern: "projects/{project}/locations/{location}/flags/{flag}" + }; + + // Restrictions on STRING type values + message StringRestrictions { + // The list of allowed values, if bounded. This field will be empty + // if there is a unbounded number of allowed values. + repeated string allowed_values = 1; + } + + // Restrictions on INTEGER type values. + message IntegerRestrictions { + // The minimum value that can be specified, if applicable. + google.protobuf.Int64Value min_value = 1; + + // The maximum value that can be specified, if applicable. + google.protobuf.Int64Value max_value = 2; + } + + // ValueType describes the semantic type of the value that the flag accepts. + // Regardless of the ValueType, the Instance.database_flags field accepts the + // stringified version of the value, i.e. "20" or "3.14". + enum ValueType { + // This is an unknown flag type. + VALUE_TYPE_UNSPECIFIED = 0; + + // String type flag. + STRING = 1; + + // Integer type flag. + INTEGER = 2; + + // Float type flag. + FLOAT = 3; + + // Denotes that the flag does not accept any values. + NONE = 4; + } + + // The restrictions on the flag value per type. + oneof restrictions { + // Restriction on STRING type value. + StringRestrictions string_restrictions = 7; + + // Restriction on INTEGER type value. + IntegerRestrictions integer_restrictions = 8; + } + + // The name of the flag resource, following Google Cloud conventions, e.g.: + // * projects/{project}/locations/{location}/flags/{flag} + // This field currently has no semantic meaning. + string name = 1; + + // The name of the database flag, e.g. "max_allowed_packets". + // The is a possibly key for the Instance.database_flags map field. + string flag_name = 2; + + ValueType value_type = 3; + + // Whether the database flag accepts multiple values. If true, + // a comma-separated list of stringified values may be specified. + bool accepts_multiple_values = 4; + + // Major database engine versions for which this flag is supported. + repeated DatabaseVersion supported_db_versions = 5; + + // Whether setting or updating this flag on an Instance requires a database + // restart. If a flag that requires database restart is set, the backend + // will automatically restart the database (making sure to satisfy any + // availability SLO's). + bool requires_db_restart = 6; +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/proto/google/cloud/alloydb/v1/service.proto b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/proto/google/cloud/alloydb/v1/service.proto new file mode 100644 index 000000000000..faba39ad82c3 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/proto/google/cloud/alloydb/v1/service.proto @@ -0,0 +1,1072 @@ +// 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.alloydb.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/alloydb/v1/resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1"; +option go_package = "cloud.google.com/go/alloydb/apiv1/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.alloydb.v1"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1"; +option ruby_package = "Google::Cloud::AlloyDb::V1"; + +// Service describing handlers for resources +service AlloyDBAdmin { + option (google.api.default_host) = "alloydb.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Clusters in a given project and location. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/clusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Cluster in a given project and location. + rpc CreateCluster(CreateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/clusters" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Cluster. + rpc UpdateCluster(UpdateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{cluster.name=projects/*/locations/*/clusters/*}" + body: "cluster" + }; + option (google.api.method_signature) = "cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Cluster. + rpc DeleteCluster(DeleteClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new Cluster in a given project and location, with a volume + // restored from the provided source, either a backup ID or a point-in-time + // and a source cluster. + rpc RestoreCluster(RestoreClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/clusters:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Lists Instances in a given project and location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/clusters/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Instance in a given project and location. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/clusters/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Creates new instances under the given project, location and cluster. + // There can be only one primary instance in a cluster. If the primary + // instance exists in the cluster as well as this request, then API will + // throw an error. + // The primary instance should exist before any read pool instance is + // created. If the primary instance is a part of the request payload, then + // the API will take care of creating instances in the correct order. + // This method is here to support Google-internal use cases, and is not meant + // for external customers to consume. Please do not start relying on it; its + // behavior is subject to change without notice. + rpc BatchCreateInstances(BatchCreateInstancesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate" + body: "requests" + }; + option (google.longrunning.operation_info) = { + response_type: "BatchCreateInstancesResponse" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Instance. + rpc UpdateInstance(UpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{instance.name=projects/*/locations/*/clusters/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Instance. + rpc DeleteInstance(DeleteInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Forces a Failover for a highly available instance. + // Failover promotes the HA standby instance as the new primary. + // Imperative only. + rpc FailoverInstance(FailoverInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:failover" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Restart an Instance in a cluster. + // Imperative only. + rpc RestartInstance(RestartInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:restart" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Lists Backups in a given project and location. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Backup in a given project and location. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup,backup_id"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Backup. + rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{backup.name=projects/*/locations/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists SupportedDatabaseFlags for a given project and location. + rpc ListSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest) + returns (ListSupportedDatabaseFlagsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/supportedDatabaseFlags" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Message for requesting list of Clusters +message ListClustersRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Cluster.name field. Additionally, you can perform an + // aggregated list operation by specifying a value with the following format: + // * projects/{project}/locations/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Clusters +message ListClustersResponse { + // The list of Cluster + repeated Cluster clusters = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Cluster +message GetClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; +} + +// Message for creating a Cluster +message CreateClusterRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the create + // request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Cluster +message UpdateClusterRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Cluster resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Cluster cluster = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the update + // request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, update succeeds even if cluster is not found. In + // that case, a new cluster is created and `update_mask` is ignored. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Cluster +message DeleteClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the Cluster. + // If an etag is provided and does not match the current etag of the Cluster, + // deletion will be blocked and an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to cascade delete child instances for given cluster. + bool force = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for restoring a Cluster from a backup or another cluster at a given +// point in time. +message RestoreClusterRequest { + // Required. + // The source to import from. + oneof source { + // Backup source. + BackupSource backup_source = 4; + } + + // Required. The name of the parent resource. For the required format, see the + // comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the import + // request. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Instances +message ListInstancesRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. Additionally, you can perform an + // aggregated list operation by specifying a value with one of the following + // formats: + // * projects/{project}/locations/-/clusters/- + // * projects/{project}/locations/{region}/clusters/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Instances +message ListInstancesResponse { + // The list of Instance + repeated Instance instances = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Instance +message GetInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // The view of the instance to return. + InstanceView view = 2; +} + +// Message for creating a Instance +message CreateInstanceRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. ID of the requesting object. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the create + // request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// See usage below for notes. +message CreateInstanceRequests { + // Required. Primary and read replica instances to be created. This list + // should not be empty. + repeated CreateInstanceRequest create_instance_requests = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Message for creating a batch of instances under the specified cluster. +message BatchCreateInstancesRequest { + // Required. The name of the parent resource. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. Resources being created. + CreateInstanceRequests requests = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating batches of instances in a cluster. +message BatchCreateInstancesResponse { + // Created instances. + repeated Instance instances = 1; +} + +// Message for metadata that is specific to BatchCreateInstances API. +message BatchCreateInstancesMetadata { + // The instances being created in the API call. Each string in this list + // is the server defined resource path for target instances in the request + // and for the format of each string, see the comment on the Instance.name + // field. + repeated string instance_targets = 1; + + // A map representing state of the instances involved in the + // BatchCreateInstances operation during the operation execution. + // The instance state will be in STATE_UNSPECIFIED state if the instance has + // not yet been picked up for processing. + // The key of the map is the name of the instance resource. + // For the format, see the comment on the Instance.name field. + map instance_statuses = 2; +} + +// Message for current status of an instance in the BatchCreateInstances +// operation. +// For example, lets say a BatchCreateInstances workflow has 4 instances, +// Instance1 through Instance4. Lets also assume that 2 instances succeeded +// but the third failed to create and the 4th was never picked up for creation +// because of failure of the previous one. Then, resulting states would look +// something like: +// 1. Instance1 = ROLLED_BACK +// 2. Instance2 = ROLLED_BACK +// 3. Instance3 = FAILED +// 4. Instance4 = FAILED +// However, while the operation is running, the instance might be in other +// states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states +// / do not get further updated once the operation is done. +message BatchCreateInstanceStatus { + // State contains all valid instance states for the BatchCreateInstances + // operation. This is mainly used for status reporting through the LRO + // metadata. + enum State { + // The state of the instance is unknown. + STATE_UNSPECIFIED = 0; + + // Instance is pending creation and has not yet been picked up for + // processsing in the backend. + PENDING_CREATE = 1; + + // The instance is active and running. + READY = 2; + + // The instance is being created. + CREATING = 3; + + // The instance is being deleted. + DELETING = 4; + + // The creation of the instance failed or a fatal error occurred during + // an operation on the instance or a batch of instances. + FAILED = 5; + + // The instance was created successfully, but was rolled back and deleted + // due to some other failure during BatchCreateInstances operation. + ROLLED_BACK = 6; + } + + // The current state of an instance involved in the batch create operation. + // Once the operation is complete, the final state of the instances in the + // LRO can be one of: + // 1. ACTIVE, indicating that instances were created successfully + // 2. FAILED, indicating that a particular instance failed creation + // 3. ROLLED_BACK indicating that although the instance was created + // successfully, it had to be rolled back and deleted due to failure in + // other steps of the workflow. + State state = 1; + + // DEPRECATED - Use the error field instead. + // Error, if any error occurred and is available, during instance creation. + string error_msg = 2; + + // The RPC status of the instance creation operation. This field will be + // present if an error happened during the instance creation. + google.rpc.Status error = 4; + + Instance.InstanceType type = 3; +} + +// Message for updating a Instance +message UpdateInstanceRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Instance resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the update + // request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, update succeeds even if instance is not found. In + // that case, a new instance is created and `update_mask` is ignored. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Instance +message DeleteInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the Instance. + // If an etag is provided and does not match the current etag of the Instance, + // deletion will be blocked and an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for triggering failover on an Instance +message FailoverInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the failover. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +message RestartInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the restart. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Backups +message ListBackupsRequest { + // Required. Parent value for ListBackupsRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Backup" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results + string filter = 4; + + // Hint for how to order the results + string order_by = 5; +} + +// Message for response to listing Backups +message ListBackupsResponse { + // The list of Backup + repeated Backup backups = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Backup +message GetBackupRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; +} + +// Message for creating a Backup +message CreateBackupRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Backup" + } + ]; + + // Required. ID of the requesting object. + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Backup +message UpdateBackupRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Backup resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, update succeeds even if instance is not found. In + // that case, a new backup is created and `update_mask` is ignored. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Backup +message DeleteBackupRequest { + // Required. Name of the resource. For the required format, see the comment on + // the Backup.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the Backup. + // If an etag is provided and does not match the current etag of the Backup, + // deletion will be blocked and an ABORTED error will be returned. + string etag = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for listing the information about the supported Database flags. +message ListSupportedDatabaseFlagsRequest { + // Required. The name of the parent resource. The required format is: + // * projects/{project}/locations/{location} + // + // Regardless of the parent specified here, as long it is contains a valid + // project and location, the service will return a static list of supported + // flags resources. Note that we do not yet support region-specific + // flags. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/SupportedDatabaseFlag" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; +} + +// Message for response to listing SupportedDatabaseFlags. +message ListSupportedDatabaseFlagsResponse { + // The list of SupportedDatabaseFlags. + repeated SupportedDatabaseFlag supported_database_flags = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Request specific metadata, if any. + oneof request_specific { + // Output only. BatchCreateInstances related metadata. + BatchCreateInstancesMetadata batch_create_instances_metadata = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/clirr-ignored-differences.xml b/java-alloydb/proto-google-cloud-alloydb-v1alpha/clirr-ignored-differences.xml new file mode 100644 index 000000000000..3e79e69d483c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/alloydb/v1alpha/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/alloydb/v1alpha/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/alloydb/v1alpha/*OrBuilder + boolean has*(*) + + diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/pom.xml b/java-alloydb/proto-google-cloud-alloydb-v1alpha/pom.xml new file mode 100644 index 000000000000..fd2b92baa250 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-alloydb-v1alpha + 0.0.1-SNAPSHOT + proto-google-cloud-alloydb-v1alpha + Proto library for google-cloud-alloydb + + com.google.cloud + google-cloud-alloydb-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-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/AutomatedBackupPolicy.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/AutomatedBackupPolicy.java new file mode 100644 index 000000000000..016b448f64ed --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/AutomatedBackupPolicy.java @@ -0,0 +1,5849 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message describing the user-specified automated backup policy.
+ * All fields in the automated backup policy are optional. Defaults for each
+ * field are provided if they are not set.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} + */ +public final class AutomatedBackupPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy) + AutomatedBackupPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use AutomatedBackupPolicy.newBuilder() to construct. + private AutomatedBackupPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AutomatedBackupPolicy() { + location_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AutomatedBackupPolicy(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.class, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.Builder.class); + } + + public interface WeeklyScheduleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + java.util.List getStartTimesList(); + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + com.google.type.TimeOfDay getStartTimes(int index); + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + int getStartTimesCount(); + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + java.util.List getStartTimesOrBuilderList(); + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + com.google.type.TimeOfDayOrBuilder getStartTimesOrBuilder(int index); + + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the daysOfWeek. + */ + java.util.List getDaysOfWeekList(); + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return The count of daysOfWeek. + */ + int getDaysOfWeekCount(); + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the element to return. + * @return The daysOfWeek at the given index. + */ + com.google.type.DayOfWeek getDaysOfWeek(int index); + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the enum numeric values on the wire for daysOfWeek. + */ + java.util.List getDaysOfWeekValueList(); + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of daysOfWeek at the given index. + */ + int getDaysOfWeekValue(int index); + } + /** + * + * + *
+   * A weekly schedule starts a backup at prescribed start times within a
+   * day, for the specified days of the week.
+   * The weekly schedule message is flexible and can be used to create many
+   * types of schedules. For example, to have a daily backup that starts at
+   * 22:00, configure the `start_times` field to have one element "22:00" and
+   * the `days_of_week` field to have all seven days of the week.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} + */ + public static final class WeeklySchedule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) + WeeklyScheduleOrBuilder { + private static final long serialVersionUID = 0L; + // Use WeeklySchedule.newBuilder() to construct. + private WeeklySchedule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WeeklySchedule() { + startTimes_ = java.util.Collections.emptyList(); + daysOfWeek_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WeeklySchedule(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_WeeklySchedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_WeeklySchedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.class, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.Builder.class); + } + + public static final int START_TIMES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List startTimes_; + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + @java.lang.Override + public java.util.List getStartTimesList() { + return startTimes_; + } + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + @java.lang.Override + public java.util.List + getStartTimesOrBuilderList() { + return startTimes_; + } + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + @java.lang.Override + public int getStartTimesCount() { + return startTimes_.size(); + } + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + @java.lang.Override + public com.google.type.TimeOfDay getStartTimes(int index) { + return startTimes_.get(index); + } + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + @java.lang.Override + public com.google.type.TimeOfDayOrBuilder getStartTimesOrBuilder(int index) { + return startTimes_.get(index); + } + + public static final int DAYS_OF_WEEK_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List daysOfWeek_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.type.DayOfWeek> + daysOfWeek_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.type.DayOfWeek>() { + public com.google.type.DayOfWeek convert(java.lang.Integer from) { + com.google.type.DayOfWeek result = com.google.type.DayOfWeek.forNumber(from); + return result == null ? com.google.type.DayOfWeek.UNRECOGNIZED : result; + } + }; + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the daysOfWeek. + */ + @java.lang.Override + public java.util.List getDaysOfWeekList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.type.DayOfWeek>(daysOfWeek_, daysOfWeek_converter_); + } + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return The count of daysOfWeek. + */ + @java.lang.Override + public int getDaysOfWeekCount() { + return daysOfWeek_.size(); + } + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the element to return. + * @return The daysOfWeek at the given index. + */ + @java.lang.Override + public com.google.type.DayOfWeek getDaysOfWeek(int index) { + return daysOfWeek_converter_.convert(daysOfWeek_.get(index)); + } + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the enum numeric values on the wire for daysOfWeek. + */ + @java.lang.Override + public java.util.List getDaysOfWeekValueList() { + return daysOfWeek_; + } + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of daysOfWeek at the given index. + */ + @java.lang.Override + public int getDaysOfWeekValue(int index) { + return daysOfWeek_.get(index); + } + + private int daysOfWeekMemoizedSerializedSize; + + 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(); + for (int i = 0; i < startTimes_.size(); i++) { + output.writeMessage(1, startTimes_.get(i)); + } + if (getDaysOfWeekList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(daysOfWeekMemoizedSerializedSize); + } + for (int i = 0; i < daysOfWeek_.size(); i++) { + output.writeEnumNoTag(daysOfWeek_.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 < startTimes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, startTimes_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < daysOfWeek_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(daysOfWeek_.get(i)); + } + size += dataSize; + if (!getDaysOfWeekList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + daysOfWeekMemoizedSerializedSize = 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.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule other = + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) obj; + + if (!getStartTimesList().equals(other.getStartTimesList())) return false; + if (!daysOfWeek_.equals(other.daysOfWeek_)) 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 (getStartTimesCount() > 0) { + hash = (37 * hash) + START_TIMES_FIELD_NUMBER; + hash = (53 * hash) + getStartTimesList().hashCode(); + } + if (getDaysOfWeekCount() > 0) { + hash = (37 * hash) + DAYS_OF_WEEK_FIELD_NUMBER; + hash = (53 * hash) + daysOfWeek_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule 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.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule 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.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule 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.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + 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.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule 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.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule 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 weekly schedule starts a backup at prescribed start times within a
+     * day, for the specified days of the week.
+     * The weekly schedule message is flexible and can be used to create many
+     * types of schedules. For example, to have a daily backup that starts at
+     * 22:00, configure the `start_times` field to have one element "22:00" and
+     * the `days_of_week` field to have all seven days of the week.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklyScheduleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_WeeklySchedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_WeeklySchedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.class, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.Builder + .class); + } + + // Construct using + // com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (startTimesBuilder_ == null) { + startTimes_ = java.util.Collections.emptyList(); + } else { + startTimes_ = null; + startTimesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + daysOfWeek_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_WeeklySchedule_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule build() { + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule buildPartial() { + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule result = + new com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule result) { + if (startTimesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + startTimes_ = java.util.Collections.unmodifiableList(startTimes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.startTimes_ = startTimes_; + } else { + result.startTimes_ = startTimesBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + daysOfWeek_ = java.util.Collections.unmodifiableList(daysOfWeek_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.daysOfWeek_ = daysOfWeek_; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule result) { + int from_bitField0_ = bitField0_; + } + + @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.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) { + return mergeFrom( + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule other) { + if (other + == com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance()) return this; + if (startTimesBuilder_ == null) { + if (!other.startTimes_.isEmpty()) { + if (startTimes_.isEmpty()) { + startTimes_ = other.startTimes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStartTimesIsMutable(); + startTimes_.addAll(other.startTimes_); + } + onChanged(); + } + } else { + if (!other.startTimes_.isEmpty()) { + if (startTimesBuilder_.isEmpty()) { + startTimesBuilder_.dispose(); + startTimesBuilder_ = null; + startTimes_ = other.startTimes_; + bitField0_ = (bitField0_ & ~0x00000001); + startTimesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStartTimesFieldBuilder() + : null; + } else { + startTimesBuilder_.addAllMessages(other.startTimes_); + } + } + } + if (!other.daysOfWeek_.isEmpty()) { + if (daysOfWeek_.isEmpty()) { + daysOfWeek_ = other.daysOfWeek_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDaysOfWeekIsMutable(); + daysOfWeek_.addAll(other.daysOfWeek_); + } + 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.type.TimeOfDay m = + input.readMessage(com.google.type.TimeOfDay.parser(), extensionRegistry); + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + startTimes_.add(m); + } else { + startTimesBuilder_.addMessage(m); + } + break; + } // case 10 + case 16: + { + int tmpRaw = input.readEnum(); + ensureDaysOfWeekIsMutable(); + daysOfWeek_.add(tmpRaw); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureDaysOfWeekIsMutable(); + daysOfWeek_.add(tmpRaw); + } + input.popLimit(oldLimit); + 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 startTimes_ = + java.util.Collections.emptyList(); + + private void ensureStartTimesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + startTimes_ = new java.util.ArrayList(startTimes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.type.TimeOfDay, + com.google.type.TimeOfDay.Builder, + com.google.type.TimeOfDayOrBuilder> + startTimesBuilder_; + + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public java.util.List getStartTimesList() { + if (startTimesBuilder_ == null) { + return java.util.Collections.unmodifiableList(startTimes_); + } else { + return startTimesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public int getStartTimesCount() { + if (startTimesBuilder_ == null) { + return startTimes_.size(); + } else { + return startTimesBuilder_.getCount(); + } + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public com.google.type.TimeOfDay getStartTimes(int index) { + if (startTimesBuilder_ == null) { + return startTimes_.get(index); + } else { + return startTimesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder setStartTimes(int index, com.google.type.TimeOfDay value) { + if (startTimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartTimesIsMutable(); + startTimes_.set(index, value); + onChanged(); + } else { + startTimesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder setStartTimes(int index, com.google.type.TimeOfDay.Builder builderForValue) { + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + startTimes_.set(index, builderForValue.build()); + onChanged(); + } else { + startTimesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder addStartTimes(com.google.type.TimeOfDay value) { + if (startTimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartTimesIsMutable(); + startTimes_.add(value); + onChanged(); + } else { + startTimesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder addStartTimes(int index, com.google.type.TimeOfDay value) { + if (startTimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartTimesIsMutable(); + startTimes_.add(index, value); + onChanged(); + } else { + startTimesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder addStartTimes(com.google.type.TimeOfDay.Builder builderForValue) { + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + startTimes_.add(builderForValue.build()); + onChanged(); + } else { + startTimesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder addStartTimes(int index, com.google.type.TimeOfDay.Builder builderForValue) { + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + startTimes_.add(index, builderForValue.build()); + onChanged(); + } else { + startTimesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder addAllStartTimes( + java.lang.Iterable values) { + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, startTimes_); + onChanged(); + } else { + startTimesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder clearStartTimes() { + if (startTimesBuilder_ == null) { + startTimes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + startTimesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder removeStartTimes(int index) { + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + startTimes_.remove(index); + onChanged(); + } else { + startTimesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public com.google.type.TimeOfDay.Builder getStartTimesBuilder(int index) { + return getStartTimesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public com.google.type.TimeOfDayOrBuilder getStartTimesOrBuilder(int index) { + if (startTimesBuilder_ == null) { + return startTimes_.get(index); + } else { + return startTimesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public java.util.List + getStartTimesOrBuilderList() { + if (startTimesBuilder_ != null) { + return startTimesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(startTimes_); + } + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public com.google.type.TimeOfDay.Builder addStartTimesBuilder() { + return getStartTimesFieldBuilder() + .addBuilder(com.google.type.TimeOfDay.getDefaultInstance()); + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public com.google.type.TimeOfDay.Builder addStartTimesBuilder(int index) { + return getStartTimesFieldBuilder() + .addBuilder(index, com.google.type.TimeOfDay.getDefaultInstance()); + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public java.util.List getStartTimesBuilderList() { + return getStartTimesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.type.TimeOfDay, + com.google.type.TimeOfDay.Builder, + com.google.type.TimeOfDayOrBuilder> + getStartTimesFieldBuilder() { + if (startTimesBuilder_ == null) { + startTimesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.type.TimeOfDay, + com.google.type.TimeOfDay.Builder, + com.google.type.TimeOfDayOrBuilder>( + startTimes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + startTimes_ = null; + } + return startTimesBuilder_; + } + + private java.util.List daysOfWeek_ = java.util.Collections.emptyList(); + + private void ensureDaysOfWeekIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + daysOfWeek_ = new java.util.ArrayList(daysOfWeek_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the daysOfWeek. + */ + public java.util.List getDaysOfWeekList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.type.DayOfWeek>(daysOfWeek_, daysOfWeek_converter_); + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return The count of daysOfWeek. + */ + public int getDaysOfWeekCount() { + return daysOfWeek_.size(); + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the element to return. + * @return The daysOfWeek at the given index. + */ + public com.google.type.DayOfWeek getDaysOfWeek(int index) { + return daysOfWeek_converter_.convert(daysOfWeek_.get(index)); + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index to set the value at. + * @param value The daysOfWeek to set. + * @return This builder for chaining. + */ + public Builder setDaysOfWeek(int index, com.google.type.DayOfWeek value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDaysOfWeekIsMutable(); + daysOfWeek_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param value The daysOfWeek to add. + * @return This builder for chaining. + */ + public Builder addDaysOfWeek(com.google.type.DayOfWeek value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDaysOfWeekIsMutable(); + daysOfWeek_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param values The daysOfWeek to add. + * @return This builder for chaining. + */ + public Builder addAllDaysOfWeek( + java.lang.Iterable values) { + ensureDaysOfWeekIsMutable(); + for (com.google.type.DayOfWeek value : values) { + daysOfWeek_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return This builder for chaining. + */ + public Builder clearDaysOfWeek() { + daysOfWeek_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the enum numeric values on the wire for daysOfWeek. + */ + public java.util.List getDaysOfWeekValueList() { + return java.util.Collections.unmodifiableList(daysOfWeek_); + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of daysOfWeek at the given index. + */ + public int getDaysOfWeekValue(int index) { + return daysOfWeek_.get(index); + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for daysOfWeek to set. + * @return This builder for chaining. + */ + public Builder setDaysOfWeekValue(int index, int value) { + ensureDaysOfWeekIsMutable(); + daysOfWeek_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param value The enum numeric value on the wire for daysOfWeek to add. + * @return This builder for chaining. + */ + public Builder addDaysOfWeekValue(int value) { + ensureDaysOfWeekIsMutable(); + daysOfWeek_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param values The enum numeric values on the wire for daysOfWeek to add. + * @return This builder for chaining. + */ + public Builder addAllDaysOfWeekValue(java.lang.Iterable values) { + ensureDaysOfWeekIsMutable(); + for (int value : values) { + daysOfWeek_.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.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) + private static final com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule(); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WeeklySchedule 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.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TimeBasedRetentionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return Whether the retentionPeriod field is set. + */ + boolean hasRetentionPeriod(); + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return The retentionPeriod. + */ + com.google.protobuf.Duration getRetentionPeriod(); + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder(); + } + /** + * + * + *
+   * A time based retention policy specifies that all backups within a certain
+   * time period should be retained.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} + */ + public static final class TimeBasedRetention extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) + TimeBasedRetentionOrBuilder { + private static final long serialVersionUID = 0L; + // Use TimeBasedRetention.newBuilder() to construct. + private TimeBasedRetention(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimeBasedRetention() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TimeBasedRetention(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_TimeBasedRetention_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_TimeBasedRetention_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.class, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.Builder + .class); + } + + public static final int RETENTION_PERIOD_FIELD_NUMBER = 1; + private com.google.protobuf.Duration retentionPeriod_; + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return Whether the retentionPeriod field is set. + */ + @java.lang.Override + public boolean hasRetentionPeriod() { + return retentionPeriod_ != null; + } + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return The retentionPeriod. + */ + @java.lang.Override + public com.google.protobuf.Duration getRetentionPeriod() { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder() { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } + + 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 (retentionPeriod_ != null) { + output.writeMessage(1, getRetentionPeriod()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (retentionPeriod_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRetentionPeriod()); + } + 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.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention other = + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) obj; + + if (hasRetentionPeriod() != other.hasRetentionPeriod()) return false; + if (hasRetentionPeriod()) { + if (!getRetentionPeriod().equals(other.getRetentionPeriod())) 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 (hasRetentionPeriod()) { + hash = (37 * hash) + RETENTION_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getRetentionPeriod().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + 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.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + 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.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + 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.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + 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.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + 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.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention 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 time based retention policy specifies that all backups within a certain
+     * time period should be retained.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_TimeBasedRetention_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_TimeBasedRetention_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.class, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.Builder + .class); + } + + // Construct using + // com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + retentionPeriod_ = null; + if (retentionPeriodBuilder_ != null) { + retentionPeriodBuilder_.dispose(); + retentionPeriodBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_TimeBasedRetention_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention build() { + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + buildPartial() { + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention result = + new com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.retentionPeriod_ = + retentionPeriodBuilder_ == null ? retentionPeriod_ : retentionPeriodBuilder_.build(); + } + } + + @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.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) { + return mergeFrom( + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention other) { + if (other + == com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance()) return this; + if (other.hasRetentionPeriod()) { + mergeRetentionPeriod(other.getRetentionPeriod()); + } + 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( + getRetentionPeriodFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + 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.Duration retentionPeriod_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + retentionPeriodBuilder_; + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return Whether the retentionPeriod field is set. + */ + public boolean hasRetentionPeriod() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return The retentionPeriod. + */ + public com.google.protobuf.Duration getRetentionPeriod() { + if (retentionPeriodBuilder_ == null) { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } else { + return retentionPeriodBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder setRetentionPeriod(com.google.protobuf.Duration value) { + if (retentionPeriodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retentionPeriod_ = value; + } else { + retentionPeriodBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder setRetentionPeriod(com.google.protobuf.Duration.Builder builderForValue) { + if (retentionPeriodBuilder_ == null) { + retentionPeriod_ = builderForValue.build(); + } else { + retentionPeriodBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder mergeRetentionPeriod(com.google.protobuf.Duration value) { + if (retentionPeriodBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && retentionPeriod_ != null + && retentionPeriod_ != com.google.protobuf.Duration.getDefaultInstance()) { + getRetentionPeriodBuilder().mergeFrom(value); + } else { + retentionPeriod_ = value; + } + } else { + retentionPeriodBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder clearRetentionPeriod() { + bitField0_ = (bitField0_ & ~0x00000001); + retentionPeriod_ = null; + if (retentionPeriodBuilder_ != null) { + retentionPeriodBuilder_.dispose(); + retentionPeriodBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public com.google.protobuf.Duration.Builder getRetentionPeriodBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getRetentionPeriodFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder() { + if (retentionPeriodBuilder_ != null) { + return retentionPeriodBuilder_.getMessageOrBuilder(); + } else { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getRetentionPeriodFieldBuilder() { + if (retentionPeriodBuilder_ == null) { + retentionPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getRetentionPeriod(), getParentForChildren(), isClean()); + retentionPeriod_ = null; + } + return retentionPeriodBuilder_; + } + + @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.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) + private static final com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention(); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimeBasedRetention 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.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QuantityBasedRetentionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The number of backups to retain.
+     * 
+ * + * int32 count = 1; + * + * @return The count. + */ + int getCount(); + } + /** + * + * + *
+   * A quantity based policy specifies that a certain number of the most recent
+   * successful backups should be retained.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} + */ + public static final class QuantityBasedRetention extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) + QuantityBasedRetentionOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuantityBasedRetention.newBuilder() to construct. + private QuantityBasedRetention(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuantityBasedRetention() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuantityBasedRetention(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_QuantityBasedRetention_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_QuantityBasedRetention_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.class, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.Builder + .class); + } + + public static final int COUNT_FIELD_NUMBER = 1; + private int count_ = 0; + /** + * + * + *
+     * The number of backups to retain.
+     * 
+ * + * int32 count = 1; + * + * @return The count. + */ + @java.lang.Override + public int getCount() { + return count_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (count_ != 0) { + output.writeInt32(1, count_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (count_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, count_); + } + 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.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention other = + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) obj; + + if (getCount() != other.getCount()) 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) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + getCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + 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.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + 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.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + 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.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + 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.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + 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.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention 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 quantity based policy specifies that a certain number of the most recent
+     * successful backups should be retained.
+     * 
+ * + * Protobuf type {@code + * google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_QuantityBasedRetention_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_QuantityBasedRetention_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.class, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + .Builder.class); + } + + // Construct using + // com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + count_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_QuantityBasedRetention_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention build() { + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + buildPartial() { + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention result = + new com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.count_ = count_; + } + } + + @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.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) { + return mergeFrom( + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention other) { + if (other + == com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance()) return this; + if (other.getCount() != 0) { + setCount(other.getCount()); + } + 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: + { + count_ = input.readInt32(); + bitField0_ |= 0x00000001; + 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 bitField0_; + + private int count_; + /** + * + * + *
+       * The number of backups to retain.
+       * 
+ * + * int32 count = 1; + * + * @return The count. + */ + @java.lang.Override + public int getCount() { + return count_; + } + /** + * + * + *
+       * The number of backups to retain.
+       * 
+ * + * int32 count = 1; + * + * @param value The count to set. + * @return This builder for chaining. + */ + public Builder setCount(int value) { + + count_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The number of backups to retain.
+       * 
+ * + * int32 count = 1; + * + * @return This builder for chaining. + */ + public Builder clearCount() { + bitField0_ = (bitField0_ & ~0x00000001); + count_ = 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.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) + private static final com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + .QuantityBasedRetention + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention(); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuantityBasedRetention 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.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + private int scheduleCase_ = 0; + private java.lang.Object schedule_; + + public enum ScheduleCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + WEEKLY_SCHEDULE(2), + SCHEDULE_NOT_SET(0); + private final int value; + + private ScheduleCase(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 ScheduleCase valueOf(int value) { + return forNumber(value); + } + + public static ScheduleCase forNumber(int value) { + switch (value) { + case 2: + return WEEKLY_SCHEDULE; + case 0: + return SCHEDULE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ScheduleCase getScheduleCase() { + return ScheduleCase.forNumber(scheduleCase_); + } + + private int retentionCase_ = 0; + private java.lang.Object retention_; + + public enum RetentionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TIME_BASED_RETENTION(4), + QUANTITY_BASED_RETENTION(5), + RETENTION_NOT_SET(0); + private final int value; + + private RetentionCase(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 RetentionCase valueOf(int value) { + return forNumber(value); + } + + public static RetentionCase forNumber(int value) { + switch (value) { + case 4: + return TIME_BASED_RETENTION; + case 5: + return QUANTITY_BASED_RETENTION; + case 0: + return RETENTION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RetentionCase getRetentionCase() { + return RetentionCase.forNumber(retentionCase_); + } + + public static final int WEEKLY_SCHEDULE_FIELD_NUMBER = 2; + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * + * @return Whether the weeklySchedule field is set. + */ + @java.lang.Override + public boolean hasWeeklySchedule() { + return scheduleCase_ == 2; + } + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * + * @return The weeklySchedule. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule getWeeklySchedule() { + if (scheduleCase_ == 2) { + return (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) schedule_; + } + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklyScheduleOrBuilder + getWeeklyScheduleOrBuilder() { + if (scheduleCase_ == 2) { + return (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) schedule_; + } + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } + + public static final int TIME_BASED_RETENTION_FIELD_NUMBER = 4; + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return Whether the timeBasedRetention field is set. + */ + @java.lang.Override + public boolean hasTimeBasedRetention() { + return retentionCase_ == 4; + } + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return The timeBasedRetention. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + getTimeBasedRetention() { + if (retentionCase_ == 4) { + return (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) retention_; + } + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder + getTimeBasedRetentionOrBuilder() { + if (retentionCase_ == 4) { + return (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) retention_; + } + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + + public static final int QUANTITY_BASED_RETENTION_FIELD_NUMBER = 5; + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return Whether the quantityBasedRetention field is set. + */ + @java.lang.Override + public boolean hasQuantityBasedRetention() { + return retentionCase_ == 5; + } + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return The quantityBasedRetention. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + getQuantityBasedRetention() { + if (retentionCase_ == 5) { + return (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) + retention_; + } + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder + getQuantityBasedRetentionOrBuilder() { + if (retentionCase_ == 5) { + return (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) + retention_; + } + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_ = false; + /** + * + * + *
+   * Whether automated automated backups are enabled. If not set, defaults to
+   * true.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Whether automated automated backups are enabled. If not set, defaults to
+   * true.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + public static final int BACKUP_WINDOW_FIELD_NUMBER = 3; + private com.google.protobuf.Duration backupWindow_; + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return Whether the backupWindow field is set. + */ + @java.lang.Override + public boolean hasBackupWindow() { + return backupWindow_ != null; + } + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return The backupWindow. + */ + @java.lang.Override + public com.google.protobuf.Duration getBackupWindow() { + return backupWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backupWindow_; + } + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getBackupWindowOrBuilder() { + return backupWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backupWindow_; + } + + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 8; + private com.google.cloud.alloydb.v1alpha.EncryptionConfig encryptionConfig_; + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return encryptionConfig_ != null; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + public static final int LOCATION_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + /** + * + * + *
+   * The location where the backup will be stored. Currently, the only supported
+   * option is to store the backup in the same region as the cluster.
+   * If empty, defaults to the region of the cluster.
+   * 
+ * + * string location = 6; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + 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(); + location_ = s; + return s; + } + } + /** + * + * + *
+   * The location where the backup will be stored. Currently, the only supported
+   * option is to store the backup in the same region as the cluster.
+   * If empty, defaults to the region of the cluster.
+   * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 7; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().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 (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, enabled_); + } + if (scheduleCase_ == 2) { + output.writeMessage( + 2, (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) schedule_); + } + if (backupWindow_ != null) { + output.writeMessage(3, getBackupWindow()); + } + if (retentionCase_ == 4) { + output.writeMessage( + 4, + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) retention_); + } + if (retentionCase_ == 5) { + output.writeMessage( + 5, + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) + retention_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, location_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 7); + if (encryptionConfig_ != null) { + output.writeMessage(8, getEncryptionConfig()); + } + 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, enabled_); + } + if (scheduleCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) schedule_); + } + if (backupWindow_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBackupWindow()); + } + if (retentionCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) + retention_); + } + if (retentionCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) + retention_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, location_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, labels__); + } + if (encryptionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getEncryptionConfig()); + } + 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.alloydb.v1alpha.AutomatedBackupPolicy)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy other = + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy) obj; + + if (hasEnabled() != other.hasEnabled()) return false; + if (hasEnabled()) { + if (getEnabled() != other.getEnabled()) return false; + } + if (hasBackupWindow() != other.hasBackupWindow()) return false; + if (hasBackupWindow()) { + if (!getBackupWindow().equals(other.getBackupWindow())) return false; + } + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) return false; + } + if (!getLocation().equals(other.getLocation())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getScheduleCase().equals(other.getScheduleCase())) return false; + switch (scheduleCase_) { + case 2: + if (!getWeeklySchedule().equals(other.getWeeklySchedule())) return false; + break; + case 0: + default: + } + if (!getRetentionCase().equals(other.getRetentionCase())) return false; + switch (retentionCase_) { + case 4: + if (!getTimeBasedRetention().equals(other.getTimeBasedRetention())) return false; + break; + case 5: + if (!getQuantityBasedRetention().equals(other.getQuantityBasedRetention())) 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(); + if (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); + } + if (hasBackupWindow()) { + hash = (37 * hash) + BACKUP_WINDOW_FIELD_NUMBER; + hash = (53 * hash) + getBackupWindow().hashCode(); + } + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + switch (scheduleCase_) { + case 2: + hash = (37 * hash) + WEEKLY_SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + getWeeklySchedule().hashCode(); + break; + case 0: + default: + } + switch (retentionCase_) { + case 4: + hash = (37 * hash) + TIME_BASED_RETENTION_FIELD_NUMBER; + hash = (53 * hash) + getTimeBasedRetention().hashCode(); + break; + case 5: + hash = (37 * hash) + QUANTITY_BASED_RETENTION_FIELD_NUMBER; + hash = (53 * hash) + getQuantityBasedRetention().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy 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.alloydb.v1alpha.AutomatedBackupPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy 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.alloydb.v1alpha.AutomatedBackupPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy 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.alloydb.v1alpha.AutomatedBackupPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy 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.alloydb.v1alpha.AutomatedBackupPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy 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.alloydb.v1alpha.AutomatedBackupPolicy 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; + } + /** + * + * + *
+   * Message describing the user-specified automated backup policy.
+   * All fields in the automated backup policy are optional. Defaults for each
+   * field are provided if they are not set.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy) + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.class, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (weeklyScheduleBuilder_ != null) { + weeklyScheduleBuilder_.clear(); + } + if (timeBasedRetentionBuilder_ != null) { + timeBasedRetentionBuilder_.clear(); + } + if (quantityBasedRetentionBuilder_ != null) { + quantityBasedRetentionBuilder_.clear(); + } + enabled_ = false; + backupWindow_ = null; + if (backupWindowBuilder_ != null) { + backupWindowBuilder_.dispose(); + backupWindowBuilder_ = null; + } + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + location_ = ""; + internalGetMutableLabels().clear(); + scheduleCase_ = 0; + schedule_ = null; + retentionCase_ = 0; + retention_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy build() { + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy buildPartial() { + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy result = + new com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.enabled_ = enabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.backupWindow_ = + backupWindowBuilder_ == null ? backupWindow_ : backupWindowBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.encryptionConfig_ = + encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.location_ = location_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy result) { + result.scheduleCase_ = scheduleCase_; + result.schedule_ = this.schedule_; + if (scheduleCase_ == 2 && weeklyScheduleBuilder_ != null) { + result.schedule_ = weeklyScheduleBuilder_.build(); + } + result.retentionCase_ = retentionCase_; + result.retention_ = this.retention_; + if (retentionCase_ == 4 && timeBasedRetentionBuilder_ != null) { + result.retention_ = timeBasedRetentionBuilder_.build(); + } + if (retentionCase_ == 5 && quantityBasedRetentionBuilder_ != null) { + result.retention_ = quantityBasedRetentionBuilder_.build(); + } + } + + @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.alloydb.v1alpha.AutomatedBackupPolicy) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy other) { + if (other == com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.getDefaultInstance()) + return this; + if (other.hasEnabled()) { + setEnabled(other.getEnabled()); + } + if (other.hasBackupWindow()) { + mergeBackupWindow(other.getBackupWindow()); + } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000040; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000080; + switch (other.getScheduleCase()) { + case WEEKLY_SCHEDULE: + { + mergeWeeklySchedule(other.getWeeklySchedule()); + break; + } + case SCHEDULE_NOT_SET: + { + break; + } + } + switch (other.getRetentionCase()) { + case TIME_BASED_RETENTION: + { + mergeTimeBasedRetention(other.getTimeBasedRetention()); + break; + } + case QUANTITY_BASED_RETENTION: + { + mergeQuantityBasedRetention(other.getQuantityBasedRetention()); + break; + } + case RETENTION_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 8: + { + enabled_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 8 + case 18: + { + input.readMessage(getWeeklyScheduleFieldBuilder().getBuilder(), extensionRegistry); + scheduleCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getBackupWindowFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 26 + case 34: + { + input.readMessage( + getTimeBasedRetentionFieldBuilder().getBuilder(), extensionRegistry); + retentionCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + getQuantityBasedRetentionFieldBuilder().getBuilder(), extensionRegistry); + retentionCase_ = 5; + break; + } // case 42 + case 50: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 58: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + input.readMessage( + getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 66 + 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 scheduleCase_ = 0; + private java.lang.Object schedule_; + + public ScheduleCase getScheduleCase() { + return ScheduleCase.forNumber(scheduleCase_); + } + + public Builder clearSchedule() { + scheduleCase_ = 0; + schedule_ = null; + onChanged(); + return this; + } + + private int retentionCase_ = 0; + private java.lang.Object retention_; + + public RetentionCase getRetentionCase() { + return RetentionCase.forNumber(retentionCase_); + } + + public Builder clearRetention() { + retentionCase_ = 0; + retention_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.Builder, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklyScheduleOrBuilder> + weeklyScheduleBuilder_; + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * + * @return Whether the weeklySchedule field is set. + */ + @java.lang.Override + public boolean hasWeeklySchedule() { + return scheduleCase_ == 2; + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * + * @return The weeklySchedule. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + getWeeklySchedule() { + if (weeklyScheduleBuilder_ == null) { + if (scheduleCase_ == 2) { + return (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) schedule_; + } + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } else { + if (scheduleCase_ == 2) { + return weeklyScheduleBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + public Builder setWeeklySchedule( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule value) { + if (weeklyScheduleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schedule_ = value; + onChanged(); + } else { + weeklyScheduleBuilder_.setMessage(value); + } + scheduleCase_ = 2; + return this; + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + public Builder setWeeklySchedule( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.Builder + builderForValue) { + if (weeklyScheduleBuilder_ == null) { + schedule_ = builderForValue.build(); + onChanged(); + } else { + weeklyScheduleBuilder_.setMessage(builderForValue.build()); + } + scheduleCase_ = 2; + return this; + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + public Builder mergeWeeklySchedule( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule value) { + if (weeklyScheduleBuilder_ == null) { + if (scheduleCase_ == 2 + && schedule_ + != com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance()) { + schedule_ = + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.newBuilder( + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) + schedule_) + .mergeFrom(value) + .buildPartial(); + } else { + schedule_ = value; + } + onChanged(); + } else { + if (scheduleCase_ == 2) { + weeklyScheduleBuilder_.mergeFrom(value); + } else { + weeklyScheduleBuilder_.setMessage(value); + } + } + scheduleCase_ = 2; + return this; + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + public Builder clearWeeklySchedule() { + if (weeklyScheduleBuilder_ == null) { + if (scheduleCase_ == 2) { + scheduleCase_ = 0; + schedule_ = null; + onChanged(); + } + } else { + if (scheduleCase_ == 2) { + scheduleCase_ = 0; + schedule_ = null; + } + weeklyScheduleBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.Builder + getWeeklyScheduleBuilder() { + return getWeeklyScheduleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklyScheduleOrBuilder + getWeeklyScheduleOrBuilder() { + if ((scheduleCase_ == 2) && (weeklyScheduleBuilder_ != null)) { + return weeklyScheduleBuilder_.getMessageOrBuilder(); + } else { + if (scheduleCase_ == 2) { + return (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) schedule_; + } + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.Builder, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklyScheduleOrBuilder> + getWeeklyScheduleFieldBuilder() { + if (weeklyScheduleBuilder_ == null) { + if (!(scheduleCase_ == 2)) { + schedule_ = + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } + weeklyScheduleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.Builder, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklyScheduleOrBuilder>( + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) schedule_, + getParentForChildren(), + isClean()); + schedule_ = null; + } + scheduleCase_ = 2; + onChanged(); + return weeklyScheduleBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.Builder, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder> + timeBasedRetentionBuilder_; + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return Whether the timeBasedRetention field is set. + */ + @java.lang.Override + public boolean hasTimeBasedRetention() { + return retentionCase_ == 4; + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return The timeBasedRetention. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + getTimeBasedRetention() { + if (timeBasedRetentionBuilder_ == null) { + if (retentionCase_ == 4) { + return (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) + retention_; + } + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } else { + if (retentionCase_ == 4) { + return timeBasedRetentionBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + public Builder setTimeBasedRetention( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention value) { + if (timeBasedRetentionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retention_ = value; + onChanged(); + } else { + timeBasedRetentionBuilder_.setMessage(value); + } + retentionCase_ = 4; + return this; + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + public Builder setTimeBasedRetention( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.Builder + builderForValue) { + if (timeBasedRetentionBuilder_ == null) { + retention_ = builderForValue.build(); + onChanged(); + } else { + timeBasedRetentionBuilder_.setMessage(builderForValue.build()); + } + retentionCase_ = 4; + return this; + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + public Builder mergeTimeBasedRetention( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention value) { + if (timeBasedRetentionBuilder_ == null) { + if (retentionCase_ == 4 + && retention_ + != com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance()) { + retention_ = + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.newBuilder( + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) + retention_) + .mergeFrom(value) + .buildPartial(); + } else { + retention_ = value; + } + onChanged(); + } else { + if (retentionCase_ == 4) { + timeBasedRetentionBuilder_.mergeFrom(value); + } else { + timeBasedRetentionBuilder_.setMessage(value); + } + } + retentionCase_ = 4; + return this; + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + public Builder clearTimeBasedRetention() { + if (timeBasedRetentionBuilder_ == null) { + if (retentionCase_ == 4) { + retentionCase_ = 0; + retention_ = null; + onChanged(); + } + } else { + if (retentionCase_ == 4) { + retentionCase_ = 0; + retention_ = null; + } + timeBasedRetentionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.Builder + getTimeBasedRetentionBuilder() { + return getTimeBasedRetentionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder + getTimeBasedRetentionOrBuilder() { + if ((retentionCase_ == 4) && (timeBasedRetentionBuilder_ != null)) { + return timeBasedRetentionBuilder_.getMessageOrBuilder(); + } else { + if (retentionCase_ == 4) { + return (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) + retention_; + } + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.Builder, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder> + getTimeBasedRetentionFieldBuilder() { + if (timeBasedRetentionBuilder_ == null) { + if (!(retentionCase_ == 4)) { + retention_ = + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + timeBasedRetentionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.Builder, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder>( + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) + retention_, + getParentForChildren(), + isClean()); + retention_ = null; + } + retentionCase_ = 4; + onChanged(); + return timeBasedRetentionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.Builder, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder> + quantityBasedRetentionBuilder_; + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return Whether the quantityBasedRetention field is set. + */ + @java.lang.Override + public boolean hasQuantityBasedRetention() { + return retentionCase_ == 5; + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return The quantityBasedRetention. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + getQuantityBasedRetention() { + if (quantityBasedRetentionBuilder_ == null) { + if (retentionCase_ == 5) { + return (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) + retention_; + } + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } else { + if (retentionCase_ == 5) { + return quantityBasedRetentionBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + public Builder setQuantityBasedRetention( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention value) { + if (quantityBasedRetentionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retention_ = value; + onChanged(); + } else { + quantityBasedRetentionBuilder_.setMessage(value); + } + retentionCase_ = 5; + return this; + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + public Builder setQuantityBasedRetention( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.Builder + builderForValue) { + if (quantityBasedRetentionBuilder_ == null) { + retention_ = builderForValue.build(); + onChanged(); + } else { + quantityBasedRetentionBuilder_.setMessage(builderForValue.build()); + } + retentionCase_ = 5; + return this; + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + public Builder mergeQuantityBasedRetention( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention value) { + if (quantityBasedRetentionBuilder_ == null) { + if (retentionCase_ == 5 + && retention_ + != com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance()) { + retention_ = + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + .newBuilder( + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + .QuantityBasedRetention) + retention_) + .mergeFrom(value) + .buildPartial(); + } else { + retention_ = value; + } + onChanged(); + } else { + if (retentionCase_ == 5) { + quantityBasedRetentionBuilder_.mergeFrom(value); + } else { + quantityBasedRetentionBuilder_.setMessage(value); + } + } + retentionCase_ = 5; + return this; + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + public Builder clearQuantityBasedRetention() { + if (quantityBasedRetentionBuilder_ == null) { + if (retentionCase_ == 5) { + retentionCase_ = 0; + retention_ = null; + onChanged(); + } + } else { + if (retentionCase_ == 5) { + retentionCase_ = 0; + retention_ = null; + } + quantityBasedRetentionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.Builder + getQuantityBasedRetentionBuilder() { + return getQuantityBasedRetentionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder + getQuantityBasedRetentionOrBuilder() { + if ((retentionCase_ == 5) && (quantityBasedRetentionBuilder_ != null)) { + return quantityBasedRetentionBuilder_.getMessageOrBuilder(); + } else { + if (retentionCase_ == 5) { + return (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) + retention_; + } + return com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.Builder, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder> + getQuantityBasedRetentionFieldBuilder() { + if (quantityBasedRetentionBuilder_ == null) { + if (!(retentionCase_ == 5)) { + retention_ = + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + quantityBasedRetentionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + .Builder, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + .QuantityBasedRetentionOrBuilder>( + (com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) + retention_, + getParentForChildren(), + isClean()); + retention_ = null; + } + retentionCase_ = 5; + onChanged(); + return quantityBasedRetentionBuilder_; + } + + private boolean enabled_; + /** + * + * + *
+     * Whether automated automated backups are enabled. If not set, defaults to
+     * true.
+     * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Whether automated automated backups are enabled. If not set, defaults to
+     * true.
+     * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + /** + * + * + *
+     * Whether automated automated backups are enabled. If not set, defaults to
+     * true.
+     * 
+ * + * optional bool enabled = 1; + * + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether automated automated backups are enabled. If not set, defaults to
+     * true.
+     * 
+ * + * optional bool enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000008); + enabled_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Duration backupWindow_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + backupWindowBuilder_; + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return Whether the backupWindow field is set. + */ + public boolean hasBackupWindow() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return The backupWindow. + */ + public com.google.protobuf.Duration getBackupWindow() { + if (backupWindowBuilder_ == null) { + return backupWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backupWindow_; + } else { + return backupWindowBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public Builder setBackupWindow(com.google.protobuf.Duration value) { + if (backupWindowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupWindow_ = value; + } else { + backupWindowBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public Builder setBackupWindow(com.google.protobuf.Duration.Builder builderForValue) { + if (backupWindowBuilder_ == null) { + backupWindow_ = builderForValue.build(); + } else { + backupWindowBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public Builder mergeBackupWindow(com.google.protobuf.Duration value) { + if (backupWindowBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && backupWindow_ != null + && backupWindow_ != com.google.protobuf.Duration.getDefaultInstance()) { + getBackupWindowBuilder().mergeFrom(value); + } else { + backupWindow_ = value; + } + } else { + backupWindowBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public Builder clearBackupWindow() { + bitField0_ = (bitField0_ & ~0x00000010); + backupWindow_ = null; + if (backupWindowBuilder_ != null) { + backupWindowBuilder_.dispose(); + backupWindowBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public com.google.protobuf.Duration.Builder getBackupWindowBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getBackupWindowFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public com.google.protobuf.DurationOrBuilder getBackupWindowOrBuilder() { + if (backupWindowBuilder_ != null) { + return backupWindowBuilder_.getMessageOrBuilder(); + } else { + return backupWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backupWindow_; + } + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getBackupWindowFieldBuilder() { + if (backupWindowBuilder_ == null) { + backupWindowBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getBackupWindow(), getParentForChildren(), isClean()); + backupWindow_ = null; + } + return backupWindowBuilder_; + } + + private com.google.cloud.alloydb.v1alpha.EncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionConfig, + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder> + encryptionConfigBuilder_; + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + public com.google.cloud.alloydb.v1alpha.EncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig(com.google.cloud.alloydb.v1alpha.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + } else { + encryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig( + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1alpha.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); + } else { + encryptionConfig_ = value; + } + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEncryptionConfig() { + bitField0_ = (bitField0_ & ~0x00000020); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder getEncryptionConfigBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getEncryptionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionConfig, + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder> + getEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionConfig, + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + + private java.lang.Object location_ = ""; + /** + * + * + *
+     * The location where the backup will be stored. Currently, the only supported
+     * option is to store the backup in the same region as the cluster.
+     * If empty, defaults to the region of the cluster.
+     * 
+ * + * string location = 6; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The location where the backup will be stored. Currently, the only supported
+     * option is to store the backup in the same region as the cluster.
+     * If empty, defaults to the region of the cluster.
+     * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The location where the backup will be stored. Currently, the only supported
+     * option is to store the backup in the same region as the cluster.
+     * If empty, defaults to the region of the cluster.
+     * 
+ * + * string location = 6; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The location where the backup will be stored. Currently, the only supported
+     * option is to store the backup in the same region as the cluster.
+     * If empty, defaults to the region of the cluster.
+     * 
+ * + * string location = 6; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * The location where the backup will be stored. Currently, the only supported
+     * option is to store the backup in the same region as the cluster.
+     * If empty, defaults to the region of the cluster.
+     * 
+ * + * string location = 6; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000080; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000080); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000080; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000080; + return this; + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000080; + 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.alloydb.v1alpha.AutomatedBackupPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy) + private static final com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy(); + } + + public static com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AutomatedBackupPolicy 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.alloydb.v1alpha.AutomatedBackupPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/AutomatedBackupPolicyOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/AutomatedBackupPolicyOrBuilder.java new file mode 100644 index 000000000000..eac9da3ebf1f --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/AutomatedBackupPolicyOrBuilder.java @@ -0,0 +1,364 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface AutomatedBackupPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.AutomatedBackupPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * + * @return Whether the weeklySchedule field is set. + */ + boolean hasWeeklySchedule(); + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * + * @return The weeklySchedule. + */ + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule getWeeklySchedule(); + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklyScheduleOrBuilder + getWeeklyScheduleOrBuilder(); + + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return Whether the timeBasedRetention field is set. + */ + boolean hasTimeBasedRetention(); + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return The timeBasedRetention. + */ + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention getTimeBasedRetention(); + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder + getTimeBasedRetentionOrBuilder(); + + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return Whether the quantityBasedRetention field is set. + */ + boolean hasQuantityBasedRetention(); + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return The quantityBasedRetention. + */ + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + getQuantityBasedRetention(); + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder + getQuantityBasedRetentionOrBuilder(); + + /** + * + * + *
+   * Whether automated automated backups are enabled. If not set, defaults to
+   * true.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + boolean hasEnabled(); + /** + * + * + *
+   * Whether automated automated backups are enabled. If not set, defaults to
+   * true.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + boolean getEnabled(); + + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return Whether the backupWindow field is set. + */ + boolean hasBackupWindow(); + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return The backupWindow. + */ + com.google.protobuf.Duration getBackupWindow(); + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + com.google.protobuf.DurationOrBuilder getBackupWindowOrBuilder(); + + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + com.google.cloud.alloydb.v1alpha.EncryptionConfig getEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); + + /** + * + * + *
+   * The location where the backup will be stored. Currently, the only supported
+   * option is to store the backup in the same region as the cluster.
+   * If empty, defaults to the region of the cluster.
+   * 
+ * + * string location = 6; + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+   * The location where the backup will be stored. Currently, the only supported
+   * option is to store the backup in the same region as the cluster.
+   * If empty, defaults to the region of the cluster.
+   * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ScheduleCase getScheduleCase(); + + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.RetentionCase getRetentionCase(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Backup.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Backup.java new file mode 100644 index 000000000000..77e296a2e1ad --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Backup.java @@ -0,0 +1,5137 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message describing Backup object
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Backup} + */ +public final class Backup extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.Backup) + BackupOrBuilder { + private static final long serialVersionUID = 0L; + // Use Backup.newBuilder() to construct. + private Backup(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Backup() { + name_ = ""; + displayName_ = ""; + uid_ = ""; + state_ = 0; + type_ = 0; + description_ = ""; + clusterUid_ = ""; + clusterName_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Backup(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Backup_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetLabels(); + case 16: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Backup.class, + com.google.cloud.alloydb.v1alpha.Backup.Builder.class); + } + + /** + * + * + *
+   * Backup State
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.Backup.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the backup is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The backup is ready.
+     * 
+ * + * READY = 1; + */ + READY(1), + /** + * + * + *
+     * The backup is creating.
+     * 
+ * + * CREATING = 2; + */ + CREATING(2), + /** + * + * + *
+     * The backup failed.
+     * 
+ * + * FAILED = 3; + */ + FAILED(3), + /** + * + * + *
+     * The backup is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The state of the backup is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The backup is ready.
+     * 
+ * + * READY = 1; + */ + public static final int READY_VALUE = 1; + /** + * + * + *
+     * The backup is creating.
+     * 
+ * + * CREATING = 2; + */ + public static final int CREATING_VALUE = 2; + /** + * + * + *
+     * The backup failed.
+     * 
+ * + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + /** + * + * + *
+     * The backup is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_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 STATE_UNSPECIFIED; + case 1: + return READY; + case 2: + return CREATING; + case 3: + return FAILED; + case 4: + return DELETING; + 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.alloydb.v1alpha.Backup.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.alloydb.v1alpha.Backup.State) + } + + /** + * + * + *
+   * Backup Type
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.Backup.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Backup Type is unknown.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * ON_DEMAND backups that were triggered by the customer (e.g., not
+     * AUTOMATED).
+     * 
+ * + * ON_DEMAND = 1; + */ + ON_DEMAND(1), + /** + * + * + *
+     * AUTOMATED backups triggered by the automated backups scheduler pursuant
+     * to an automated backup policy.
+     * 
+ * + * AUTOMATED = 2; + */ + AUTOMATED(2), + /** + * + * + *
+     * CONTINUOUS backups triggered by the automated backups scheduler
+     * due to a continuous backup policy.
+     * 
+ * + * CONTINUOUS = 3; + */ + CONTINUOUS(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Backup Type is unknown.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * ON_DEMAND backups that were triggered by the customer (e.g., not
+     * AUTOMATED).
+     * 
+ * + * ON_DEMAND = 1; + */ + public static final int ON_DEMAND_VALUE = 1; + /** + * + * + *
+     * AUTOMATED backups triggered by the automated backups scheduler pursuant
+     * to an automated backup policy.
+     * 
+ * + * AUTOMATED = 2; + */ + public static final int AUTOMATED_VALUE = 2; + /** + * + * + *
+     * CONTINUOUS backups triggered by the automated backups scheduler
+     * due to a continuous backup policy.
+     * 
+ * + * CONTINUOUS = 3; + */ + public static final int CONTINUOUS_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 Type 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 Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return ON_DEMAND; + case 2: + return AUTOMATED; + case 3: + return CONTINUOUS; + 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 Type findValueByNumber(int number) { + return Type.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.alloydb.v1alpha.Backup.getDescriptor().getEnumTypes().get(1); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.Backup.Type) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * where the cluster and backup ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the backup resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * where the cluster and backup ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the backup resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * User-settable and human-readable display name for the Backup.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * User-settable and human-readable display name for the Backup.
+   * 
+ * + * 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 UID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + 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(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int DELETE_TIME_FIELD_NUMBER = 15; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.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. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + + public static final int LABELS_FIELD_NUMBER = 6; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Backup_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATE_FIELD_NUMBER = 7; + private int state_ = 0; + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Backup.State getState() { + com.google.cloud.alloydb.v1alpha.Backup.State result = + com.google.cloud.alloydb.v1alpha.Backup.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1alpha.Backup.State.UNRECOGNIZED : result; + } + + public static final int TYPE_FIELD_NUMBER = 8; + private int type_ = 0; + /** + * + * + *
+   * The backup type, which suggests the trigger for the backup.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Backup.Type type = 8; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * The backup type, which suggests the trigger for the backup.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Backup.Type type = 8; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Backup.Type getType() { + com.google.cloud.alloydb.v1alpha.Backup.Type result = + com.google.cloud.alloydb.v1alpha.Backup.Type.forNumber(type_); + return result == null ? com.google.cloud.alloydb.v1alpha.Backup.Type.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * User-provided description of the backup.
+   * 
+ * + * string description = 9; + * + * @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; + } + } + /** + * + * + *
+   * User-provided description of the backup.
+   * 
+ * + * string description = 9; + * + * @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 CLUSTER_UID_FIELD_NUMBER = 18; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterUid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UID of the cluster which was used to
+   * create this resource.
+   * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clusterUid. + */ + @java.lang.Override + public java.lang.String getClusterUid() { + java.lang.Object ref = clusterUid_; + 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(); + clusterUid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UID of the cluster which was used to
+   * create this resource.
+   * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clusterUid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterUidBytes() { + java.lang.Object ref = clusterUid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_NAME_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterName_ = ""; + /** + * + * + *
+   * Required. The full resource name of the backup source cluster
+   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The clusterName. + */ + @java.lang.Override + public java.lang.String getClusterName() { + java.lang.Object ref = clusterName_; + 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(); + clusterName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The full resource name of the backup source cluster
+   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for clusterName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterNameBytes() { + java.lang.Object ref = clusterName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECONCILING_FIELD_NUMBER = 11; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
+   * true, indicates that the service is actively updating the resource. This
+   * can happen due to user-triggered updates or system actions like failover or
+   * maintenance.
+   * 
+ * + * bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 12; + private com.google.cloud.alloydb.v1alpha.EncryptionConfig encryptionConfig_; + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return encryptionConfig_ != null; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + public static final int ENCRYPTION_INFO_FIELD_NUMBER = 13; + private com.google.cloud.alloydb.v1alpha.EncryptionInfo encryptionInfo_; + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + @java.lang.Override + public boolean hasEncryptionInfo() { + return encryptionInfo_ != null; + } + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionInfo getEncryptionInfo() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + + public static final int ETAG_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 14; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 14; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 16; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Backup_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SIZE_BYTES_FIELD_NUMBER = 17; + private long sizeBytes_ = 0L; + /** + * + * + *
+   * Output only. The size of the backup in bytes.
+   * 
+ * + * int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + @java.lang.Override + public long getSizeBytes() { + return sizeBytes_; + } + + public static final int EXPIRY_TIME_FIELD_NUMBER = 19; + private com.google.protobuf.Timestamp expiryTime_; + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expiryTime field is set. + */ + @java.lang.Override + public boolean hasExpiryTime() { + return expiryTime_ != null; + } + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expiryTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpiryTime() { + return expiryTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expiryTime_; + } + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder() { + return expiryTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expiryTime_; + } + + 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(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uid_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 6); + if (state_ != com.google.cloud.alloydb.v1alpha.Backup.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(7, state_); + } + if (type_ != com.google.cloud.alloydb.v1alpha.Backup.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, clusterName_); + } + if (reconciling_ != false) { + output.writeBool(11, reconciling_); + } + if (encryptionConfig_ != null) { + output.writeMessage(12, getEncryptionConfig()); + } + if (encryptionInfo_ != null) { + output.writeMessage(13, getEncryptionInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, etag_); + } + if (deleteTime_ != null) { + output.writeMessage(15, getDeleteTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 16); + if (sizeBytes_ != 0L) { + output.writeInt64(17, sizeBytes_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterUid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 18, clusterUid_); + } + if (expiryTime_ != null) { + output.writeMessage(19, getExpiryTime()); + } + 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(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uid_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, labels__); + } + if (state_ != com.google.cloud.alloydb.v1alpha.Backup.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, state_); + } + if (type_ != com.google.cloud.alloydb.v1alpha.Backup.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, clusterName_); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, reconciling_); + } + if (encryptionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getEncryptionConfig()); + } + if (encryptionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getEncryptionInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, etag_); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getDeleteTime()); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, annotations__); + } + if (sizeBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(17, sizeBytes_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterUid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, clusterUid_); + } + if (expiryTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getExpiryTime()); + } + 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.alloydb.v1alpha.Backup)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.Backup other = (com.google.cloud.alloydb.v1alpha.Backup) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (state_ != other.state_) return false; + if (type_ != other.type_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getClusterUid().equals(other.getClusterUid())) return false; + if (!getClusterName().equals(other.getClusterName())) return false; + if (getReconciling() != other.getReconciling()) return false; + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) return false; + } + if (hasEncryptionInfo() != other.hasEncryptionInfo()) return false; + if (hasEncryptionInfo()) { + if (!getEncryptionInfo().equals(other.getEncryptionInfo())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (getSizeBytes() != other.getSizeBytes()) return false; + if (hasExpiryTime() != other.hasExpiryTime()) return false; + if (hasExpiryTime()) { + if (!getExpiryTime().equals(other.getExpiryTime())) 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(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + CLUSTER_UID_FIELD_NUMBER; + hash = (53 * hash) + getClusterUid().hashCode(); + hash = (37 * hash) + CLUSTER_NAME_FIELD_NUMBER; + hash = (53 * hash) + getClusterName().hashCode(); + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } + if (hasEncryptionInfo()) { + hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionInfo().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (37 * hash) + SIZE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSizeBytes()); + if (hasExpiryTime()) { + hash = (37 * hash) + EXPIRY_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpiryTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.Backup parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Backup 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.alloydb.v1alpha.Backup parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Backup 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.alloydb.v1alpha.Backup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Backup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Backup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Backup 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.alloydb.v1alpha.Backup parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Backup 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.alloydb.v1alpha.Backup parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Backup 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.alloydb.v1alpha.Backup 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; + } + /** + * + * + *
+   * Message describing Backup object
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Backup} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.Backup) + com.google.cloud.alloydb.v1alpha.BackupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Backup_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetLabels(); + case 16: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 6: + return internalGetMutableLabels(); + case 16: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Backup.class, + com.google.cloud.alloydb.v1alpha.Backup.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.Backup.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + uid_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + state_ = 0; + type_ = 0; + description_ = ""; + clusterUid_ = ""; + clusterName_ = ""; + reconciling_ = false; + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + etag_ = ""; + internalGetMutableAnnotations().clear(); + sizeBytes_ = 0L; + expiryTime_ = null; + if (expiryTimeBuilder_ != null) { + expiryTimeBuilder_.dispose(); + expiryTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Backup_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Backup getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.Backup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Backup build() { + com.google.cloud.alloydb.v1alpha.Backup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Backup buildPartial() { + com.google.cloud.alloydb.v1alpha.Backup result = + new com.google.cloud.alloydb.v1alpha.Backup(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.Backup result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.clusterUid_ = clusterUid_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.clusterName_ = clusterName_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.encryptionConfig_ = + encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.encryptionInfo_ = + encryptionInfoBuilder_ == null ? encryptionInfo_ : encryptionInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.sizeBytes_ = sizeBytes_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.expiryTime_ = expiryTimeBuilder_ == null ? expiryTime_ : expiryTimeBuilder_.build(); + } + } + + @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.alloydb.v1alpha.Backup) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.Backup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.Backup other) { + if (other == com.google.cloud.alloydb.v1alpha.Backup.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000040; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (!other.getClusterUid().isEmpty()) { + clusterUid_ = other.clusterUid_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (!other.getClusterName().isEmpty()) { + clusterName_ = other.clusterName_; + bitField0_ |= 0x00000800; + onChanged(); + } + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } + if (other.hasEncryptionInfo()) { + mergeEncryptionInfo(other.getEncryptionInfo()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00008000; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00010000; + if (other.getSizeBytes() != 0L) { + setSizeBytes(other.getSizeBytes()); + } + if (other.hasExpiryTime()) { + mergeExpiryTime(other.getExpiryTime()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 56: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 56 + case 64: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 64 + case 74: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 74 + case 82: + { + clusterName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 82 + case 88: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00001000; + break; + } // case 88 + case 98: + { + input.readMessage( + getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 98 + case 106: + { + input.readMessage(getEncryptionInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00004000; + break; + } // case 106 + case 114: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 114 + case 122: + { + input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 122 + case 130: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00010000; + break; + } // case 130 + case 136: + { + sizeBytes_ = input.readInt64(); + bitField0_ |= 0x00020000; + break; + } // case 136 + case 146: + { + clusterUid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 146 + case 154: + { + input.readMessage(getExpiryTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 154 + 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_ = ""; + /** + * + * + *
+     * Output only. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * where the cluster and backup ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the backup resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * where the cluster and backup ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the backup resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * where the cluster and backup ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the backup resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * where the cluster and backup ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the backup resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * where the cluster and backup ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the backup resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * User-settable and human-readable display name for the Backup.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Backup.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Backup.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Backup.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Backup.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + 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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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 deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.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; + } else { + deleteTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); + } else { + deleteTime_ = value; + } + } else { + deleteTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + bitField0_ = (bitField0_ & ~0x00000020); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.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_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000040; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000040; + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Backup.State getState() { + com.google.cloud.alloydb.v1alpha.Backup.State result = + com.google.cloud.alloydb.v1alpha.Backup.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1alpha.Backup.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.alloydb.v1alpha.Backup.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000080); + state_ = 0; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * The backup type, which suggests the trigger for the backup.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Backup.Type type = 8; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * The backup type, which suggests the trigger for the backup.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Backup.Type type = 8; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The backup type, which suggests the trigger for the backup.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Backup.Type type = 8; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Backup.Type getType() { + com.google.cloud.alloydb.v1alpha.Backup.Type result = + com.google.cloud.alloydb.v1alpha.Backup.Type.forNumber(type_); + return result == null ? com.google.cloud.alloydb.v1alpha.Backup.Type.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The backup type, which suggests the trigger for the backup.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Backup.Type type = 8; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.alloydb.v1alpha.Backup.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The backup type, which suggests the trigger for the backup.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Backup.Type type = 8; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000100); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * User-provided description of the backup.
+     * 
+ * + * string description = 9; + * + * @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; + } + } + /** + * + * + *
+     * User-provided description of the backup.
+     * 
+ * + * string description = 9; + * + * @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; + } + } + /** + * + * + *
+     * User-provided description of the backup.
+     * 
+ * + * string description = 9; + * + * @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; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * User-provided description of the backup.
+     * 
+ * + * string description = 9; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * User-provided description of the backup.
+     * 
+ * + * string description = 9; + * + * @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; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.lang.Object clusterUid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UID of the cluster which was used to
+     * create this resource.
+     * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clusterUid. + */ + public java.lang.String getClusterUid() { + java.lang.Object ref = clusterUid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterUid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the cluster which was used to
+     * create this resource.
+     * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clusterUid. + */ + public com.google.protobuf.ByteString getClusterUidBytes() { + java.lang.Object ref = clusterUid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the cluster which was used to
+     * create this resource.
+     * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The clusterUid to set. + * @return This builder for chaining. + */ + public Builder setClusterUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterUid_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the cluster which was used to
+     * create this resource.
+     * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearClusterUid() { + clusterUid_ = getDefaultInstance().getClusterUid(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the cluster which was used to
+     * create this resource.
+     * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for clusterUid to set. + * @return This builder for chaining. + */ + public Builder setClusterUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterUid_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.lang.Object clusterName_ = ""; + /** + * + * + *
+     * Required. The full resource name of the backup source cluster
+     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The clusterName. + */ + public java.lang.String getClusterName() { + java.lang.Object ref = clusterName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The full resource name of the backup source cluster
+     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for clusterName. + */ + public com.google.protobuf.ByteString getClusterNameBytes() { + java.lang.Object ref = clusterName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The full resource name of the backup source cluster
+     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The clusterName to set. + * @return This builder for chaining. + */ + public Builder setClusterName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterName_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource name of the backup source cluster
+     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearClusterName() { + clusterName_ = getDefaultInstance().getClusterName(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource name of the backup source cluster
+     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for clusterName to set. + * @return This builder for chaining. + */ + public Builder setClusterNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterName_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
+     * true, indicates that the service is actively updating the resource. This
+     * can happen due to user-triggered updates or system actions like failover or
+     * maintenance.
+     * 
+ * + * bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
+     * true, indicates that the service is actively updating the resource. This
+     * can happen due to user-triggered updates or system actions like failover or
+     * maintenance.
+     * 
+ * + * bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
+     * true, indicates that the service is actively updating the resource. This
+     * can happen due to user-triggered updates or system actions like failover or
+     * maintenance.
+     * 
+ * + * bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00001000); + reconciling_ = false; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1alpha.EncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionConfig, + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder> + encryptionConfigBuilder_; + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + public com.google.cloud.alloydb.v1alpha.EncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig(com.google.cloud.alloydb.v1alpha.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + } else { + encryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig( + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1alpha.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); + } else { + encryptionConfig_ = value; + } + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEncryptionConfig() { + bitField0_ = (bitField0_ & ~0x00002000); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder getEncryptionConfigBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getEncryptionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionConfig, + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder> + getEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionConfig, + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + + private com.google.cloud.alloydb.v1alpha.EncryptionInfo encryptionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionInfo, + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder> + encryptionInfoBuilder_; + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + public boolean hasEncryptionInfo() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + public com.google.cloud.alloydb.v1alpha.EncryptionInfo getEncryptionInfo() { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } else { + return encryptionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo(com.google.cloud.alloydb.v1alpha.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionInfo_ = value; + } else { + encryptionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo( + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = builderForValue.build(); + } else { + encryptionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEncryptionInfo(com.google.cloud.alloydb.v1alpha.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0) + && encryptionInfo_ != null + && encryptionInfo_ + != com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance()) { + getEncryptionInfoBuilder().mergeFrom(value); + } else { + encryptionInfo_ = value; + } + } else { + encryptionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEncryptionInfo() { + bitField0_ = (bitField0_ & ~0x00004000); + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder getEncryptionInfoBuilder() { + bitField0_ |= 0x00004000; + onChanged(); + return getEncryptionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + if (encryptionInfoBuilder_ != null) { + return encryptionInfoBuilder_.getMessageOrBuilder(); + } else { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionInfo, + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder> + getEncryptionInfoFieldBuilder() { + if (encryptionInfoBuilder_ == null) { + encryptionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionInfo, + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder>( + getEncryptionInfo(), getParentForChildren(), isClean()); + encryptionInfo_ = null; + } + return encryptionInfoBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 14; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 14; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 14; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 14; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 14; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00010000; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00010000); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00010000; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00010000; + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00010000; + return this; + } + + private long sizeBytes_; + /** + * + * + *
+     * Output only. The size of the backup in bytes.
+     * 
+ * + * int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + @java.lang.Override + public long getSizeBytes() { + return sizeBytes_; + } + /** + * + * + *
+     * Output only. The size of the backup in bytes.
+     * 
+ * + * int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sizeBytes to set. + * @return This builder for chaining. + */ + public Builder setSizeBytes(long value) { + + sizeBytes_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The size of the backup in bytes.
+     * 
+ * + * int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSizeBytes() { + bitField0_ = (bitField0_ & ~0x00020000); + sizeBytes_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expiryTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expiryTimeBuilder_; + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expiryTime field is set. + */ + public boolean hasExpiryTime() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expiryTime. + */ + public com.google.protobuf.Timestamp getExpiryTime() { + if (expiryTimeBuilder_ == null) { + return expiryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expiryTime_; + } else { + return expiryTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpiryTime(com.google.protobuf.Timestamp value) { + if (expiryTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiryTime_ = value; + } else { + expiryTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpiryTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expiryTimeBuilder_ == null) { + expiryTime_ = builderForValue.build(); + } else { + expiryTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeExpiryTime(com.google.protobuf.Timestamp value) { + if (expiryTimeBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) + && expiryTime_ != null + && expiryTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpiryTimeBuilder().mergeFrom(value); + } else { + expiryTime_ = value; + } + } else { + expiryTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearExpiryTime() { + bitField0_ = (bitField0_ & ~0x00040000); + expiryTime_ = null; + if (expiryTimeBuilder_ != null) { + expiryTimeBuilder_.dispose(); + expiryTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getExpiryTimeBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return getExpiryTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder() { + if (expiryTimeBuilder_ != null) { + return expiryTimeBuilder_.getMessageOrBuilder(); + } else { + return expiryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expiryTime_; + } + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpiryTimeFieldBuilder() { + if (expiryTimeBuilder_ == null) { + expiryTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpiryTime(), getParentForChildren(), isClean()); + expiryTime_ = null; + } + return expiryTimeBuilder_; + } + + @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.alloydb.v1alpha.Backup) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.Backup) + private static final com.google.cloud.alloydb.v1alpha.Backup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.Backup(); + } + + public static com.google.cloud.alloydb.v1alpha.Backup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Backup 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.alloydb.v1alpha.Backup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupName.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupName.java new file mode 100644 index 000000000000..649841af509c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupName.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.alloydb.v1alpha; + +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 BackupName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_BACKUP = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/backups/{backup}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String backup; + + @Deprecated + protected BackupName() { + project = null; + location = null; + backup = null; + } + + private BackupName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + backup = Preconditions.checkNotNull(builder.getBackup()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBackup() { + return backup; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BackupName of(String project, String location, String backup) { + return newBuilder().setProject(project).setLocation(location).setBackup(backup).build(); + } + + public static String format(String project, String location, String backup) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBackup(backup) + .build() + .toString(); + } + + public static BackupName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_BACKUP.validatedMatch( + formattedString, "BackupName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("backup")); + } + + 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 (BackupName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_BACKUP.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 (backup != null) { + fieldMapBuilder.put("backup", backup); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_BACKUP.instantiate( + "project", project, "location", location, "backup", backup); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + BackupName that = ((BackupName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.backup, that.backup); + } + 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(backup); + return h; + } + + /** Builder for projects/{project}/locations/{location}/backups/{backup}. */ + public static class Builder { + private String project; + private String location; + private String backup; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBackup() { + return backup; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setBackup(String backup) { + this.backup = backup; + return this; + } + + private Builder(BackupName backupName) { + this.project = backupName.project; + this.location = backupName.location; + this.backup = backupName.backup; + } + + public BackupName build() { + return new BackupName(this); + } + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupOrBuilder.java new file mode 100644 index 000000000000..5dc78055239b --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupOrBuilder.java @@ -0,0 +1,684 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface BackupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.Backup) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * where the cluster and backup ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the backup resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * where the cluster and backup ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the backup resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * User-settable and human-readable display name for the Backup.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * User-settable and human-readable display name for the Backup.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.alloydb.v1alpha.Backup.State getState(); + + /** + * + * + *
+   * The backup type, which suggests the trigger for the backup.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Backup.Type type = 8; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * The backup type, which suggests the trigger for the backup.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Backup.Type type = 8; + * + * @return The type. + */ + com.google.cloud.alloydb.v1alpha.Backup.Type getType(); + + /** + * + * + *
+   * User-provided description of the backup.
+   * 
+ * + * string description = 9; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * User-provided description of the backup.
+   * 
+ * + * string description = 9; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The system-generated UID of the cluster which was used to
+   * create this resource.
+   * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clusterUid. + */ + java.lang.String getClusterUid(); + /** + * + * + *
+   * Output only. The system-generated UID of the cluster which was used to
+   * create this resource.
+   * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clusterUid. + */ + com.google.protobuf.ByteString getClusterUidBytes(); + + /** + * + * + *
+   * Required. The full resource name of the backup source cluster
+   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The clusterName. + */ + java.lang.String getClusterName(); + /** + * + * + *
+   * Required. The full resource name of the backup source cluster
+   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for clusterName. + */ + com.google.protobuf.ByteString getClusterNameBytes(); + + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
+   * true, indicates that the service is actively updating the resource. This
+   * can happen due to user-triggered updates or system actions like failover or
+   * maintenance.
+   * 
+ * + * bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + com.google.cloud.alloydb.v1alpha.EncryptionConfig getEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); + + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + boolean hasEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + com.google.cloud.alloydb.v1alpha.EncryptionInfo getEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(); + + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 14; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 14; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The size of the backup in bytes.
+   * 
+ * + * int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + long getSizeBytes(); + + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expiryTime field is set. + */ + boolean hasExpiryTime(); + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expiryTime. + */ + com.google.protobuf.Timestamp getExpiryTime(); + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupSource.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupSource.java new file mode 100644 index 000000000000..0b07d9116fea --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupSource.java @@ -0,0 +1,845 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message describing a BackupSource.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.BackupSource} + */ +public final class BackupSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.BackupSource) + BackupSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use BackupSource.newBuilder() to construct. + private BackupSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BackupSource() { + backupUid_ = ""; + backupName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BackupSource(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_BackupSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_BackupSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.BackupSource.class, + com.google.cloud.alloydb.v1alpha.BackupSource.Builder.class); + } + + public static final int BACKUP_UID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupUid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UID of the backup which was used to
+   * create this resource. The UID is generated when the backup is created, and
+   * it is retained until the backup is deleted.
+   * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backupUid. + */ + @java.lang.Override + public java.lang.String getBackupUid() { + java.lang.Object ref = backupUid_; + 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(); + backupUid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UID of the backup which was used to
+   * create this resource. The UID is generated when the backup is created, and
+   * it is retained until the backup is deleted.
+   * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backupUid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupUidBytes() { + java.lang.Object ref = backupUid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupName_ = ""; + /** + * + * + *
+   * Required. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The backupName. + */ + @java.lang.Override + public java.lang.String getBackupName() { + java.lang.Object ref = backupName_; + 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(); + backupName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for backupName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupNameBytes() { + java.lang.Object ref = backupName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupName_ = 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(backupName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, backupName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupUid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, backupUid_); + } + 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(backupName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, backupName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupUid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, backupUid_); + } + 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.alloydb.v1alpha.BackupSource)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.BackupSource other = + (com.google.cloud.alloydb.v1alpha.BackupSource) obj; + + if (!getBackupUid().equals(other.getBackupUid())) return false; + if (!getBackupName().equals(other.getBackupName())) 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) + BACKUP_UID_FIELD_NUMBER; + hash = (53 * hash) + getBackupUid().hashCode(); + hash = (37 * hash) + BACKUP_NAME_FIELD_NUMBER; + hash = (53 * hash) + getBackupName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.BackupSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.BackupSource 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.alloydb.v1alpha.BackupSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.BackupSource 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.alloydb.v1alpha.BackupSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.BackupSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.BackupSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.BackupSource 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.alloydb.v1alpha.BackupSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.BackupSource 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.alloydb.v1alpha.BackupSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.BackupSource 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.alloydb.v1alpha.BackupSource 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; + } + /** + * + * + *
+   * Message describing a BackupSource.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.BackupSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.BackupSource) + com.google.cloud.alloydb.v1alpha.BackupSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_BackupSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_BackupSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.BackupSource.class, + com.google.cloud.alloydb.v1alpha.BackupSource.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.BackupSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backupUid_ = ""; + backupName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_BackupSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BackupSource getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BackupSource build() { + com.google.cloud.alloydb.v1alpha.BackupSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BackupSource buildPartial() { + com.google.cloud.alloydb.v1alpha.BackupSource result = + new com.google.cloud.alloydb.v1alpha.BackupSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.BackupSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backupUid_ = backupUid_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backupName_ = backupName_; + } + } + + @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.alloydb.v1alpha.BackupSource) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.BackupSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.BackupSource other) { + if (other == com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance()) return this; + if (!other.getBackupUid().isEmpty()) { + backupUid_ = other.backupUid_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getBackupName().isEmpty()) { + backupName_ = other.backupName_; + bitField0_ |= 0x00000002; + 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: + { + backupName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + backupUid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + 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 backupUid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UID of the backup which was used to
+     * create this resource. The UID is generated when the backup is created, and
+     * it is retained until the backup is deleted.
+     * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backupUid. + */ + public java.lang.String getBackupUid() { + java.lang.Object ref = backupUid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupUid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the backup which was used to
+     * create this resource. The UID is generated when the backup is created, and
+     * it is retained until the backup is deleted.
+     * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backupUid. + */ + public com.google.protobuf.ByteString getBackupUidBytes() { + java.lang.Object ref = backupUid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the backup which was used to
+     * create this resource. The UID is generated when the backup is created, and
+     * it is retained until the backup is deleted.
+     * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The backupUid to set. + * @return This builder for chaining. + */ + public Builder setBackupUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupUid_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the backup which was used to
+     * create this resource. The UID is generated when the backup is created, and
+     * it is retained until the backup is deleted.
+     * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearBackupUid() { + backupUid_ = getDefaultInstance().getBackupUid(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the backup which was used to
+     * create this resource. The UID is generated when the backup is created, and
+     * it is retained until the backup is deleted.
+     * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for backupUid to set. + * @return This builder for chaining. + */ + public Builder setBackupUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupUid_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object backupName_ = ""; + /** + * + * + *
+     * Required. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The backupName. + */ + public java.lang.String getBackupName() { + java.lang.Object ref = backupName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for backupName. + */ + public com.google.protobuf.ByteString getBackupNameBytes() { + java.lang.Object ref = backupName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The backupName to set. + * @return This builder for chaining. + */ + public Builder setBackupName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearBackupName() { + backupName_ = getDefaultInstance().getBackupName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for backupName to set. + * @return This builder for chaining. + */ + public Builder setBackupNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupName_ = value; + bitField0_ |= 0x00000002; + 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.alloydb.v1alpha.BackupSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.BackupSource) + private static final com.google.cloud.alloydb.v1alpha.BackupSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.BackupSource(); + } + + public static com.google.cloud.alloydb.v1alpha.BackupSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupSource 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.alloydb.v1alpha.BackupSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupSourceOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupSourceOrBuilder.java new file mode 100644 index 000000000000..d197a7adad8c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupSourceOrBuilder.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/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface BackupSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.BackupSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The system-generated UID of the backup which was used to
+   * create this resource. The UID is generated when the backup is created, and
+   * it is retained until the backup is deleted.
+   * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backupUid. + */ + java.lang.String getBackupUid(); + /** + * + * + *
+   * Output only. The system-generated UID of the backup which was used to
+   * create this resource. The UID is generated when the backup is created, and
+   * it is retained until the backup is deleted.
+   * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backupUid. + */ + com.google.protobuf.ByteString getBackupUidBytes(); + + /** + * + * + *
+   * Required. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The backupName. + */ + java.lang.String getBackupName(); + /** + * + * + *
+   * Required. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for backupName. + */ + com.google.protobuf.ByteString getBackupNameBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstanceStatus.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstanceStatus.java new file mode 100644 index 000000000000..64de2f4819ae --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstanceStatus.java @@ -0,0 +1,1501 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for current status of an instance in the BatchCreateInstances
+ * operation.
+ * For example, lets say a BatchCreateInstances workflow has 4 instances,
+ * Instance1 through Instance4. Lets also assume that 2 instances succeeded
+ * but the third failed to create and the 4th was never picked up for creation
+ * because of failure of the previous one. Then, resulting states would look
+ * something like:
+ *   1. Instance1 = ROLLED_BACK
+ *   2. Instance2 = ROLLED_BACK
+ *   3. Instance3 = FAILED
+ *   4. Instance4 = FAILED
+ * However, while the operation is running, the instance might be in other
+ * states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states
+ * / do not get further updated once the operation is done.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} + */ +public final class BatchCreateInstanceStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus) + BatchCreateInstanceStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchCreateInstanceStatus.newBuilder() to construct. + private BatchCreateInstanceStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchCreateInstanceStatus() { + state_ = 0; + errorMsg_ = ""; + type_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateInstanceStatus(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstanceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstanceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.class, + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.Builder.class); + } + + /** + * + * + *
+   * State contains all valid instance states for the BatchCreateInstances
+   * operation. This is mainly used for status reporting through the LRO
+   * metadata.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Instance is pending creation and has not yet been picked up for
+     * processsing in the backend.
+     * 
+ * + * PENDING_CREATE = 1; + */ + PENDING_CREATE(1), + /** + * + * + *
+     * The instance is active and running.
+     * 
+ * + * READY = 2; + */ + READY(2), + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 3; + */ + CREATING(3), + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * an operation on the instance or a batch of instances.
+     * 
+ * + * FAILED = 5; + */ + FAILED(5), + /** + * + * + *
+     * The instance was created successfully, but was rolled back and deleted
+     * due to some other failure during BatchCreateInstances operation.
+     * 
+ * + * ROLLED_BACK = 6; + */ + ROLLED_BACK(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Instance is pending creation and has not yet been picked up for
+     * processsing in the backend.
+     * 
+ * + * PENDING_CREATE = 1; + */ + public static final int PENDING_CREATE_VALUE = 1; + /** + * + * + *
+     * The instance is active and running.
+     * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 3; + */ + public static final int CREATING_VALUE = 3; + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * an operation on the instance or a batch of instances.
+     * 
+ * + * FAILED = 5; + */ + public static final int FAILED_VALUE = 5; + /** + * + * + *
+     * The instance was created successfully, but was rolled back and deleted
+     * due to some other failure during BatchCreateInstances operation.
+     * 
+ * + * ROLLED_BACK = 6; + */ + public static final int ROLLED_BACK_VALUE = 6; + + 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 PENDING_CREATE; + case 2: + return READY; + case 3: + return CREATING; + case 4: + return DELETING; + case 5: + return FAILED; + case 6: + return ROLLED_BACK; + 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.alloydb.v1alpha.BatchCreateInstanceStatus.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.alloydb.v1alpha.BatchCreateInstanceStatus.State) + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_ = 0; + /** + * + * + *
+   * The current state of an instance involved in the batch create operation.
+   * Once the operation is complete, the final state of the instances in the
+   * LRO can be one of:
+   *   1. ACTIVE, indicating that instances were created successfully
+   *   2. FAILED, indicating that a particular instance failed creation
+   *   3. ROLLED_BACK indicating that although the instance was created
+   *      successfully, it had to be rolled back and deleted due to failure in
+   *      other steps of the workflow.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The current state of an instance involved in the batch create operation.
+   * Once the operation is complete, the final state of the instances in the
+   * LRO can be one of:
+   *   1. ACTIVE, indicating that instances were created successfully
+   *   2. FAILED, indicating that a particular instance failed creation
+   *   3. ROLLED_BACK indicating that although the instance was created
+   *      successfully, it had to be rolled back and deleted due to failure in
+   *      other steps of the workflow.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State getState() { + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State result = + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State.forNumber(state_); + return result == null + ? com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State.UNRECOGNIZED + : result; + } + + public static final int ERROR_MSG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object errorMsg_ = ""; + /** + * + * + *
+   * DEPRECATED - Use the error field instead.
+   * Error, if any error occurred and is available, during instance creation.
+   * 
+ * + * string error_msg = 2; + * + * @return The errorMsg. + */ + @java.lang.Override + public java.lang.String getErrorMsg() { + java.lang.Object ref = errorMsg_; + 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(); + errorMsg_ = s; + return s; + } + } + /** + * + * + *
+   * DEPRECATED - Use the error field instead.
+   * Error, if any error occurred and is available, during instance creation.
+   * 
+ * + * string error_msg = 2; + * + * @return The bytes for errorMsg. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorMsgBytes() { + java.lang.Object ref = errorMsg_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMsg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_FIELD_NUMBER = 4; + private com.google.rpc.Status error_; + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + + public static final int TYPE_FIELD_NUMBER = 3; + private int type_ = 0; + /** + * .google.cloud.alloydb.v1alpha.Instance.InstanceType type = 3; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * .google.cloud.alloydb.v1alpha.Instance.InstanceType type = 3; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.InstanceType getType() { + com.google.cloud.alloydb.v1alpha.Instance.InstanceType result = + com.google.cloud.alloydb.v1alpha.Instance.InstanceType.forNumber(type_); + return result == null + ? com.google.cloud.alloydb.v1alpha.Instance.InstanceType.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 (state_ + != com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMsg_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errorMsg_); + } + if (type_ + != com.google.cloud.alloydb.v1alpha.Instance.InstanceType.INSTANCE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, type_); + } + if (error_ != null) { + output.writeMessage(4, getError()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ + != com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMsg_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errorMsg_); + } + if (type_ + != com.google.cloud.alloydb.v1alpha.Instance.InstanceType.INSTANCE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_); + } + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getError()); + } + 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.alloydb.v1alpha.BatchCreateInstanceStatus)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus other = + (com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus) obj; + + if (state_ != other.state_) return false; + if (!getErrorMsg().equals(other.getErrorMsg())) return false; + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (type_ != other.type_) 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) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + ERROR_MSG_FIELD_NUMBER; + hash = (53 * hash) + getErrorMsg().hashCode(); + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus 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.alloydb.v1alpha.BatchCreateInstanceStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus 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.alloydb.v1alpha.BatchCreateInstanceStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus 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.alloydb.v1alpha.BatchCreateInstanceStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus 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.alloydb.v1alpha.BatchCreateInstanceStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus 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.alloydb.v1alpha.BatchCreateInstanceStatus 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; + } + /** + * + * + *
+   * Message for current status of an instance in the BatchCreateInstances
+   * operation.
+   * For example, lets say a BatchCreateInstances workflow has 4 instances,
+   * Instance1 through Instance4. Lets also assume that 2 instances succeeded
+   * but the third failed to create and the 4th was never picked up for creation
+   * because of failure of the previous one. Then, resulting states would look
+   * something like:
+   *   1. Instance1 = ROLLED_BACK
+   *   2. Instance2 = ROLLED_BACK
+   *   3. Instance3 = FAILED
+   *   4. Instance4 = FAILED
+   * However, while the operation is running, the instance might be in other
+   * states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states
+   * / do not get further updated once the operation is done.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus) + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstanceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstanceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.class, + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + state_ = 0; + errorMsg_ = ""; + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + type_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstanceStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus build() { + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus buildPartial() { + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus result = + new com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.errorMsg_ = errorMsg_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.type_ = type_; + } + } + + @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.alloydb.v1alpha.BatchCreateInstanceStatus) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus other) { + if (other == com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.getDefaultInstance()) + return this; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getErrorMsg().isEmpty()) { + errorMsg_ = other.errorMsg_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasError()) { + mergeError(other.getError()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + 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: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + errorMsg_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 24 + case 34: + { + input.readMessage(getErrorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + 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 int bitField0_; + + private int state_ = 0; + /** + * + * + *
+     * The current state of an instance involved in the batch create operation.
+     * Once the operation is complete, the final state of the instances in the
+     * LRO can be one of:
+     *   1. ACTIVE, indicating that instances were created successfully
+     *   2. FAILED, indicating that a particular instance failed creation
+     *   3. ROLLED_BACK indicating that although the instance was created
+     *      successfully, it had to be rolled back and deleted due to failure in
+     *      other steps of the workflow.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The current state of an instance involved in the batch create operation.
+     * Once the operation is complete, the final state of the instances in the
+     * LRO can be one of:
+     *   1. ACTIVE, indicating that instances were created successfully
+     *   2. FAILED, indicating that a particular instance failed creation
+     *   3. ROLLED_BACK indicating that although the instance was created
+     *      successfully, it had to be rolled back and deleted due to failure in
+     *      other steps of the workflow.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State state = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The current state of an instance involved in the batch create operation.
+     * Once the operation is complete, the final state of the instances in the
+     * LRO can be one of:
+     *   1. ACTIVE, indicating that instances were created successfully
+     *   2. FAILED, indicating that a particular instance failed creation
+     *   3. ROLLED_BACK indicating that although the instance was created
+     *      successfully, it had to be rolled back and deleted due to failure in
+     *      other steps of the workflow.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State getState() { + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State result = + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State.forNumber(state_); + return result == null + ? com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The current state of an instance involved in the batch create operation.
+     * Once the operation is complete, the final state of the instances in the
+     * LRO can be one of:
+     *   1. ACTIVE, indicating that instances were created successfully
+     *   2. FAILED, indicating that a particular instance failed creation
+     *   3. ROLLED_BACK indicating that although the instance was created
+     *      successfully, it had to be rolled back and deleted due to failure in
+     *      other steps of the workflow.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State state = 1; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState( + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The current state of an instance involved in the batch create operation.
+     * Once the operation is complete, the final state of the instances in the
+     * LRO can be one of:
+     *   1. ACTIVE, indicating that instances were created successfully
+     *   2. FAILED, indicating that a particular instance failed creation
+     *   3. ROLLED_BACK indicating that although the instance was created
+     *      successfully, it had to be rolled back and deleted due to failure in
+     *      other steps of the workflow.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State state = 1; + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000001); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object errorMsg_ = ""; + /** + * + * + *
+     * DEPRECATED - Use the error field instead.
+     * Error, if any error occurred and is available, during instance creation.
+     * 
+ * + * string error_msg = 2; + * + * @return The errorMsg. + */ + public java.lang.String getErrorMsg() { + java.lang.Object ref = errorMsg_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMsg_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * DEPRECATED - Use the error field instead.
+     * Error, if any error occurred and is available, during instance creation.
+     * 
+ * + * string error_msg = 2; + * + * @return The bytes for errorMsg. + */ + public com.google.protobuf.ByteString getErrorMsgBytes() { + java.lang.Object ref = errorMsg_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMsg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * DEPRECATED - Use the error field instead.
+     * Error, if any error occurred and is available, during instance creation.
+     * 
+ * + * string error_msg = 2; + * + * @param value The errorMsg to set. + * @return This builder for chaining. + */ + public Builder setErrorMsg(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + errorMsg_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * DEPRECATED - Use the error field instead.
+     * Error, if any error occurred and is available, during instance creation.
+     * 
+ * + * string error_msg = 2; + * + * @return This builder for chaining. + */ + public Builder clearErrorMsg() { + errorMsg_ = getDefaultInstance().getErrorMsg(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * DEPRECATED - Use the error field instead.
+     * Error, if any error occurred and is available, during instance creation.
+     * 
+ * + * string error_msg = 2; + * + * @param value The bytes for errorMsg to set. + * @return This builder for chaining. + */ + public Builder setErrorMsgBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + errorMsg_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.rpc.Status error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + * + * @return The error. + */ + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } else { + return errorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && error_ != null + && error_ != com.google.rpc.Status.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000004); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + private int type_ = 0; + /** + * .google.cloud.alloydb.v1alpha.Instance.InstanceType type = 3; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * .google.cloud.alloydb.v1alpha.Instance.InstanceType type = 3; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .google.cloud.alloydb.v1alpha.Instance.InstanceType type = 3; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.InstanceType getType() { + com.google.cloud.alloydb.v1alpha.Instance.InstanceType result = + com.google.cloud.alloydb.v1alpha.Instance.InstanceType.forNumber(type_); + return result == null + ? com.google.cloud.alloydb.v1alpha.Instance.InstanceType.UNRECOGNIZED + : result; + } + /** + * .google.cloud.alloydb.v1alpha.Instance.InstanceType type = 3; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.alloydb.v1alpha.Instance.InstanceType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .google.cloud.alloydb.v1alpha.Instance.InstanceType type = 3; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000008); + type_ = 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.alloydb.v1alpha.BatchCreateInstanceStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus) + private static final com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus(); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateInstanceStatus 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.alloydb.v1alpha.BatchCreateInstanceStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstanceStatusOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstanceStatusOrBuilder.java new file mode 100644 index 000000000000..d09566450911 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstanceStatusOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface BatchCreateInstanceStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The current state of an instance involved in the batch create operation.
+   * Once the operation is complete, the final state of the instances in the
+   * LRO can be one of:
+   *   1. ACTIVE, indicating that instances were created successfully
+   *   2. FAILED, indicating that a particular instance failed creation
+   *   3. ROLLED_BACK indicating that although the instance was created
+   *      successfully, it had to be rolled back and deleted due to failure in
+   *      other steps of the workflow.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The current state of an instance involved in the batch create operation.
+   * Once the operation is complete, the final state of the instances in the
+   * LRO can be one of:
+   *   1. ACTIVE, indicating that instances were created successfully
+   *   2. FAILED, indicating that a particular instance failed creation
+   *   3. ROLLED_BACK indicating that although the instance was created
+   *      successfully, it had to be rolled back and deleted due to failure in
+   *      other steps of the workflow.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State state = 1; + * + * @return The state. + */ + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State getState(); + + /** + * + * + *
+   * DEPRECATED - Use the error field instead.
+   * Error, if any error occurred and is available, during instance creation.
+   * 
+ * + * string error_msg = 2; + * + * @return The errorMsg. + */ + java.lang.String getErrorMsg(); + /** + * + * + *
+   * DEPRECATED - Use the error field instead.
+   * Error, if any error occurred and is available, during instance creation.
+   * 
+ * + * string error_msg = 2; + * + * @return The bytes for errorMsg. + */ + com.google.protobuf.ByteString getErrorMsgBytes(); + + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + * + * @return Whether the error field is set. + */ + boolean hasError(); + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + * + * @return The error. + */ + com.google.rpc.Status getError(); + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + * .google.cloud.alloydb.v1alpha.Instance.InstanceType type = 3; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * .google.cloud.alloydb.v1alpha.Instance.InstanceType type = 3; + * + * @return The type. + */ + com.google.cloud.alloydb.v1alpha.Instance.InstanceType getType(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesMetadata.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesMetadata.java new file mode 100644 index 000000000000..f3edfb55f590 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesMetadata.java @@ -0,0 +1,1220 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for metadata that is specific to BatchCreateInstances API.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} + */ +public final class BatchCreateInstancesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) + BatchCreateInstancesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchCreateInstancesMetadata.newBuilder() to construct. + private BatchCreateInstancesMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchCreateInstancesMetadata() { + instanceTargets_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateInstancesMetadata(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetInstanceStatuses(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.class, + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.Builder.class); + } + + public static final int INSTANCE_TARGETS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList instanceTargets_; + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @return A list containing the instanceTargets. + */ + public com.google.protobuf.ProtocolStringList getInstanceTargetsList() { + return instanceTargets_; + } + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @return The count of instanceTargets. + */ + public int getInstanceTargetsCount() { + return instanceTargets_.size(); + } + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the element to return. + * @return The instanceTargets at the given index. + */ + public java.lang.String getInstanceTargets(int index) { + return instanceTargets_.get(index); + } + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the value to return. + * @return The bytes of the instanceTargets at the given index. + */ + public com.google.protobuf.ByteString getInstanceTargetsBytes(int index) { + return instanceTargets_.getByteString(index); + } + + public static final int INSTANCE_STATUSES_FIELD_NUMBER = 2; + + private static final class InstanceStatusesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_InstanceStatusesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + .getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> + instanceStatuses_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> + internalGetInstanceStatuses() { + if (instanceStatuses_ == null) { + return com.google.protobuf.MapField.emptyMapField( + InstanceStatusesDefaultEntryHolder.defaultEntry); + } + return instanceStatuses_; + } + + public int getInstanceStatusesCount() { + return internalGetInstanceStatuses().getMap().size(); + } + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public boolean containsInstanceStatuses(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetInstanceStatuses().getMap().containsKey(key); + } + /** Use {@link #getInstanceStatusesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getInstanceStatuses() { + return getInstanceStatusesMap(); + } + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public java.util.Map + getInstanceStatusesMap() { + return internalGetInstanceStatuses().getMap(); + } + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + getInstanceStatusesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetInstanceStatuses().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus getInstanceStatusesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetInstanceStatuses().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 { + for (int i = 0; i < instanceTargets_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, instanceTargets_.getRaw(i)); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetInstanceStatuses(), InstanceStatusesDefaultEntryHolder.defaultEntry, 2); + 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 < instanceTargets_.size(); i++) { + dataSize += computeStringSizeNoTag(instanceTargets_.getRaw(i)); + } + size += dataSize; + size += 1 * getInstanceTargetsList().size(); + } + for (java.util.Map.Entry< + java.lang.String, com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> + entry : internalGetInstanceStatuses().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> + instanceStatuses__ = + InstanceStatusesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, instanceStatuses__); + } + 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.alloydb.v1alpha.BatchCreateInstancesMetadata)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata other = + (com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) obj; + + if (!getInstanceTargetsList().equals(other.getInstanceTargetsList())) return false; + if (!internalGetInstanceStatuses().equals(other.internalGetInstanceStatuses())) 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 (getInstanceTargetsCount() > 0) { + hash = (37 * hash) + INSTANCE_TARGETS_FIELD_NUMBER; + hash = (53 * hash) + getInstanceTargetsList().hashCode(); + } + if (!internalGetInstanceStatuses().getMap().isEmpty()) { + hash = (37 * hash) + INSTANCE_STATUSES_FIELD_NUMBER; + hash = (53 * hash) + internalGetInstanceStatuses().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata 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.alloydb.v1alpha.BatchCreateInstancesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata 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.alloydb.v1alpha.BatchCreateInstancesMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata 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.alloydb.v1alpha.BatchCreateInstancesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata 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.alloydb.v1alpha.BatchCreateInstancesMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata 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.alloydb.v1alpha.BatchCreateInstancesMetadata 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; + } + /** + * + * + *
+   * Message for metadata that is specific to BatchCreateInstances API.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetInstanceStatuses(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableInstanceStatuses(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.class, + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instanceTargets_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableInstanceStatuses().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata build() { + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata buildPartial() { + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata result = + new com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata result) { + if (((bitField0_ & 0x00000001) != 0)) { + instanceTargets_ = instanceTargets_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instanceTargets_ = instanceTargets_; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceStatuses_ = internalGetInstanceStatuses(); + result.instanceStatuses_.makeImmutable(); + } + } + + @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.alloydb.v1alpha.BatchCreateInstancesMetadata) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata other) { + if (other + == com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.getDefaultInstance()) + return this; + if (!other.instanceTargets_.isEmpty()) { + if (instanceTargets_.isEmpty()) { + instanceTargets_ = other.instanceTargets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstanceTargetsIsMutable(); + instanceTargets_.addAll(other.instanceTargets_); + } + onChanged(); + } + internalGetMutableInstanceStatuses().mergeFrom(other.internalGetInstanceStatuses()); + bitField0_ |= 0x00000002; + 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(); + ensureInstanceTargetsIsMutable(); + instanceTargets_.add(s); + break; + } // case 10 + case 18: + { + com.google.protobuf.MapEntry< + java.lang.String, + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> + instanceStatuses__ = + input.readMessage( + InstanceStatusesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableInstanceStatuses() + .getMutableMap() + .put(instanceStatuses__.getKey(), instanceStatuses__.getValue()); + bitField0_ |= 0x00000002; + 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.protobuf.LazyStringList instanceTargets_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureInstanceTargetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instanceTargets_ = new com.google.protobuf.LazyStringArrayList(instanceTargets_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @return A list containing the instanceTargets. + */ + public com.google.protobuf.ProtocolStringList getInstanceTargetsList() { + return instanceTargets_.getUnmodifiableView(); + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @return The count of instanceTargets. + */ + public int getInstanceTargetsCount() { + return instanceTargets_.size(); + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the element to return. + * @return The instanceTargets at the given index. + */ + public java.lang.String getInstanceTargets(int index) { + return instanceTargets_.get(index); + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the value to return. + * @return The bytes of the instanceTargets at the given index. + */ + public com.google.protobuf.ByteString getInstanceTargetsBytes(int index) { + return instanceTargets_.getByteString(index); + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index to set the value at. + * @param value The instanceTargets to set. + * @return This builder for chaining. + */ + public Builder setInstanceTargets(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstanceTargetsIsMutable(); + instanceTargets_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param value The instanceTargets to add. + * @return This builder for chaining. + */ + public Builder addInstanceTargets(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstanceTargetsIsMutable(); + instanceTargets_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param values The instanceTargets to add. + * @return This builder for chaining. + */ + public Builder addAllInstanceTargets(java.lang.Iterable values) { + ensureInstanceTargetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instanceTargets_); + onChanged(); + return this; + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstanceTargets() { + instanceTargets_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param value The bytes of the instanceTargets to add. + * @return This builder for chaining. + */ + public Builder addInstanceTargetsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureInstanceTargetsIsMutable(); + instanceTargets_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> + instanceStatuses_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> + internalGetInstanceStatuses() { + if (instanceStatuses_ == null) { + return com.google.protobuf.MapField.emptyMapField( + InstanceStatusesDefaultEntryHolder.defaultEntry); + } + return instanceStatuses_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> + internalGetMutableInstanceStatuses() { + if (instanceStatuses_ == null) { + instanceStatuses_ = + com.google.protobuf.MapField.newMapField( + InstanceStatusesDefaultEntryHolder.defaultEntry); + } + if (!instanceStatuses_.isMutable()) { + instanceStatuses_ = instanceStatuses_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + return instanceStatuses_; + } + + public int getInstanceStatusesCount() { + return internalGetInstanceStatuses().getMap().size(); + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public boolean containsInstanceStatuses(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetInstanceStatuses().getMap().containsKey(key); + } + /** Use {@link #getInstanceStatusesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> + getInstanceStatuses() { + return getInstanceStatusesMap(); + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> + getInstanceStatusesMap() { + return internalGetInstanceStatuses().getMap(); + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + getInstanceStatusesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetInstanceStatuses().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus getInstanceStatusesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetInstanceStatuses().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearInstanceStatuses() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableInstanceStatuses().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + public Builder removeInstanceStatuses(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableInstanceStatuses().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> + getMutableInstanceStatuses() { + bitField0_ |= 0x00000002; + return internalGetMutableInstanceStatuses().getMutableMap(); + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + public Builder putInstanceStatuses( + java.lang.String key, com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableInstanceStatuses().getMutableMap().put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + public Builder putAllInstanceStatuses( + java.util.Map + values) { + internalGetMutableInstanceStatuses().getMutableMap().putAll(values); + bitField0_ |= 0x00000002; + 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.alloydb.v1alpha.BatchCreateInstancesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) + private static final com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata(); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateInstancesMetadata 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.alloydb.v1alpha.BatchCreateInstancesMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesMetadataOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesMetadataOrBuilder.java new file mode 100644 index 000000000000..9e4591d16080 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesMetadataOrBuilder.java @@ -0,0 +1,184 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface BatchCreateInstancesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @return A list containing the instanceTargets. + */ + java.util.List getInstanceTargetsList(); + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @return The count of instanceTargets. + */ + int getInstanceTargetsCount(); + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the element to return. + * @return The instanceTargets at the given index. + */ + java.lang.String getInstanceTargets(int index); + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the value to return. + * @return The bytes of the instanceTargets at the given index. + */ + com.google.protobuf.ByteString getInstanceTargetsBytes(int index); + + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + int getInstanceStatusesCount(); + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + boolean containsInstanceStatuses(java.lang.String key); + /** Use {@link #getInstanceStatusesMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getInstanceStatuses(); + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + java.util.Map + getInstanceStatusesMap(); + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + /* nullable */ + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus getInstanceStatusesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus defaultValue); + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + com.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus getInstanceStatusesOrThrow( + java.lang.String key); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesRequest.java new file mode 100644 index 000000000000..1604e9008345 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesRequest.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/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for creating a batch of instances under the specified cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} + */ +public final class BatchCreateInstancesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest) + BatchCreateInstancesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchCreateInstancesRequest.newBuilder() to construct. + private BatchCreateInstancesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchCreateInstancesRequest() { + parent_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateInstancesRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.class, + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource.
+   * 
+ * + * + * 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 parent resource.
+   * 
+ * + * + * 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 REQUESTS_FIELD_NUMBER = 2; + private com.google.cloud.alloydb.v1alpha.CreateInstanceRequests requests_; + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the requests field is set. + */ + @java.lang.Override + public boolean hasRequests() { + return requests_ != null; + } + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The requests. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequests getRequests() { + return requests_ == null + ? com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.getDefaultInstance() + : requests_; + } + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequestsOrBuilder getRequestsOrBuilder() { + return requests_ == null + ? com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.getDefaultInstance() + : requests_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (requests_ != null) { + output.writeMessage(2, getRequests()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, 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(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (requests_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequests()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, 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.alloydb.v1alpha.BatchCreateInstancesRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest other = + (com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasRequests() != other.hasRequests()) return false; + if (hasRequests()) { + if (!getRequests().equals(other.getRequests())) return false; + } + 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasRequests()) { + hash = (37 * hash) + REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getRequests().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.alloydb.v1alpha.BatchCreateInstancesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest 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.alloydb.v1alpha.BatchCreateInstancesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest 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.alloydb.v1alpha.BatchCreateInstancesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest 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.alloydb.v1alpha.BatchCreateInstancesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest 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.alloydb.v1alpha.BatchCreateInstancesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest 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.alloydb.v1alpha.BatchCreateInstancesRequest 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; + } + /** + * + * + *
+   * Message for creating a batch of instances under the specified cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest) + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.class, + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + requests_ = null; + if (requestsBuilder_ != null) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + } + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest build() { + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest result = + new com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requests_ = requestsBuilder_ == null ? requests_ : requestsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + } + + @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.alloydb.v1alpha.BatchCreateInstancesRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest other) { + if (other + == com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasRequests()) { + mergeRequests(other.getRequests()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getRequestsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + 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 parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource.
+     * 
+ * + * + * 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 parent resource.
+     * 
+ * + * + * 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 parent resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1alpha.CreateInstanceRequests requests_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.Builder, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequestsOrBuilder> + requestsBuilder_; + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the requests field is set. + */ + public boolean hasRequests() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The requests. + */ + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequests getRequests() { + if (requestsBuilder_ == null) { + return requests_ == null + ? com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.getDefaultInstance() + : requests_; + } else { + return requestsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRequests(com.google.cloud.alloydb.v1alpha.CreateInstanceRequests value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requests_ = value; + } else { + requestsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRequests( + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.Builder builderForValue) { + if (requestsBuilder_ == null) { + requests_ = builderForValue.build(); + } else { + requestsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeRequests(com.google.cloud.alloydb.v1alpha.CreateInstanceRequests value) { + if (requestsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && requests_ != null + && requests_ + != com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.getDefaultInstance()) { + getRequestsBuilder().mergeFrom(value); + } else { + requests_ = value; + } + } else { + requestsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRequests() { + bitField0_ = (bitField0_ & ~0x00000002); + requests_ = null; + if (requestsBuilder_ != null) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.Builder getRequestsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getRequestsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequestsOrBuilder getRequestsOrBuilder() { + if (requestsBuilder_ != null) { + return requestsBuilder_.getMessageOrBuilder(); + } else { + return requests_ == null + ? com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.getDefaultInstance() + : requests_; + } + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.Builder, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequestsOrBuilder> + getRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.Builder, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequestsOrBuilder>( + getRequests(), getParentForChildren(), isClean()); + requests_ = null; + } + return requestsBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + 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.alloydb.v1alpha.BatchCreateInstancesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest) + private static final com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateInstancesRequest 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.alloydb.v1alpha.BatchCreateInstancesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesRequestOrBuilder.java new file mode 100644 index 000000000000..1da4ae37e1b2 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesRequestOrBuilder.java @@ -0,0 +1,140 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface BatchCreateInstancesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the requests field is set. + */ + boolean hasRequests(); + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The requests. + */ + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests getRequests(); + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1alpha.CreateInstanceRequestsOrBuilder getRequestsOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesResponse.java new file mode 100644 index 000000000000..20c4ac792ee6 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesResponse.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/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for creating batches of instances in a cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} + */ +public final class BatchCreateInstancesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse) + BatchCreateInstancesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchCreateInstancesResponse.newBuilder() to construct. + private BatchCreateInstancesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchCreateInstancesResponse() { + instances_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateInstancesResponse(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.class, + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.Builder.class); + } + + public static final int INSTANCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List instances_; + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + @java.lang.Override + public java.util.List getInstancesList() { + return instances_; + } + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + @java.lang.Override + public java.util.List + getInstancesOrBuilderList() { + return instances_; + } + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance getInstances(int index) { + return instances_.get(index); + } + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.InstanceOrBuilder getInstancesOrBuilder(int index) { + return instances_.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 < instances_.size(); i++) { + output.writeMessage(1, instances_.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 < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, instances_.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.alloydb.v1alpha.BatchCreateInstancesResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse other = + (com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse) obj; + + if (!getInstancesList().equals(other.getInstancesList())) 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 (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse 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.alloydb.v1alpha.BatchCreateInstancesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse 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.alloydb.v1alpha.BatchCreateInstancesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse 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.alloydb.v1alpha.BatchCreateInstancesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse 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.alloydb.v1alpha.BatchCreateInstancesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse 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.alloydb.v1alpha.BatchCreateInstancesResponse 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; + } + /** + * + * + *
+   * Message for creating batches of instances in a cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse) + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.class, + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + } else { + instances_ = null; + instancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse build() { + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse buildPartial() { + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse result = + new com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse result) { + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse result) { + int from_bitField0_ = bitField0_; + } + + @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.alloydb.v1alpha.BatchCreateInstancesResponse) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse other) { + if (other + == com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.getDefaultInstance()) + return this; + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + 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.alloydb.v1alpha.Instance m = + input.readMessage( + com.google.cloud.alloydb.v1alpha.Instance.parser(), extensionRegistry); + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(m); + } else { + instancesBuilder_.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 instances_ = + java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instances_ = new java.util.ArrayList(instances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance, + com.google.cloud.alloydb.v1alpha.Instance.Builder, + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public java.util.List getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1alpha.Instance getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder setInstances(int index, com.google.cloud.alloydb.v1alpha.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder setInstances( + int index, com.google.cloud.alloydb.v1alpha.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.alloydb.v1alpha.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder addInstances(int index, com.google.cloud.alloydb.v1alpha.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.alloydb.v1alpha.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder addInstances( + int index, com.google.cloud.alloydb.v1alpha.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder addAllInstances( + java.lang.Iterable values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1alpha.Instance.Builder getInstancesBuilder(int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1alpha.InstanceOrBuilder getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public java.util.List + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1alpha.Instance.Builder addInstancesBuilder() { + return getInstancesFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1alpha.Instance.Builder addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public java.util.List + getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance, + com.google.cloud.alloydb.v1alpha.Instance.Builder, + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance, + com.google.cloud.alloydb.v1alpha.Instance.Builder, + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder>( + instances_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + @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.alloydb.v1alpha.BatchCreateInstancesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse) + private static final com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse(); + } + + public static com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateInstancesResponse 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.alloydb.v1alpha.BatchCreateInstancesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesResponseOrBuilder.java new file mode 100644 index 000000000000..ed4b1bd77d9c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesResponseOrBuilder.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/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface BatchCreateInstancesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + java.util.List getInstancesList(); + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + com.google.cloud.alloydb.v1alpha.Instance getInstances(int index); + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + int getInstancesCount(); + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + java.util.List + getInstancesOrBuilderList(); + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder getInstancesOrBuilder(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Cluster.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Cluster.java new file mode 100644 index 000000000000..01e3781f5b2e --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Cluster.java @@ -0,0 +1,8992 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * A cluster is a collection of regional AlloyDB resources. It can include a
+ * primary instance and one or more read pool instances.
+ * All cluster resources share a storage layer, which scales as needed.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Cluster} + */ +public final class Cluster extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.Cluster) + ClusterOrBuilder { + private static final long serialVersionUID = 0L; + // Use Cluster.newBuilder() to construct. + private Cluster(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Cluster() { + name_ = ""; + displayName_ = ""; + uid_ = ""; + state_ = 0; + clusterType_ = 0; + databaseVersion_ = 0; + network_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Cluster(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + case 12: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Cluster.class, + com.google.cloud.alloydb.v1alpha.Cluster.Builder.class); + } + + /** + * + * + *
+   * Cluster State
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.Cluster.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the cluster is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The cluster is active and running.
+     * 
+ * + * READY = 1; + */ + READY(1), + /** + * + * + *
+     * The cluster is stopped. All instances in the cluster are stopped.
+     * Customers can start a stopped cluster at any point and all their
+     * instances will come back to life with same names and IP resources. In
+     * this state, customer pays for storage.
+     * Associated backups could also be present in a stopped cluster.
+     * 
+ * + * STOPPED = 2; + */ + STOPPED(2), + /** + * + * + *
+     * The cluster is empty and has no associated resources.
+     * All instances, associated storage and backups have been deleted.
+     * 
+ * + * EMPTY = 3; + */ + EMPTY(3), + /** + * + * + *
+     * The cluster is being created.
+     * 
+ * + * CREATING = 4; + */ + CREATING(4), + /** + * + * + *
+     * The cluster is being deleted.
+     * 
+ * + * DELETING = 5; + */ + DELETING(5), + /** + * + * + *
+     * The creation of the cluster failed.
+     * 
+ * + * FAILED = 6; + */ + FAILED(6), + /** + * + * + *
+     * The cluster is bootstrapping with data from some other source.
+     * Direct mutations to the cluster (e.g. adding read pool) are not allowed.
+     * 
+ * + * BOOTSTRAPPING = 7; + */ + BOOTSTRAPPING(7), + /** + * + * + *
+     * The cluster is under maintenance. AlloyDB regularly performs maintenance
+     * and upgrades on customer clusters. Updates on the cluster are
+     * not allowed while the cluster is in this state.
+     * 
+ * + * MAINTENANCE = 8; + */ + MAINTENANCE(8), + /** + * + * + *
+     * The cluster is being promoted.
+     * 
+ * + * PROMOTING = 9; + */ + PROMOTING(9), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The state of the cluster is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The cluster is active and running.
+     * 
+ * + * READY = 1; + */ + public static final int READY_VALUE = 1; + /** + * + * + *
+     * The cluster is stopped. All instances in the cluster are stopped.
+     * Customers can start a stopped cluster at any point and all their
+     * instances will come back to life with same names and IP resources. In
+     * this state, customer pays for storage.
+     * Associated backups could also be present in a stopped cluster.
+     * 
+ * + * STOPPED = 2; + */ + public static final int STOPPED_VALUE = 2; + /** + * + * + *
+     * The cluster is empty and has no associated resources.
+     * All instances, associated storage and backups have been deleted.
+     * 
+ * + * EMPTY = 3; + */ + public static final int EMPTY_VALUE = 3; + /** + * + * + *
+     * The cluster is being created.
+     * 
+ * + * CREATING = 4; + */ + public static final int CREATING_VALUE = 4; + /** + * + * + *
+     * The cluster is being deleted.
+     * 
+ * + * DELETING = 5; + */ + public static final int DELETING_VALUE = 5; + /** + * + * + *
+     * The creation of the cluster failed.
+     * 
+ * + * FAILED = 6; + */ + public static final int FAILED_VALUE = 6; + /** + * + * + *
+     * The cluster is bootstrapping with data from some other source.
+     * Direct mutations to the cluster (e.g. adding read pool) are not allowed.
+     * 
+ * + * BOOTSTRAPPING = 7; + */ + public static final int BOOTSTRAPPING_VALUE = 7; + /** + * + * + *
+     * The cluster is under maintenance. AlloyDB regularly performs maintenance
+     * and upgrades on customer clusters. Updates on the cluster are
+     * not allowed while the cluster is in this state.
+     * 
+ * + * MAINTENANCE = 8; + */ + public static final int MAINTENANCE_VALUE = 8; + /** + * + * + *
+     * The cluster is being promoted.
+     * 
+ * + * PROMOTING = 9; + */ + public static final int PROMOTING_VALUE = 9; + + 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 READY; + case 2: + return STOPPED; + case 3: + return EMPTY; + case 4: + return CREATING; + case 5: + return DELETING; + case 6: + return FAILED; + case 7: + return BOOTSTRAPPING; + case 8: + return MAINTENANCE; + case 9: + return PROMOTING; + 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.alloydb.v1alpha.Cluster.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.alloydb.v1alpha.Cluster.State) + } + + /** + * + * + *
+   * Type of Cluster
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.Cluster.ClusterType} + */ + public enum ClusterType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The type of the cluster is unknown.
+     * 
+ * + * CLUSTER_TYPE_UNSPECIFIED = 0; + */ + CLUSTER_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Primary cluster that support read and write operations.
+     * 
+ * + * PRIMARY = 1; + */ + PRIMARY(1), + /** + * + * + *
+     * Secondary cluster that is replicating from another region.
+     * This only supports read.
+     * 
+ * + * SECONDARY = 2; + */ + SECONDARY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The type of the cluster is unknown.
+     * 
+ * + * CLUSTER_TYPE_UNSPECIFIED = 0; + */ + public static final int CLUSTER_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Primary cluster that support read and write operations.
+     * 
+ * + * PRIMARY = 1; + */ + public static final int PRIMARY_VALUE = 1; + /** + * + * + *
+     * Secondary cluster that is replicating from another region.
+     * This only supports read.
+     * 
+ * + * SECONDARY = 2; + */ + public static final int SECONDARY_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 ClusterType 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 ClusterType forNumber(int value) { + switch (value) { + case 0: + return CLUSTER_TYPE_UNSPECIFIED; + case 1: + return PRIMARY; + case 2: + return SECONDARY; + 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 ClusterType findValueByNumber(int number) { + return ClusterType.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.alloydb.v1alpha.Cluster.getDescriptor().getEnumTypes().get(1); + } + + private static final ClusterType[] VALUES = values(); + + public static ClusterType 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 ClusterType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.Cluster.ClusterType) + } + + public interface SecondaryConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the primary cluster name with the format:
+     * * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string primary_cluster_name = 1; + * + * @return The primaryClusterName. + */ + java.lang.String getPrimaryClusterName(); + /** + * + * + *
+     * The name of the primary cluster name with the format:
+     * * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string primary_cluster_name = 1; + * + * @return The bytes for primaryClusterName. + */ + com.google.protobuf.ByteString getPrimaryClusterNameBytes(); + } + /** + * + * + *
+   * Configuration information for the secondary cluster. This should be set
+   * if and only if the cluster is of type SECONDARY.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} + */ + public static final class SecondaryConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig) + SecondaryConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecondaryConfig.newBuilder() to construct. + private SecondaryConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecondaryConfig() { + primaryClusterName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecondaryConfig(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_SecondaryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_SecondaryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.class, + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.Builder.class); + } + + public static final int PRIMARY_CLUSTER_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object primaryClusterName_ = ""; + /** + * + * + *
+     * The name of the primary cluster name with the format:
+     * * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string primary_cluster_name = 1; + * + * @return The primaryClusterName. + */ + @java.lang.Override + public java.lang.String getPrimaryClusterName() { + java.lang.Object ref = primaryClusterName_; + 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(); + primaryClusterName_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the primary cluster name with the format:
+     * * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string primary_cluster_name = 1; + * + * @return The bytes for primaryClusterName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrimaryClusterNameBytes() { + java.lang.Object ref = primaryClusterName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryClusterName_ = 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(primaryClusterName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, primaryClusterName_); + } + 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(primaryClusterName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, primaryClusterName_); + } + 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.alloydb.v1alpha.Cluster.SecondaryConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig other = + (com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig) obj; + + if (!getPrimaryClusterName().equals(other.getPrimaryClusterName())) 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) + PRIMARY_CLUSTER_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryClusterName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig 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.alloydb.v1alpha.Cluster.SecondaryConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig 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.alloydb.v1alpha.Cluster.SecondaryConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig 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.alloydb.v1alpha.Cluster.SecondaryConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig 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.alloydb.v1alpha.Cluster.SecondaryConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig 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.alloydb.v1alpha.Cluster.SecondaryConfig 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; + } + /** + * + * + *
+     * Configuration information for the secondary cluster. This should be set
+     * if and only if the cluster is of type SECONDARY.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig) + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_SecondaryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_SecondaryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.class, + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + primaryClusterName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_SecondaryConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig build() { + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig buildPartial() { + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig result = + new com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.primaryClusterName_ = primaryClusterName_; + } + } + + @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.alloydb.v1alpha.Cluster.SecondaryConfig) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig other) { + if (other == com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.getDefaultInstance()) + return this; + if (!other.getPrimaryClusterName().isEmpty()) { + primaryClusterName_ = other.primaryClusterName_; + bitField0_ |= 0x00000001; + 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: + { + primaryClusterName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + 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.lang.Object primaryClusterName_ = ""; + /** + * + * + *
+       * The name of the primary cluster name with the format:
+       * * projects/{project}/locations/{region}/clusters/{cluster_id}
+       * 
+ * + * string primary_cluster_name = 1; + * + * @return The primaryClusterName. + */ + public java.lang.String getPrimaryClusterName() { + java.lang.Object ref = primaryClusterName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryClusterName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the primary cluster name with the format:
+       * * projects/{project}/locations/{region}/clusters/{cluster_id}
+       * 
+ * + * string primary_cluster_name = 1; + * + * @return The bytes for primaryClusterName. + */ + public com.google.protobuf.ByteString getPrimaryClusterNameBytes() { + java.lang.Object ref = primaryClusterName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryClusterName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the primary cluster name with the format:
+       * * projects/{project}/locations/{region}/clusters/{cluster_id}
+       * 
+ * + * string primary_cluster_name = 1; + * + * @param value The primaryClusterName to set. + * @return This builder for chaining. + */ + public Builder setPrimaryClusterName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + primaryClusterName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the primary cluster name with the format:
+       * * projects/{project}/locations/{region}/clusters/{cluster_id}
+       * 
+ * + * string primary_cluster_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearPrimaryClusterName() { + primaryClusterName_ = getDefaultInstance().getPrimaryClusterName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the primary cluster name with the format:
+       * * projects/{project}/locations/{region}/clusters/{cluster_id}
+       * 
+ * + * string primary_cluster_name = 1; + * + * @param value The bytes for primaryClusterName to set. + * @return This builder for chaining. + */ + public Builder setPrimaryClusterNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + primaryClusterName_ = value; + 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.alloydb.v1alpha.Cluster.SecondaryConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig) + private static final com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig(); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecondaryConfig 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.alloydb.v1alpha.Cluster.SecondaryConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PrimaryConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the secondaryClusterNames. + */ + java.util.List getSecondaryClusterNamesList(); + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of secondaryClusterNames. + */ + int getSecondaryClusterNamesCount(); + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The secondaryClusterNames at the given index. + */ + java.lang.String getSecondaryClusterNames(int index); + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the secondaryClusterNames at the given index. + */ + com.google.protobuf.ByteString getSecondaryClusterNamesBytes(int index); + } + /** + * + * + *
+   * Configuration for the primary cluster. It has the list of clusters that are
+   * replicating from this cluster. This should be set if and only if the
+   * cluster is of type PRIMARY.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} + */ + public static final class PrimaryConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig) + PrimaryConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use PrimaryConfig.newBuilder() to construct. + private PrimaryConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PrimaryConfig() { + secondaryClusterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PrimaryConfig(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_PrimaryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_PrimaryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.class, + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.Builder.class); + } + + public static final int SECONDARY_CLUSTER_NAMES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList secondaryClusterNames_; + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the secondaryClusterNames. + */ + public com.google.protobuf.ProtocolStringList getSecondaryClusterNamesList() { + return secondaryClusterNames_; + } + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of secondaryClusterNames. + */ + public int getSecondaryClusterNamesCount() { + return secondaryClusterNames_.size(); + } + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The secondaryClusterNames at the given index. + */ + public java.lang.String getSecondaryClusterNames(int index) { + return secondaryClusterNames_.get(index); + } + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the secondaryClusterNames at the given index. + */ + public com.google.protobuf.ByteString getSecondaryClusterNamesBytes(int index) { + return secondaryClusterNames_.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 < secondaryClusterNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 1, secondaryClusterNames_.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 < secondaryClusterNames_.size(); i++) { + dataSize += computeStringSizeNoTag(secondaryClusterNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getSecondaryClusterNamesList().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.alloydb.v1alpha.Cluster.PrimaryConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig other = + (com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig) obj; + + if (!getSecondaryClusterNamesList().equals(other.getSecondaryClusterNamesList())) + 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 (getSecondaryClusterNamesCount() > 0) { + hash = (37 * hash) + SECONDARY_CLUSTER_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getSecondaryClusterNamesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig 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.alloydb.v1alpha.Cluster.PrimaryConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig 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.alloydb.v1alpha.Cluster.PrimaryConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig 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.alloydb.v1alpha.Cluster.PrimaryConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig 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.alloydb.v1alpha.Cluster.PrimaryConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig 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.alloydb.v1alpha.Cluster.PrimaryConfig 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; + } + /** + * + * + *
+     * Configuration for the primary cluster. It has the list of clusters that are
+     * replicating from this cluster. This should be set if and only if the
+     * cluster is of type PRIMARY.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig) + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_PrimaryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_PrimaryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.class, + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + secondaryClusterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_PrimaryConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig build() { + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig buildPartial() { + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig result = + new com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig result) { + if (((bitField0_ & 0x00000001) != 0)) { + secondaryClusterNames_ = secondaryClusterNames_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.secondaryClusterNames_ = secondaryClusterNames_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig result) { + int from_bitField0_ = bitField0_; + } + + @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.alloydb.v1alpha.Cluster.PrimaryConfig) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig other) { + if (other == com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.getDefaultInstance()) + return this; + if (!other.secondaryClusterNames_.isEmpty()) { + if (secondaryClusterNames_.isEmpty()) { + secondaryClusterNames_ = other.secondaryClusterNames_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSecondaryClusterNamesIsMutable(); + secondaryClusterNames_.addAll(other.secondaryClusterNames_); + } + 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(); + ensureSecondaryClusterNamesIsMutable(); + secondaryClusterNames_.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 secondaryClusterNames_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureSecondaryClusterNamesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + secondaryClusterNames_ = + new com.google.protobuf.LazyStringArrayList(secondaryClusterNames_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the secondaryClusterNames. + */ + public com.google.protobuf.ProtocolStringList getSecondaryClusterNamesList() { + return secondaryClusterNames_.getUnmodifiableView(); + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of secondaryClusterNames. + */ + public int getSecondaryClusterNamesCount() { + return secondaryClusterNames_.size(); + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The secondaryClusterNames at the given index. + */ + public java.lang.String getSecondaryClusterNames(int index) { + return secondaryClusterNames_.get(index); + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the secondaryClusterNames at the given index. + */ + public com.google.protobuf.ByteString getSecondaryClusterNamesBytes(int index) { + return secondaryClusterNames_.getByteString(index); + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The secondaryClusterNames to set. + * @return This builder for chaining. + */ + public Builder setSecondaryClusterNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecondaryClusterNamesIsMutable(); + secondaryClusterNames_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The secondaryClusterNames to add. + * @return This builder for chaining. + */ + public Builder addSecondaryClusterNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecondaryClusterNamesIsMutable(); + secondaryClusterNames_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The secondaryClusterNames to add. + * @return This builder for chaining. + */ + public Builder addAllSecondaryClusterNames(java.lang.Iterable values) { + ensureSecondaryClusterNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, secondaryClusterNames_); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSecondaryClusterNames() { + secondaryClusterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes of the secondaryClusterNames to add. + * @return This builder for chaining. + */ + public Builder addSecondaryClusterNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSecondaryClusterNamesIsMutable(); + secondaryClusterNames_.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.alloydb.v1alpha.Cluster.PrimaryConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig) + private static final com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig(); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PrimaryConfig 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.alloydb.v1alpha.Cluster.PrimaryConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BACKUP_SOURCE(15), + MIGRATION_SOURCE(16), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 15: + return BACKUP_SOURCE; + case 16: + return MIGRATION_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int BACKUP_SOURCE_FIELD_NUMBER = 15; + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupSource field is set. + */ + @java.lang.Override + public boolean hasBackupSource() { + return sourceCase_ == 15; + } + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BackupSource getBackupSource() { + if (sourceCase_ == 15) { + return (com.google.cloud.alloydb.v1alpha.BackupSource) source_; + } + return com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance(); + } + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BackupSourceOrBuilder getBackupSourceOrBuilder() { + if (sourceCase_ == 15) { + return (com.google.cloud.alloydb.v1alpha.BackupSource) source_; + } + return com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance(); + } + + public static final int MIGRATION_SOURCE_FIELD_NUMBER = 16; + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the migrationSource field is set. + */ + @java.lang.Override + public boolean hasMigrationSource() { + return sourceCase_ == 16; + } + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The migrationSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.MigrationSource getMigrationSource() { + if (sourceCase_ == 16) { + return (com.google.cloud.alloydb.v1alpha.MigrationSource) source_; + } + return com.google.cloud.alloydb.v1alpha.MigrationSource.getDefaultInstance(); + } + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.MigrationSourceOrBuilder getMigrationSourceOrBuilder() { + if (sourceCase_ == 16) { + return (com.google.cloud.alloydb.v1alpha.MigrationSource) source_; + } + return com.google.cloud.alloydb.v1alpha.MigrationSource.getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The name of the cluster resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * where the cluster ID segment should satisfy the regex expression
+   * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+   * The prefix of the cluster resource name is the name of the parent resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The name of the cluster resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * where the cluster ID segment should satisfy the regex expression
+   * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+   * The prefix of the cluster resource name is the name of the parent resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * User-settable and human-readable display name for the Cluster.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * User-settable and human-readable display name for the Cluster.
+   * 
+ * + * 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 UID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + 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(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int DELETE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + + public static final int LABELS_FIELD_NUMBER = 7; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATE_FIELD_NUMBER = 8; + private int state_ = 0; + /** + * + * + *
+   * Output only. The current serving state of the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current serving state of the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.State getState() { + com.google.cloud.alloydb.v1alpha.Cluster.State result = + com.google.cloud.alloydb.v1alpha.Cluster.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1alpha.Cluster.State.UNRECOGNIZED : result; + } + + public static final int CLUSTER_TYPE_FIELD_NUMBER = 24; + private int clusterType_ = 0; + /** + * + * + *
+   * Output only. The type of the cluster. This is an output-only field and it's
+   * populated at the Cluster creation time or the Cluster promotion
+   * time. The cluster type is determined by which RPC was used to create
+   * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for clusterType. + */ + @java.lang.Override + public int getClusterTypeValue() { + return clusterType_; + } + /** + * + * + *
+   * Output only. The type of the cluster. This is an output-only field and it's
+   * populated at the Cluster creation time or the Cluster promotion
+   * time. The cluster type is determined by which RPC was used to create
+   * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The clusterType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.ClusterType getClusterType() { + com.google.cloud.alloydb.v1alpha.Cluster.ClusterType result = + com.google.cloud.alloydb.v1alpha.Cluster.ClusterType.forNumber(clusterType_); + return result == null + ? com.google.cloud.alloydb.v1alpha.Cluster.ClusterType.UNRECOGNIZED + : result; + } + + public static final int DATABASE_VERSION_FIELD_NUMBER = 9; + private int databaseVersion_ = 0; + /** + * + * + *
+   * Output only. The database engine major version. This is an output-only
+   * field and it's populated at the Cluster creation time. This field cannot be
+   * changed after cluster creation.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + /** + * + * + *
+   * Output only. The database engine major version. This is an output-only
+   * field and it's populated at the Cluster creation time. This field cannot be
+   * changed after cluster creation.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DatabaseVersion getDatabaseVersion() { + com.google.cloud.alloydb.v1alpha.DatabaseVersion result = + com.google.cloud.alloydb.v1alpha.DatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.alloydb.v1alpha.DatabaseVersion.UNRECOGNIZED : result; + } + + public static final int NETWORK_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object network_ = ""; + /** + * + * + *
+   * Required. The resource link for the VPC network in which cluster resources
+   * are created and from which they are accessible via Private IP. The network
+   * must belong to the same project as the cluster. It is specified in the
+   * form: "projects/{project_number}/global/networks/{network_id}". This is
+   * required to create a cluster. It can be updated, but it cannot be removed.
+   * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + 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(); + network_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource link for the VPC network in which cluster resources
+   * are created and from which they are accessible via Private IP. The network
+   * must belong to the same project as the cluster. It is specified in the
+   * form: "projects/{project_number}/global/networks/{network_id}". This is
+   * required to create a cluster. It can be updated, but it cannot be removed.
+   * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 11; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 11; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 12; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int RECONCILING_FIELD_NUMBER = 13; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+   * Set to true if the current state of Cluster does not match the user's
+   * intended state, and the service is actively updating the resource to
+   * reconcile them. This can happen due to user-triggered updates or
+   * system actions like failover or maintenance.
+   * 
+ * + * bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int INITIAL_USER_FIELD_NUMBER = 14; + private com.google.cloud.alloydb.v1alpha.UserPassword initialUser_; + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the initialUser field is set. + */ + @java.lang.Override + public boolean hasInitialUser() { + return initialUser_ != null; + } + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The initialUser. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UserPassword getInitialUser() { + return initialUser_ == null + ? com.google.cloud.alloydb.v1alpha.UserPassword.getDefaultInstance() + : initialUser_; + } + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UserPasswordOrBuilder getInitialUserOrBuilder() { + return initialUser_ == null + ? com.google.cloud.alloydb.v1alpha.UserPassword.getDefaultInstance() + : initialUser_; + } + + public static final int AUTOMATED_BACKUP_POLICY_FIELD_NUMBER = 17; + private com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automatedBackupPolicy_; + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return Whether the automatedBackupPolicy field is set. + */ + @java.lang.Override + public boolean hasAutomatedBackupPolicy() { + return automatedBackupPolicy_ != null; + } + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return The automatedBackupPolicy. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy getAutomatedBackupPolicy() { + return automatedBackupPolicy_ == null + ? com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.getDefaultInstance() + : automatedBackupPolicy_; + } + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicyOrBuilder + getAutomatedBackupPolicyOrBuilder() { + return automatedBackupPolicy_ == null + ? com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.getDefaultInstance() + : automatedBackupPolicy_; + } + + public static final int SSL_CONFIG_FIELD_NUMBER = 18; + private com.google.cloud.alloydb.v1alpha.SslConfig sslConfig_; + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * + * @return Whether the sslConfig field is set. + */ + @java.lang.Override + public boolean hasSslConfig() { + return sslConfig_ != null; + } + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * + * @return The sslConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SslConfig getSslConfig() { + return sslConfig_ == null + ? com.google.cloud.alloydb.v1alpha.SslConfig.getDefaultInstance() + : sslConfig_; + } + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SslConfigOrBuilder getSslConfigOrBuilder() { + return sslConfig_ == null + ? com.google.cloud.alloydb.v1alpha.SslConfig.getDefaultInstance() + : sslConfig_; + } + + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 19; + private com.google.cloud.alloydb.v1alpha.EncryptionConfig encryptionConfig_; + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return encryptionConfig_ != null; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + public static final int ENCRYPTION_INFO_FIELD_NUMBER = 20; + private com.google.cloud.alloydb.v1alpha.EncryptionInfo encryptionInfo_; + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + @java.lang.Override + public boolean hasEncryptionInfo() { + return encryptionInfo_ != null; + } + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionInfo getEncryptionInfo() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + + public static final int CONTINUOUS_BACKUP_CONFIG_FIELD_NUMBER = 27; + private com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuousBackupConfig_; + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the continuousBackupConfig field is set. + */ + @java.lang.Override + public boolean hasContinuousBackupConfig() { + return continuousBackupConfig_ != null; + } + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The continuousBackupConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig getContinuousBackupConfig() { + return continuousBackupConfig_ == null + ? com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.getDefaultInstance() + : continuousBackupConfig_; + } + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupConfigOrBuilder + getContinuousBackupConfigOrBuilder() { + return continuousBackupConfig_ == null + ? com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.getDefaultInstance() + : continuousBackupConfig_; + } + + public static final int CONTINUOUS_BACKUP_INFO_FIELD_NUMBER = 28; + private com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuousBackupInfo_; + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the continuousBackupInfo field is set. + */ + @java.lang.Override + public boolean hasContinuousBackupInfo() { + return continuousBackupInfo_ != null; + } + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The continuousBackupInfo. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo getContinuousBackupInfo() { + return continuousBackupInfo_ == null + ? com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.getDefaultInstance() + : continuousBackupInfo_; + } + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupInfoOrBuilder + getContinuousBackupInfoOrBuilder() { + return continuousBackupInfo_ == null + ? com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.getDefaultInstance() + : continuousBackupInfo_; + } + + public static final int SECONDARY_CONFIG_FIELD_NUMBER = 22; + private com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondaryConfig_; + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + * + * @return Whether the secondaryConfig field is set. + */ + @java.lang.Override + public boolean hasSecondaryConfig() { + return secondaryConfig_ != null; + } + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + * + * @return The secondaryConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig getSecondaryConfig() { + return secondaryConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.getDefaultInstance() + : secondaryConfig_; + } + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfigOrBuilder + getSecondaryConfigOrBuilder() { + return secondaryConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.getDefaultInstance() + : secondaryConfig_; + } + + public static final int PRIMARY_CONFIG_FIELD_NUMBER = 23; + private com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primaryConfig_; + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the primaryConfig field is set. + */ + @java.lang.Override + public boolean hasPrimaryConfig() { + return primaryConfig_ != null; + } + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The primaryConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig getPrimaryConfig() { + return primaryConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.getDefaultInstance() + : primaryConfig_; + } + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfigOrBuilder + getPrimaryConfigOrBuilder() { + return primaryConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.getDefaultInstance() + : primaryConfig_; + } + + 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(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uid_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (deleteTime_ != null) { + output.writeMessage(6, getDeleteTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 7); + if (state_ != com.google.cloud.alloydb.v1alpha.Cluster.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, state_); + } + if (databaseVersion_ + != com.google.cloud.alloydb.v1alpha.DatabaseVersion.DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, databaseVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, etag_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 12); + if (reconciling_ != false) { + output.writeBool(13, reconciling_); + } + if (initialUser_ != null) { + output.writeMessage(14, getInitialUser()); + } + if (sourceCase_ == 15) { + output.writeMessage(15, (com.google.cloud.alloydb.v1alpha.BackupSource) source_); + } + if (sourceCase_ == 16) { + output.writeMessage(16, (com.google.cloud.alloydb.v1alpha.MigrationSource) source_); + } + if (automatedBackupPolicy_ != null) { + output.writeMessage(17, getAutomatedBackupPolicy()); + } + if (sslConfig_ != null) { + output.writeMessage(18, getSslConfig()); + } + if (encryptionConfig_ != null) { + output.writeMessage(19, getEncryptionConfig()); + } + if (encryptionInfo_ != null) { + output.writeMessage(20, getEncryptionInfo()); + } + if (secondaryConfig_ != null) { + output.writeMessage(22, getSecondaryConfig()); + } + if (primaryConfig_ != null) { + output.writeMessage(23, getPrimaryConfig()); + } + if (clusterType_ + != com.google.cloud.alloydb.v1alpha.Cluster.ClusterType.CLUSTER_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(24, clusterType_); + } + if (continuousBackupConfig_ != null) { + output.writeMessage(27, getContinuousBackupConfig()); + } + if (continuousBackupInfo_ != null) { + output.writeMessage(28, getContinuousBackupInfo()); + } + 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(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uid_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDeleteTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, labels__); + } + if (state_ != com.google.cloud.alloydb.v1alpha.Cluster.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, state_); + } + if (databaseVersion_ + != com.google.cloud.alloydb.v1alpha.DatabaseVersion.DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, databaseVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, etag_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, annotations__); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, reconciling_); + } + if (initialUser_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getInitialUser()); + } + if (sourceCase_ == 15) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 15, (com.google.cloud.alloydb.v1alpha.BackupSource) source_); + } + if (sourceCase_ == 16) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 16, (com.google.cloud.alloydb.v1alpha.MigrationSource) source_); + } + if (automatedBackupPolicy_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(17, getAutomatedBackupPolicy()); + } + if (sslConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getSslConfig()); + } + if (encryptionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getEncryptionConfig()); + } + if (encryptionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getEncryptionInfo()); + } + if (secondaryConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, getSecondaryConfig()); + } + if (primaryConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, getPrimaryConfig()); + } + if (clusterType_ + != com.google.cloud.alloydb.v1alpha.Cluster.ClusterType.CLUSTER_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(24, clusterType_); + } + if (continuousBackupConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(27, getContinuousBackupConfig()); + } + if (continuousBackupInfo_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(28, getContinuousBackupInfo()); + } + 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.alloydb.v1alpha.Cluster)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.Cluster other = (com.google.cloud.alloydb.v1alpha.Cluster) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (state_ != other.state_) return false; + if (clusterType_ != other.clusterType_) return false; + if (databaseVersion_ != other.databaseVersion_) return false; + if (!getNetwork().equals(other.getNetwork())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (getReconciling() != other.getReconciling()) return false; + if (hasInitialUser() != other.hasInitialUser()) return false; + if (hasInitialUser()) { + if (!getInitialUser().equals(other.getInitialUser())) return false; + } + if (hasAutomatedBackupPolicy() != other.hasAutomatedBackupPolicy()) return false; + if (hasAutomatedBackupPolicy()) { + if (!getAutomatedBackupPolicy().equals(other.getAutomatedBackupPolicy())) return false; + } + if (hasSslConfig() != other.hasSslConfig()) return false; + if (hasSslConfig()) { + if (!getSslConfig().equals(other.getSslConfig())) return false; + } + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) return false; + } + if (hasEncryptionInfo() != other.hasEncryptionInfo()) return false; + if (hasEncryptionInfo()) { + if (!getEncryptionInfo().equals(other.getEncryptionInfo())) return false; + } + if (hasContinuousBackupConfig() != other.hasContinuousBackupConfig()) return false; + if (hasContinuousBackupConfig()) { + if (!getContinuousBackupConfig().equals(other.getContinuousBackupConfig())) return false; + } + if (hasContinuousBackupInfo() != other.hasContinuousBackupInfo()) return false; + if (hasContinuousBackupInfo()) { + if (!getContinuousBackupInfo().equals(other.getContinuousBackupInfo())) return false; + } + if (hasSecondaryConfig() != other.hasSecondaryConfig()) return false; + if (hasSecondaryConfig()) { + if (!getSecondaryConfig().equals(other.getSecondaryConfig())) return false; + } + if (hasPrimaryConfig() != other.hasPrimaryConfig()) return false; + if (hasPrimaryConfig()) { + if (!getPrimaryConfig().equals(other.getPrimaryConfig())) return false; + } + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 15: + if (!getBackupSource().equals(other.getBackupSource())) return false; + break; + case 16: + if (!getMigrationSource().equals(other.getMigrationSource())) 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) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + CLUSTER_TYPE_FIELD_NUMBER; + hash = (53 * hash) + clusterType_; + hash = (37 * hash) + DATABASE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + databaseVersion_; + hash = (37 * hash) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + if (hasInitialUser()) { + hash = (37 * hash) + INITIAL_USER_FIELD_NUMBER; + hash = (53 * hash) + getInitialUser().hashCode(); + } + if (hasAutomatedBackupPolicy()) { + hash = (37 * hash) + AUTOMATED_BACKUP_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getAutomatedBackupPolicy().hashCode(); + } + if (hasSslConfig()) { + hash = (37 * hash) + SSL_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSslConfig().hashCode(); + } + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } + if (hasEncryptionInfo()) { + hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionInfo().hashCode(); + } + if (hasContinuousBackupConfig()) { + hash = (37 * hash) + CONTINUOUS_BACKUP_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getContinuousBackupConfig().hashCode(); + } + if (hasContinuousBackupInfo()) { + hash = (37 * hash) + CONTINUOUS_BACKUP_INFO_FIELD_NUMBER; + hash = (53 * hash) + getContinuousBackupInfo().hashCode(); + } + if (hasSecondaryConfig()) { + hash = (37 * hash) + SECONDARY_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSecondaryConfig().hashCode(); + } + if (hasPrimaryConfig()) { + hash = (37 * hash) + PRIMARY_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryConfig().hashCode(); + } + switch (sourceCase_) { + case 15: + hash = (37 * hash) + BACKUP_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getBackupSource().hashCode(); + break; + case 16: + hash = (37 * hash) + MIGRATION_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getMigrationSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.Cluster parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster 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.alloydb.v1alpha.Cluster parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster 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.alloydb.v1alpha.Cluster parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster 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.alloydb.v1alpha.Cluster parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster 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.alloydb.v1alpha.Cluster parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster 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.alloydb.v1alpha.Cluster 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 cluster is a collection of regional AlloyDB resources. It can include a
+   * primary instance and one or more read pool instances.
+   * All cluster resources share a storage layer, which scales as needed.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Cluster} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.Cluster) + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + case 12: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableLabels(); + case 12: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Cluster.class, + com.google.cloud.alloydb.v1alpha.Cluster.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.Cluster.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (backupSourceBuilder_ != null) { + backupSourceBuilder_.clear(); + } + if (migrationSourceBuilder_ != null) { + migrationSourceBuilder_.clear(); + } + name_ = ""; + displayName_ = ""; + uid_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + state_ = 0; + clusterType_ = 0; + databaseVersion_ = 0; + network_ = ""; + etag_ = ""; + internalGetMutableAnnotations().clear(); + reconciling_ = false; + initialUser_ = null; + if (initialUserBuilder_ != null) { + initialUserBuilder_.dispose(); + initialUserBuilder_ = null; + } + automatedBackupPolicy_ = null; + if (automatedBackupPolicyBuilder_ != null) { + automatedBackupPolicyBuilder_.dispose(); + automatedBackupPolicyBuilder_ = null; + } + sslConfig_ = null; + if (sslConfigBuilder_ != null) { + sslConfigBuilder_.dispose(); + sslConfigBuilder_ = null; + } + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + continuousBackupConfig_ = null; + if (continuousBackupConfigBuilder_ != null) { + continuousBackupConfigBuilder_.dispose(); + continuousBackupConfigBuilder_ = null; + } + continuousBackupInfo_ = null; + if (continuousBackupInfoBuilder_ != null) { + continuousBackupInfoBuilder_.dispose(); + continuousBackupInfoBuilder_ = null; + } + secondaryConfig_ = null; + if (secondaryConfigBuilder_ != null) { + secondaryConfigBuilder_.dispose(); + secondaryConfigBuilder_ = null; + } + primaryConfig_ = null; + if (primaryConfigBuilder_ != null) { + primaryConfigBuilder_.dispose(); + primaryConfigBuilder_ = null; + } + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster build() { + com.google.cloud.alloydb.v1alpha.Cluster result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster buildPartial() { + com.google.cloud.alloydb.v1alpha.Cluster result = + new com.google.cloud.alloydb.v1alpha.Cluster(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.Cluster result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.clusterType_ = clusterType_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.databaseVersion_ = databaseVersion_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.network_ = network_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.initialUser_ = + initialUserBuilder_ == null ? initialUser_ : initialUserBuilder_.build(); + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.automatedBackupPolicy_ = + automatedBackupPolicyBuilder_ == null + ? automatedBackupPolicy_ + : automatedBackupPolicyBuilder_.build(); + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.sslConfig_ = sslConfigBuilder_ == null ? sslConfig_ : sslConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.encryptionConfig_ = + encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.encryptionInfo_ = + encryptionInfoBuilder_ == null ? encryptionInfo_ : encryptionInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.continuousBackupConfig_ = + continuousBackupConfigBuilder_ == null + ? continuousBackupConfig_ + : continuousBackupConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.continuousBackupInfo_ = + continuousBackupInfoBuilder_ == null + ? continuousBackupInfo_ + : continuousBackupInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.secondaryConfig_ = + secondaryConfigBuilder_ == null ? secondaryConfig_ : secondaryConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.primaryConfig_ = + primaryConfigBuilder_ == null ? primaryConfig_ : primaryConfigBuilder_.build(); + } + } + + private void buildPartialOneofs(com.google.cloud.alloydb.v1alpha.Cluster result) { + result.sourceCase_ = sourceCase_; + result.source_ = this.source_; + if (sourceCase_ == 15 && backupSourceBuilder_ != null) { + result.source_ = backupSourceBuilder_.build(); + } + if (sourceCase_ == 16 && migrationSourceBuilder_ != null) { + result.source_ = migrationSourceBuilder_.build(); + } + } + + @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.alloydb.v1alpha.Cluster) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.Cluster) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.Cluster other) { + if (other == com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000100; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.clusterType_ != 0) { + setClusterTypeValue(other.getClusterTypeValue()); + } + if (other.databaseVersion_ != 0) { + setDatabaseVersionValue(other.getDatabaseVersionValue()); + } + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + bitField0_ |= 0x00001000; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00002000; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00004000; + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + if (other.hasInitialUser()) { + mergeInitialUser(other.getInitialUser()); + } + if (other.hasAutomatedBackupPolicy()) { + mergeAutomatedBackupPolicy(other.getAutomatedBackupPolicy()); + } + if (other.hasSslConfig()) { + mergeSslConfig(other.getSslConfig()); + } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } + if (other.hasEncryptionInfo()) { + mergeEncryptionInfo(other.getEncryptionInfo()); + } + if (other.hasContinuousBackupConfig()) { + mergeContinuousBackupConfig(other.getContinuousBackupConfig()); + } + if (other.hasContinuousBackupInfo()) { + mergeContinuousBackupInfo(other.getContinuousBackupInfo()); + } + if (other.hasSecondaryConfig()) { + mergeSecondaryConfig(other.getSecondaryConfig()); + } + if (other.hasPrimaryConfig()) { + mergePrimaryConfig(other.getPrimaryConfig()); + } + switch (other.getSourceCase()) { + case BACKUP_SOURCE: + { + mergeBackupSource(other.getBackupSource()); + break; + } + case MIGRATION_SOURCE: + { + mergeMigrationSource(other.getMigrationSource()); + break; + } + case SOURCE_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(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 26: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 26 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 42 + case 50: + { + input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 50 + case 58: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000100; + break; + } // case 58 + case 64: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 64 + case 72: + { + databaseVersion_ = input.readEnum(); + bitField0_ |= 0x00000800; + break; + } // case 72 + case 82: + { + network_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 82 + case 90: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00002000; + break; + } // case 90 + case 98: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00004000; + break; + } // case 98 + case 104: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00008000; + break; + } // case 104 + case 114: + { + input.readMessage(getInitialUserFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 114 + case 122: + { + input.readMessage(getBackupSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 15; + break; + } // case 122 + case 130: + { + input.readMessage(getMigrationSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 16; + break; + } // case 130 + case 138: + { + input.readMessage( + getAutomatedBackupPolicyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 138 + case 146: + { + input.readMessage(getSslConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 146 + case 154: + { + input.readMessage( + getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 154 + case 162: + { + input.readMessage(getEncryptionInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00100000; + break; + } // case 162 + case 178: + { + input.readMessage(getSecondaryConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00800000; + break; + } // case 178 + case 186: + { + input.readMessage(getPrimaryConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x01000000; + break; + } // case 186 + case 192: + { + clusterType_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 192 + case 218: + { + input.readMessage( + getContinuousBackupConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00200000; + break; + } // case 218 + case 226: + { + input.readMessage( + getContinuousBackupInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00400000; + break; + } // case 226 + 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 sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.BackupSource, + com.google.cloud.alloydb.v1alpha.BackupSource.Builder, + com.google.cloud.alloydb.v1alpha.BackupSourceOrBuilder> + backupSourceBuilder_; + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupSource field is set. + */ + @java.lang.Override + public boolean hasBackupSource() { + return sourceCase_ == 15; + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BackupSource getBackupSource() { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 15) { + return (com.google.cloud.alloydb.v1alpha.BackupSource) source_; + } + return com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance(); + } else { + if (sourceCase_ == 15) { + return backupSourceBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBackupSource(com.google.cloud.alloydb.v1alpha.BackupSource value) { + if (backupSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + backupSourceBuilder_.setMessage(value); + } + sourceCase_ = 15; + return this; + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBackupSource( + com.google.cloud.alloydb.v1alpha.BackupSource.Builder builderForValue) { + if (backupSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + backupSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 15; + return this; + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeBackupSource(com.google.cloud.alloydb.v1alpha.BackupSource value) { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 15 + && source_ != com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance()) { + source_ = + com.google.cloud.alloydb.v1alpha.BackupSource.newBuilder( + (com.google.cloud.alloydb.v1alpha.BackupSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 15) { + backupSourceBuilder_.mergeFrom(value); + } else { + backupSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 15; + return this; + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearBackupSource() { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 15) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 15) { + sourceCase_ = 0; + source_ = null; + } + backupSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.BackupSource.Builder getBackupSourceBuilder() { + return getBackupSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BackupSourceOrBuilder getBackupSourceOrBuilder() { + if ((sourceCase_ == 15) && (backupSourceBuilder_ != null)) { + return backupSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 15) { + return (com.google.cloud.alloydb.v1alpha.BackupSource) source_; + } + return com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.BackupSource, + com.google.cloud.alloydb.v1alpha.BackupSource.Builder, + com.google.cloud.alloydb.v1alpha.BackupSourceOrBuilder> + getBackupSourceFieldBuilder() { + if (backupSourceBuilder_ == null) { + if (!(sourceCase_ == 15)) { + source_ = com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance(); + } + backupSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.BackupSource, + com.google.cloud.alloydb.v1alpha.BackupSource.Builder, + com.google.cloud.alloydb.v1alpha.BackupSourceOrBuilder>( + (com.google.cloud.alloydb.v1alpha.BackupSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 15; + onChanged(); + return backupSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.MigrationSource, + com.google.cloud.alloydb.v1alpha.MigrationSource.Builder, + com.google.cloud.alloydb.v1alpha.MigrationSourceOrBuilder> + migrationSourceBuilder_; + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the migrationSource field is set. + */ + @java.lang.Override + public boolean hasMigrationSource() { + return sourceCase_ == 16; + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The migrationSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.MigrationSource getMigrationSource() { + if (migrationSourceBuilder_ == null) { + if (sourceCase_ == 16) { + return (com.google.cloud.alloydb.v1alpha.MigrationSource) source_; + } + return com.google.cloud.alloydb.v1alpha.MigrationSource.getDefaultInstance(); + } else { + if (sourceCase_ == 16) { + return migrationSourceBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1alpha.MigrationSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMigrationSource(com.google.cloud.alloydb.v1alpha.MigrationSource value) { + if (migrationSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + migrationSourceBuilder_.setMessage(value); + } + sourceCase_ = 16; + return this; + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMigrationSource( + com.google.cloud.alloydb.v1alpha.MigrationSource.Builder builderForValue) { + if (migrationSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + migrationSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 16; + return this; + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeMigrationSource(com.google.cloud.alloydb.v1alpha.MigrationSource value) { + if (migrationSourceBuilder_ == null) { + if (sourceCase_ == 16 + && source_ != com.google.cloud.alloydb.v1alpha.MigrationSource.getDefaultInstance()) { + source_ = + com.google.cloud.alloydb.v1alpha.MigrationSource.newBuilder( + (com.google.cloud.alloydb.v1alpha.MigrationSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 16) { + migrationSourceBuilder_.mergeFrom(value); + } else { + migrationSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 16; + return this; + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMigrationSource() { + if (migrationSourceBuilder_ == null) { + if (sourceCase_ == 16) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 16) { + sourceCase_ = 0; + source_ = null; + } + migrationSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.MigrationSource.Builder getMigrationSourceBuilder() { + return getMigrationSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.MigrationSourceOrBuilder getMigrationSourceOrBuilder() { + if ((sourceCase_ == 16) && (migrationSourceBuilder_ != null)) { + return migrationSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 16) { + return (com.google.cloud.alloydb.v1alpha.MigrationSource) source_; + } + return com.google.cloud.alloydb.v1alpha.MigrationSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.MigrationSource, + com.google.cloud.alloydb.v1alpha.MigrationSource.Builder, + com.google.cloud.alloydb.v1alpha.MigrationSourceOrBuilder> + getMigrationSourceFieldBuilder() { + if (migrationSourceBuilder_ == null) { + if (!(sourceCase_ == 16)) { + source_ = com.google.cloud.alloydb.v1alpha.MigrationSource.getDefaultInstance(); + } + migrationSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.MigrationSource, + com.google.cloud.alloydb.v1alpha.MigrationSource.Builder, + com.google.cloud.alloydb.v1alpha.MigrationSourceOrBuilder>( + (com.google.cloud.alloydb.v1alpha.MigrationSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 16; + onChanged(); + return migrationSourceBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The name of the cluster resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * where the cluster ID segment should satisfy the regex expression
+     * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+     * The prefix of the cluster resource name is the name of the parent resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the cluster resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * where the cluster ID segment should satisfy the regex expression
+     * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+     * The prefix of the cluster resource name is the name of the parent resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the cluster resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * where the cluster ID segment should satisfy the regex expression
+     * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+     * The prefix of the cluster resource name is the name of the parent resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the cluster resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * where the cluster ID segment should satisfy the regex expression
+     * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+     * The prefix of the cluster resource name is the name of the parent resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the cluster resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * where the cluster ID segment should satisfy the regex expression
+     * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+     * The prefix of the cluster resource name is the name of the parent resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * User-settable and human-readable display name for the Cluster.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Cluster.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Cluster.
+     * 
+ * + * 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Cluster.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Cluster.
+     * 
+ * + * 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + 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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000020); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000040); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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 deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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; + } else { + deleteTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); + } else { + deleteTime_ = value; + } + } else { + deleteTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + bitField0_ = (bitField0_ & ~0x00000080); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_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> + 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_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000100; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000100); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000100; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000100; + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000100; + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current serving state of the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current serving state of the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current serving state of the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.State getState() { + com.google.cloud.alloydb.v1alpha.Cluster.State result = + com.google.cloud.alloydb.v1alpha.Cluster.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1alpha.Cluster.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current serving state of the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.alloydb.v1alpha.Cluster.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current serving state of the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000200); + state_ = 0; + onChanged(); + return this; + } + + private int clusterType_ = 0; + /** + * + * + *
+     * Output only. The type of the cluster. This is an output-only field and it's
+     * populated at the Cluster creation time or the Cluster promotion
+     * time. The cluster type is determined by which RPC was used to create
+     * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for clusterType. + */ + @java.lang.Override + public int getClusterTypeValue() { + return clusterType_; + } + /** + * + * + *
+     * Output only. The type of the cluster. This is an output-only field and it's
+     * populated at the Cluster creation time or the Cluster promotion
+     * time. The cluster type is determined by which RPC was used to create
+     * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for clusterType to set. + * @return This builder for chaining. + */ + public Builder setClusterTypeValue(int value) { + clusterType_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of the cluster. This is an output-only field and it's
+     * populated at the Cluster creation time or the Cluster promotion
+     * time. The cluster type is determined by which RPC was used to create
+     * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The clusterType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.ClusterType getClusterType() { + com.google.cloud.alloydb.v1alpha.Cluster.ClusterType result = + com.google.cloud.alloydb.v1alpha.Cluster.ClusterType.forNumber(clusterType_); + return result == null + ? com.google.cloud.alloydb.v1alpha.Cluster.ClusterType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The type of the cluster. This is an output-only field and it's
+     * populated at the Cluster creation time or the Cluster promotion
+     * time. The cluster type is determined by which RPC was used to create
+     * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The clusterType to set. + * @return This builder for chaining. + */ + public Builder setClusterType(com.google.cloud.alloydb.v1alpha.Cluster.ClusterType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + clusterType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of the cluster. This is an output-only field and it's
+     * populated at the Cluster creation time or the Cluster promotion
+     * time. The cluster type is determined by which RPC was used to create
+     * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearClusterType() { + bitField0_ = (bitField0_ & ~0x00000400); + clusterType_ = 0; + onChanged(); + return this; + } + + private int databaseVersion_ = 0; + /** + * + * + *
+     * Output only. The database engine major version. This is an output-only
+     * field and it's populated at the Cluster creation time. This field cannot be
+     * changed after cluster creation.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + /** + * + * + *
+     * Output only. The database engine major version. This is an output-only
+     * field and it's populated at the Cluster creation time. This field cannot be
+     * changed after cluster creation.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersionValue(int value) { + databaseVersion_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The database engine major version. This is an output-only
+     * field and it's populated at the Cluster creation time. This field cannot be
+     * changed after cluster creation.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DatabaseVersion getDatabaseVersion() { + com.google.cloud.alloydb.v1alpha.DatabaseVersion result = + com.google.cloud.alloydb.v1alpha.DatabaseVersion.forNumber(databaseVersion_); + return result == null + ? com.google.cloud.alloydb.v1alpha.DatabaseVersion.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The database engine major version. This is an output-only
+     * field and it's populated at the Cluster creation time. This field cannot be
+     * changed after cluster creation.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersion(com.google.cloud.alloydb.v1alpha.DatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000800; + databaseVersion_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The database engine major version. This is an output-only
+     * field and it's populated at the Cluster creation time. This field cannot be
+     * changed after cluster creation.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDatabaseVersion() { + bitField0_ = (bitField0_ & ~0x00000800); + databaseVersion_ = 0; + onChanged(); + return this; + } + + private java.lang.Object network_ = ""; + /** + * + * + *
+     * Required. The resource link for the VPC network in which cluster resources
+     * are created and from which they are accessible via Private IP. The network
+     * must belong to the same project as the cluster. It is specified in the
+     * form: "projects/{project_number}/global/networks/{network_id}". This is
+     * required to create a cluster. It can be updated, but it cannot be removed.
+     * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource link for the VPC network in which cluster resources
+     * are created and from which they are accessible via Private IP. The network
+     * must belong to the same project as the cluster. It is specified in the
+     * form: "projects/{project_number}/global/networks/{network_id}". This is
+     * required to create a cluster. It can be updated, but it cannot be removed.
+     * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource link for the VPC network in which cluster resources
+     * are created and from which they are accessible via Private IP. The network
+     * must belong to the same project as the cluster. It is specified in the
+     * form: "projects/{project_number}/global/networks/{network_id}". This is
+     * required to create a cluster. It can be updated, but it cannot be removed.
+     * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + network_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource link for the VPC network in which cluster resources
+     * are created and from which they are accessible via Private IP. The network
+     * must belong to the same project as the cluster. It is specified in the
+     * form: "projects/{project_number}/global/networks/{network_id}". This is
+     * required to create a cluster. It can be updated, but it cannot be removed.
+     * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource link for the VPC network in which cluster resources
+     * are created and from which they are accessible via Private IP. The network
+     * must belong to the same project as the cluster. It is specified in the
+     * form: "projects/{project_number}/global/networks/{network_id}". This is
+     * required to create a cluster. It can be updated, but it cannot be removed.
+     * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + network_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 11; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 11; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 11; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 11; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 11; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00004000; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00004000); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00004000; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00004000; + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00004000; + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Cluster does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Cluster does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Cluster does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00008000); + reconciling_ = false; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1alpha.UserPassword initialUser_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.UserPassword, + com.google.cloud.alloydb.v1alpha.UserPassword.Builder, + com.google.cloud.alloydb.v1alpha.UserPasswordOrBuilder> + initialUserBuilder_; + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the initialUser field is set. + */ + public boolean hasInitialUser() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The initialUser. + */ + public com.google.cloud.alloydb.v1alpha.UserPassword getInitialUser() { + if (initialUserBuilder_ == null) { + return initialUser_ == null + ? com.google.cloud.alloydb.v1alpha.UserPassword.getDefaultInstance() + : initialUser_; + } else { + return initialUserBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setInitialUser(com.google.cloud.alloydb.v1alpha.UserPassword value) { + if (initialUserBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + initialUser_ = value; + } else { + initialUserBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setInitialUser( + com.google.cloud.alloydb.v1alpha.UserPassword.Builder builderForValue) { + if (initialUserBuilder_ == null) { + initialUser_ = builderForValue.build(); + } else { + initialUserBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder mergeInitialUser(com.google.cloud.alloydb.v1alpha.UserPassword value) { + if (initialUserBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && initialUser_ != null + && initialUser_ != com.google.cloud.alloydb.v1alpha.UserPassword.getDefaultInstance()) { + getInitialUserBuilder().mergeFrom(value); + } else { + initialUser_ = value; + } + } else { + initialUserBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder clearInitialUser() { + bitField0_ = (bitField0_ & ~0x00010000); + initialUser_ = null; + if (initialUserBuilder_ != null) { + initialUserBuilder_.dispose(); + initialUserBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.UserPassword.Builder getInitialUserBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return getInitialUserFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.UserPasswordOrBuilder getInitialUserOrBuilder() { + if (initialUserBuilder_ != null) { + return initialUserBuilder_.getMessageOrBuilder(); + } else { + return initialUser_ == null + ? com.google.cloud.alloydb.v1alpha.UserPassword.getDefaultInstance() + : initialUser_; + } + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.UserPassword, + com.google.cloud.alloydb.v1alpha.UserPassword.Builder, + com.google.cloud.alloydb.v1alpha.UserPasswordOrBuilder> + getInitialUserFieldBuilder() { + if (initialUserBuilder_ == null) { + initialUserBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.UserPassword, + com.google.cloud.alloydb.v1alpha.UserPassword.Builder, + com.google.cloud.alloydb.v1alpha.UserPasswordOrBuilder>( + getInitialUser(), getParentForChildren(), isClean()); + initialUser_ = null; + } + return initialUserBuilder_; + } + + private com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automatedBackupPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.Builder, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicyOrBuilder> + automatedBackupPolicyBuilder_; + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + * + * + * @return Whether the automatedBackupPolicy field is set. + */ + public boolean hasAutomatedBackupPolicy() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + * + * + * @return The automatedBackupPolicy. + */ + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy getAutomatedBackupPolicy() { + if (automatedBackupPolicyBuilder_ == null) { + return automatedBackupPolicy_ == null + ? com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.getDefaultInstance() + : automatedBackupPolicy_; + } else { + return automatedBackupPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + * + */ + public Builder setAutomatedBackupPolicy( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy value) { + if (automatedBackupPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + automatedBackupPolicy_ = value; + } else { + automatedBackupPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + * + */ + public Builder setAutomatedBackupPolicy( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.Builder builderForValue) { + if (automatedBackupPolicyBuilder_ == null) { + automatedBackupPolicy_ = builderForValue.build(); + } else { + automatedBackupPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + * + */ + public Builder mergeAutomatedBackupPolicy( + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy value) { + if (automatedBackupPolicyBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) + && automatedBackupPolicy_ != null + && automatedBackupPolicy_ + != com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.getDefaultInstance()) { + getAutomatedBackupPolicyBuilder().mergeFrom(value); + } else { + automatedBackupPolicy_ = value; + } + } else { + automatedBackupPolicyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + * + */ + public Builder clearAutomatedBackupPolicy() { + bitField0_ = (bitField0_ & ~0x00020000); + automatedBackupPolicy_ = null; + if (automatedBackupPolicyBuilder_ != null) { + automatedBackupPolicyBuilder_.dispose(); + automatedBackupPolicyBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + * + */ + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.Builder + getAutomatedBackupPolicyBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return getAutomatedBackupPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + * + */ + public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicyOrBuilder + getAutomatedBackupPolicyOrBuilder() { + if (automatedBackupPolicyBuilder_ != null) { + return automatedBackupPolicyBuilder_.getMessageOrBuilder(); + } else { + return automatedBackupPolicy_ == null + ? com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.getDefaultInstance() + : automatedBackupPolicy_; + } + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.Builder, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicyOrBuilder> + getAutomatedBackupPolicyFieldBuilder() { + if (automatedBackupPolicyBuilder_ == null) { + automatedBackupPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.Builder, + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicyOrBuilder>( + getAutomatedBackupPolicy(), getParentForChildren(), isClean()); + automatedBackupPolicy_ = null; + } + return automatedBackupPolicyBuilder_; + } + + private com.google.cloud.alloydb.v1alpha.SslConfig sslConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.SslConfig, + com.google.cloud.alloydb.v1alpha.SslConfig.Builder, + com.google.cloud.alloydb.v1alpha.SslConfigOrBuilder> + sslConfigBuilder_; + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * + * @return Whether the sslConfig field is set. + */ + public boolean hasSslConfig() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * + * @return The sslConfig. + */ + public com.google.cloud.alloydb.v1alpha.SslConfig getSslConfig() { + if (sslConfigBuilder_ == null) { + return sslConfig_ == null + ? com.google.cloud.alloydb.v1alpha.SslConfig.getDefaultInstance() + : sslConfig_; + } else { + return sslConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + */ + public Builder setSslConfig(com.google.cloud.alloydb.v1alpha.SslConfig value) { + if (sslConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sslConfig_ = value; + } else { + sslConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + */ + public Builder setSslConfig( + com.google.cloud.alloydb.v1alpha.SslConfig.Builder builderForValue) { + if (sslConfigBuilder_ == null) { + sslConfig_ = builderForValue.build(); + } else { + sslConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + */ + public Builder mergeSslConfig(com.google.cloud.alloydb.v1alpha.SslConfig value) { + if (sslConfigBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) + && sslConfig_ != null + && sslConfig_ != com.google.cloud.alloydb.v1alpha.SslConfig.getDefaultInstance()) { + getSslConfigBuilder().mergeFrom(value); + } else { + sslConfig_ = value; + } + } else { + sslConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + */ + public Builder clearSslConfig() { + bitField0_ = (bitField0_ & ~0x00040000); + sslConfig_ = null; + if (sslConfigBuilder_ != null) { + sslConfigBuilder_.dispose(); + sslConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + */ + public com.google.cloud.alloydb.v1alpha.SslConfig.Builder getSslConfigBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return getSslConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + */ + public com.google.cloud.alloydb.v1alpha.SslConfigOrBuilder getSslConfigOrBuilder() { + if (sslConfigBuilder_ != null) { + return sslConfigBuilder_.getMessageOrBuilder(); + } else { + return sslConfig_ == null + ? com.google.cloud.alloydb.v1alpha.SslConfig.getDefaultInstance() + : sslConfig_; + } + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.SslConfig, + com.google.cloud.alloydb.v1alpha.SslConfig.Builder, + com.google.cloud.alloydb.v1alpha.SslConfigOrBuilder> + getSslConfigFieldBuilder() { + if (sslConfigBuilder_ == null) { + sslConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.SslConfig, + com.google.cloud.alloydb.v1alpha.SslConfig.Builder, + com.google.cloud.alloydb.v1alpha.SslConfigOrBuilder>( + getSslConfig(), getParentForChildren(), isClean()); + sslConfig_ = null; + } + return sslConfigBuilder_; + } + + private com.google.cloud.alloydb.v1alpha.EncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionConfig, + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder> + encryptionConfigBuilder_; + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00080000) != 0); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + public com.google.cloud.alloydb.v1alpha.EncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig(com.google.cloud.alloydb.v1alpha.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + } else { + encryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig( + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1alpha.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); + } else { + encryptionConfig_ = value; + } + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEncryptionConfig() { + bitField0_ = (bitField0_ & ~0x00080000); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder getEncryptionConfigBuilder() { + bitField0_ |= 0x00080000; + onChanged(); + return getEncryptionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionConfig, + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder> + getEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionConfig, + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + + private com.google.cloud.alloydb.v1alpha.EncryptionInfo encryptionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionInfo, + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder> + encryptionInfoBuilder_; + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + public boolean hasEncryptionInfo() { + return ((bitField0_ & 0x00100000) != 0); + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + public com.google.cloud.alloydb.v1alpha.EncryptionInfo getEncryptionInfo() { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } else { + return encryptionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo(com.google.cloud.alloydb.v1alpha.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionInfo_ = value; + } else { + encryptionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo( + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = builderForValue.build(); + } else { + encryptionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEncryptionInfo(com.google.cloud.alloydb.v1alpha.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (((bitField0_ & 0x00100000) != 0) + && encryptionInfo_ != null + && encryptionInfo_ + != com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance()) { + getEncryptionInfoBuilder().mergeFrom(value); + } else { + encryptionInfo_ = value; + } + } else { + encryptionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEncryptionInfo() { + bitField0_ = (bitField0_ & ~0x00100000); + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder getEncryptionInfoBuilder() { + bitField0_ |= 0x00100000; + onChanged(); + return getEncryptionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + if (encryptionInfoBuilder_ != null) { + return encryptionInfoBuilder_.getMessageOrBuilder(); + } else { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionInfo, + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder> + getEncryptionInfoFieldBuilder() { + if (encryptionInfoBuilder_ == null) { + encryptionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionInfo, + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder>( + getEncryptionInfo(), getParentForChildren(), isClean()); + encryptionInfo_ = null; + } + return encryptionInfoBuilder_; + } + + private com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuousBackupConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig, + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.Builder, + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfigOrBuilder> + continuousBackupConfigBuilder_; + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the continuousBackupConfig field is set. + */ + public boolean hasContinuousBackupConfig() { + return ((bitField0_ & 0x00200000) != 0); + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The continuousBackupConfig. + */ + public com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig getContinuousBackupConfig() { + if (continuousBackupConfigBuilder_ == null) { + return continuousBackupConfig_ == null + ? com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.getDefaultInstance() + : continuousBackupConfig_; + } else { + return continuousBackupConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setContinuousBackupConfig( + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig value) { + if (continuousBackupConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + continuousBackupConfig_ = value; + } else { + continuousBackupConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setContinuousBackupConfig( + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.Builder builderForValue) { + if (continuousBackupConfigBuilder_ == null) { + continuousBackupConfig_ = builderForValue.build(); + } else { + continuousBackupConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeContinuousBackupConfig( + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig value) { + if (continuousBackupConfigBuilder_ == null) { + if (((bitField0_ & 0x00200000) != 0) + && continuousBackupConfig_ != null + && continuousBackupConfig_ + != com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.getDefaultInstance()) { + getContinuousBackupConfigBuilder().mergeFrom(value); + } else { + continuousBackupConfig_ = value; + } + } else { + continuousBackupConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearContinuousBackupConfig() { + bitField0_ = (bitField0_ & ~0x00200000); + continuousBackupConfig_ = null; + if (continuousBackupConfigBuilder_ != null) { + continuousBackupConfigBuilder_.dispose(); + continuousBackupConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.Builder + getContinuousBackupConfigBuilder() { + bitField0_ |= 0x00200000; + onChanged(); + return getContinuousBackupConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1alpha.ContinuousBackupConfigOrBuilder + getContinuousBackupConfigOrBuilder() { + if (continuousBackupConfigBuilder_ != null) { + return continuousBackupConfigBuilder_.getMessageOrBuilder(); + } else { + return continuousBackupConfig_ == null + ? com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.getDefaultInstance() + : continuousBackupConfig_; + } + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig, + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.Builder, + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfigOrBuilder> + getContinuousBackupConfigFieldBuilder() { + if (continuousBackupConfigBuilder_ == null) { + continuousBackupConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig, + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.Builder, + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfigOrBuilder>( + getContinuousBackupConfig(), getParentForChildren(), isClean()); + continuousBackupConfig_ = null; + } + return continuousBackupConfigBuilder_; + } + + private com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuousBackupInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo, + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.Builder, + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfoOrBuilder> + continuousBackupInfoBuilder_; + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the continuousBackupInfo field is set. + */ + public boolean hasContinuousBackupInfo() { + return ((bitField0_ & 0x00400000) != 0); + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The continuousBackupInfo. + */ + public com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo getContinuousBackupInfo() { + if (continuousBackupInfoBuilder_ == null) { + return continuousBackupInfo_ == null + ? com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.getDefaultInstance() + : continuousBackupInfo_; + } else { + return continuousBackupInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setContinuousBackupInfo( + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo value) { + if (continuousBackupInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + continuousBackupInfo_ = value; + } else { + continuousBackupInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setContinuousBackupInfo( + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.Builder builderForValue) { + if (continuousBackupInfoBuilder_ == null) { + continuousBackupInfo_ = builderForValue.build(); + } else { + continuousBackupInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeContinuousBackupInfo( + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo value) { + if (continuousBackupInfoBuilder_ == null) { + if (((bitField0_ & 0x00400000) != 0) + && continuousBackupInfo_ != null + && continuousBackupInfo_ + != com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.getDefaultInstance()) { + getContinuousBackupInfoBuilder().mergeFrom(value); + } else { + continuousBackupInfo_ = value; + } + } else { + continuousBackupInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearContinuousBackupInfo() { + bitField0_ = (bitField0_ & ~0x00400000); + continuousBackupInfo_ = null; + if (continuousBackupInfoBuilder_ != null) { + continuousBackupInfoBuilder_.dispose(); + continuousBackupInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.Builder + getContinuousBackupInfoBuilder() { + bitField0_ |= 0x00400000; + onChanged(); + return getContinuousBackupInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.ContinuousBackupInfoOrBuilder + getContinuousBackupInfoOrBuilder() { + if (continuousBackupInfoBuilder_ != null) { + return continuousBackupInfoBuilder_.getMessageOrBuilder(); + } else { + return continuousBackupInfo_ == null + ? com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.getDefaultInstance() + : continuousBackupInfo_; + } + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo, + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.Builder, + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfoOrBuilder> + getContinuousBackupInfoFieldBuilder() { + if (continuousBackupInfoBuilder_ == null) { + continuousBackupInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo, + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.Builder, + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfoOrBuilder>( + getContinuousBackupInfo(), getParentForChildren(), isClean()); + continuousBackupInfo_ = null; + } + return continuousBackupInfoBuilder_; + } + + private com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondaryConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig, + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.Builder, + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfigOrBuilder> + secondaryConfigBuilder_; + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + * + * @return Whether the secondaryConfig field is set. + */ + public boolean hasSecondaryConfig() { + return ((bitField0_ & 0x00800000) != 0); + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + * + * @return The secondaryConfig. + */ + public com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig getSecondaryConfig() { + if (secondaryConfigBuilder_ == null) { + return secondaryConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.getDefaultInstance() + : secondaryConfig_; + } else { + return secondaryConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + */ + public Builder setSecondaryConfig( + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig value) { + if (secondaryConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + secondaryConfig_ = value; + } else { + secondaryConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + */ + public Builder setSecondaryConfig( + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.Builder builderForValue) { + if (secondaryConfigBuilder_ == null) { + secondaryConfig_ = builderForValue.build(); + } else { + secondaryConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + */ + public Builder mergeSecondaryConfig( + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig value) { + if (secondaryConfigBuilder_ == null) { + if (((bitField0_ & 0x00800000) != 0) + && secondaryConfig_ != null + && secondaryConfig_ + != com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.getDefaultInstance()) { + getSecondaryConfigBuilder().mergeFrom(value); + } else { + secondaryConfig_ = value; + } + } else { + secondaryConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + */ + public Builder clearSecondaryConfig() { + bitField0_ = (bitField0_ & ~0x00800000); + secondaryConfig_ = null; + if (secondaryConfigBuilder_ != null) { + secondaryConfigBuilder_.dispose(); + secondaryConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + */ + public com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.Builder + getSecondaryConfigBuilder() { + bitField0_ |= 0x00800000; + onChanged(); + return getSecondaryConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + */ + public com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfigOrBuilder + getSecondaryConfigOrBuilder() { + if (secondaryConfigBuilder_ != null) { + return secondaryConfigBuilder_.getMessageOrBuilder(); + } else { + return secondaryConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.getDefaultInstance() + : secondaryConfig_; + } + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig, + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.Builder, + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfigOrBuilder> + getSecondaryConfigFieldBuilder() { + if (secondaryConfigBuilder_ == null) { + secondaryConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig, + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.Builder, + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfigOrBuilder>( + getSecondaryConfig(), getParentForChildren(), isClean()); + secondaryConfig_ = null; + } + return secondaryConfigBuilder_; + } + + private com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primaryConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig, + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.Builder, + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfigOrBuilder> + primaryConfigBuilder_; + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the primaryConfig field is set. + */ + public boolean hasPrimaryConfig() { + return ((bitField0_ & 0x01000000) != 0); + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The primaryConfig. + */ + public com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig getPrimaryConfig() { + if (primaryConfigBuilder_ == null) { + return primaryConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.getDefaultInstance() + : primaryConfig_; + } else { + return primaryConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPrimaryConfig(com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig value) { + if (primaryConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + primaryConfig_ = value; + } else { + primaryConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPrimaryConfig( + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.Builder builderForValue) { + if (primaryConfigBuilder_ == null) { + primaryConfig_ = builderForValue.build(); + } else { + primaryConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergePrimaryConfig( + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig value) { + if (primaryConfigBuilder_ == null) { + if (((bitField0_ & 0x01000000) != 0) + && primaryConfig_ != null + && primaryConfig_ + != com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.getDefaultInstance()) { + getPrimaryConfigBuilder().mergeFrom(value); + } else { + primaryConfig_ = value; + } + } else { + primaryConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPrimaryConfig() { + bitField0_ = (bitField0_ & ~0x01000000); + primaryConfig_ = null; + if (primaryConfigBuilder_ != null) { + primaryConfigBuilder_.dispose(); + primaryConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.Builder + getPrimaryConfigBuilder() { + bitField0_ |= 0x01000000; + onChanged(); + return getPrimaryConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfigOrBuilder + getPrimaryConfigOrBuilder() { + if (primaryConfigBuilder_ != null) { + return primaryConfigBuilder_.getMessageOrBuilder(); + } else { + return primaryConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.getDefaultInstance() + : primaryConfig_; + } + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig, + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.Builder, + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfigOrBuilder> + getPrimaryConfigFieldBuilder() { + if (primaryConfigBuilder_ == null) { + primaryConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig, + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.Builder, + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfigOrBuilder>( + getPrimaryConfig(), getParentForChildren(), isClean()); + primaryConfig_ = null; + } + return primaryConfigBuilder_; + } + + @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.alloydb.v1alpha.Cluster) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.Cluster) + private static final com.google.cloud.alloydb.v1alpha.Cluster DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.Cluster(); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Cluster 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.alloydb.v1alpha.Cluster getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ClusterName.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ClusterName.java new file mode 100644 index 000000000000..c795d084b92b --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ClusterName.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.alloydb.v1alpha; + +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 ClusterName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CLUSTER = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/clusters/{cluster}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String cluster; + + @Deprecated + protected ClusterName() { + project = null; + location = null; + cluster = null; + } + + private ClusterName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + cluster = Preconditions.checkNotNull(builder.getCluster()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ClusterName of(String project, String location, String cluster) { + return newBuilder().setProject(project).setLocation(location).setCluster(cluster).build(); + } + + public static String format(String project, String location, String cluster) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCluster(cluster) + .build() + .toString(); + } + + public static ClusterName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CLUSTER.validatedMatch( + formattedString, "ClusterName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("cluster")); + } + + 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 (ClusterName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CLUSTER.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 (cluster != null) { + fieldMapBuilder.put("cluster", cluster); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CLUSTER.instantiate( + "project", project, "location", location, "cluster", cluster); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ClusterName that = ((ClusterName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.cluster, that.cluster); + } + 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(cluster); + return h; + } + + /** Builder for projects/{project}/locations/{location}/clusters/{cluster}. */ + public static class Builder { + private String project; + private String location; + private String cluster; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCluster(String cluster) { + this.cluster = cluster; + return this; + } + + private Builder(ClusterName clusterName) { + this.project = clusterName.project; + this.location = clusterName.location; + this.cluster = clusterName.cluster; + } + + public ClusterName build() { + return new ClusterName(this); + } + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ClusterOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ClusterOrBuilder.java new file mode 100644 index 000000000000..0b713470c738 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ClusterOrBuilder.java @@ -0,0 +1,995 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface ClusterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.Cluster) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupSource field is set. + */ + boolean hasBackupSource(); + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupSource. + */ + com.google.cloud.alloydb.v1alpha.BackupSource getBackupSource(); + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1alpha.BackupSourceOrBuilder getBackupSourceOrBuilder(); + + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the migrationSource field is set. + */ + boolean hasMigrationSource(); + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The migrationSource. + */ + com.google.cloud.alloydb.v1alpha.MigrationSource getMigrationSource(); + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1alpha.MigrationSourceOrBuilder getMigrationSourceOrBuilder(); + + /** + * + * + *
+   * Output only. The name of the cluster resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * where the cluster ID segment should satisfy the regex expression
+   * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+   * The prefix of the cluster resource name is the name of the parent resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The name of the cluster resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * where the cluster ID segment should satisfy the regex expression
+   * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+   * The prefix of the cluster resource name is the name of the parent resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * User-settable and human-readable display name for the Cluster.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * User-settable and human-readable display name for the Cluster.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The current serving state of the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current serving state of the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.alloydb.v1alpha.Cluster.State getState(); + + /** + * + * + *
+   * Output only. The type of the cluster. This is an output-only field and it's
+   * populated at the Cluster creation time or the Cluster promotion
+   * time. The cluster type is determined by which RPC was used to create
+   * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for clusterType. + */ + int getClusterTypeValue(); + /** + * + * + *
+   * Output only. The type of the cluster. This is an output-only field and it's
+   * populated at the Cluster creation time or the Cluster promotion
+   * time. The cluster type is determined by which RPC was used to create
+   * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The clusterType. + */ + com.google.cloud.alloydb.v1alpha.Cluster.ClusterType getClusterType(); + + /** + * + * + *
+   * Output only. The database engine major version. This is an output-only
+   * field and it's populated at the Cluster creation time. This field cannot be
+   * changed after cluster creation.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + int getDatabaseVersionValue(); + /** + * + * + *
+   * Output only. The database engine major version. This is an output-only
+   * field and it's populated at the Cluster creation time. This field cannot be
+   * changed after cluster creation.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + com.google.cloud.alloydb.v1alpha.DatabaseVersion getDatabaseVersion(); + + /** + * + * + *
+   * Required. The resource link for the VPC network in which cluster resources
+   * are created and from which they are accessible via Private IP. The network
+   * must belong to the same project as the cluster. It is specified in the
+   * form: "projects/{project_number}/global/networks/{network_id}". This is
+   * required to create a cluster. It can be updated, but it cannot be removed.
+   * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * Required. The resource link for the VPC network in which cluster resources
+   * are created and from which they are accessible via Private IP. The network
+   * must belong to the same project as the cluster. It is specified in the
+   * form: "projects/{project_number}/global/networks/{network_id}". This is
+   * required to create a cluster. It can be updated, but it cannot be removed.
+   * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 11; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 11; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+   * Set to true if the current state of Cluster does not match the user's
+   * intended state, and the service is actively updating the resource to
+   * reconcile them. This can happen due to user-triggered updates or
+   * system actions like failover or maintenance.
+   * 
+ * + * bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the initialUser field is set. + */ + boolean hasInitialUser(); + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The initialUser. + */ + com.google.cloud.alloydb.v1alpha.UserPassword getInitialUser(); + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1alpha.UserPasswordOrBuilder getInitialUserOrBuilder(); + + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return Whether the automatedBackupPolicy field is set. + */ + boolean hasAutomatedBackupPolicy(); + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return The automatedBackupPolicy. + */ + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy getAutomatedBackupPolicy(); + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + */ + com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicyOrBuilder + getAutomatedBackupPolicyOrBuilder(); + + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * + * @return Whether the sslConfig field is set. + */ + boolean hasSslConfig(); + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * + * @return The sslConfig. + */ + com.google.cloud.alloydb.v1alpha.SslConfig getSslConfig(); + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + */ + com.google.cloud.alloydb.v1alpha.SslConfigOrBuilder getSslConfigOrBuilder(); + + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + com.google.cloud.alloydb.v1alpha.EncryptionConfig getEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); + + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + boolean hasEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + com.google.cloud.alloydb.v1alpha.EncryptionInfo getEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(); + + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the continuousBackupConfig field is set. + */ + boolean hasContinuousBackupConfig(); + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The continuousBackupConfig. + */ + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig getContinuousBackupConfig(); + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfigOrBuilder + getContinuousBackupConfigOrBuilder(); + + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the continuousBackupInfo field is set. + */ + boolean hasContinuousBackupInfo(); + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The continuousBackupInfo. + */ + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo getContinuousBackupInfo(); + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfoOrBuilder getContinuousBackupInfoOrBuilder(); + + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + * + * @return Whether the secondaryConfig field is set. + */ + boolean hasSecondaryConfig(); + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + * + * @return The secondaryConfig. + */ + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig getSecondaryConfig(); + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + */ + com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfigOrBuilder getSecondaryConfigOrBuilder(); + + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the primaryConfig field is set. + */ + boolean hasPrimaryConfig(); + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The primaryConfig. + */ + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig getPrimaryConfig(); + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfigOrBuilder getPrimaryConfigOrBuilder(); + + public com.google.cloud.alloydb.v1alpha.Cluster.SourceCase getSourceCase(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ConnectionInfo.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ConnectionInfo.java new file mode 100644 index 000000000000..8799dab037d2 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ConnectionInfo.java @@ -0,0 +1,1319 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * ConnectionInfo singleton resource.
+ * https://google.aip.dev/156
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ConnectionInfo} + */ +public final class ConnectionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.ConnectionInfo) + ConnectionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConnectionInfo.newBuilder() to construct. + private ConnectionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConnectionInfo() { + name_ = ""; + ipAddress_ = ""; + pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.EMPTY; + instanceUid_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConnectionInfo(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ConnectionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ConnectionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ConnectionInfo.class, + com.google.cloud.alloydb.v1alpha.ConnectionInfo.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * The name of the ConnectionInfo singleton resource, e.g.:
+   * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+   * This field currently has no semantic meaning.
+   * 
+ * + * 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 name of the ConnectionInfo singleton resource, e.g.:
+   * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+   * This field currently has no semantic meaning.
+   * 
+ * + * 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 IP_ADDRESS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object ipAddress_ = ""; + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ipAddress. + */ + @java.lang.Override + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + 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(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for ipAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PEM_CERTIFICATE_CHAIN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList pemCertificateChain_; + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the pemCertificateChain. + */ + public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { + return pemCertificateChain_; + } + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of pemCertificateChain. + */ + public int getPemCertificateChainCount() { + return pemCertificateChain_.size(); + } + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The pemCertificateChain at the given index. + */ + public java.lang.String getPemCertificateChain(int index) { + return pemCertificateChain_.get(index); + } + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the pemCertificateChain at the given index. + */ + public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { + return pemCertificateChain_.getByteString(index); + } + + public static final int INSTANCE_UID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceUid_ = ""; + /** + * + * + *
+   * Output only. The unique ID of the Instance.
+   * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The instanceUid. + */ + @java.lang.Override + public java.lang.String getInstanceUid() { + java.lang.Object ref = instanceUid_; + 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(); + instanceUid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The unique ID of the Instance.
+   * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for instanceUid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceUidBytes() { + java.lang.Object ref = instanceUid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceUid_ = 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(ipAddress_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ipAddress_); + } + for (int i = 0; i < pemCertificateChain_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pemCertificateChain_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceUid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, instanceUid_); + } + 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(ipAddress_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ipAddress_); + } + { + int dataSize = 0; + for (int i = 0; i < pemCertificateChain_.size(); i++) { + dataSize += computeStringSizeNoTag(pemCertificateChain_.getRaw(i)); + } + size += dataSize; + size += 1 * getPemCertificateChainList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceUid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, instanceUid_); + } + 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.alloydb.v1alpha.ConnectionInfo)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.ConnectionInfo other = + (com.google.cloud.alloydb.v1alpha.ConnectionInfo) obj; + + if (!getName().equals(other.getName())) return false; + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (!getPemCertificateChainList().equals(other.getPemCertificateChainList())) return false; + if (!getInstanceUid().equals(other.getInstanceUid())) 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) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + if (getPemCertificateChainCount() > 0) { + hash = (37 * hash) + PEM_CERTIFICATE_CHAIN_FIELD_NUMBER; + hash = (53 * hash) + getPemCertificateChainList().hashCode(); + } + hash = (37 * hash) + INSTANCE_UID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceUid().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.ConnectionInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ConnectionInfo 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.alloydb.v1alpha.ConnectionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ConnectionInfo 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.alloydb.v1alpha.ConnectionInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ConnectionInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ConnectionInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ConnectionInfo 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.alloydb.v1alpha.ConnectionInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ConnectionInfo 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.alloydb.v1alpha.ConnectionInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ConnectionInfo 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.alloydb.v1alpha.ConnectionInfo 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; + } + /** + * + * + *
+   * ConnectionInfo singleton resource.
+   * https://google.aip.dev/156
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ConnectionInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.ConnectionInfo) + com.google.cloud.alloydb.v1alpha.ConnectionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ConnectionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ConnectionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ConnectionInfo.class, + com.google.cloud.alloydb.v1alpha.ConnectionInfo.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.ConnectionInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + ipAddress_ = ""; + pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + instanceUid_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ConnectionInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ConnectionInfo getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.ConnectionInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ConnectionInfo build() { + com.google.cloud.alloydb.v1alpha.ConnectionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ConnectionInfo buildPartial() { + com.google.cloud.alloydb.v1alpha.ConnectionInfo result = + new com.google.cloud.alloydb.v1alpha.ConnectionInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.ConnectionInfo result) { + if (((bitField0_ & 0x00000004) != 0)) { + pemCertificateChain_ = pemCertificateChain_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.pemCertificateChain_ = pemCertificateChain_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.ConnectionInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ipAddress_ = ipAddress_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.instanceUid_ = instanceUid_; + } + } + + @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.alloydb.v1alpha.ConnectionInfo) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.ConnectionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.ConnectionInfo other) { + if (other == com.google.cloud.alloydb.v1alpha.ConnectionInfo.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.pemCertificateChain_.isEmpty()) { + if (pemCertificateChain_.isEmpty()) { + pemCertificateChain_ = other.pemCertificateChain_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.addAll(other.pemCertificateChain_); + } + onChanged(); + } + if (!other.getInstanceUid().isEmpty()) { + instanceUid_ = other.instanceUid_; + bitField0_ |= 0x00000008; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + ipAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.add(s); + break; + } // case 26 + case 34: + { + instanceUid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the ConnectionInfo singleton resource, e.g.:
+     * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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 name of the ConnectionInfo singleton resource, e.g.:
+     * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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 name of the ConnectionInfo singleton resource, e.g.:
+     * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the ConnectionInfo singleton resource, e.g.:
+     * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+     * This field currently has no semantic meaning.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the ConnectionInfo singleton resource, e.g.:
+     * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object ipAddress_ = ""; + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ipAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + ipAddress_ = getDefaultInstance().getIpAddress(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ipAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList pemCertificateChain_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePemCertificateChainIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + pemCertificateChain_ = new com.google.protobuf.LazyStringArrayList(pemCertificateChain_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the pemCertificateChain. + */ + public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { + return pemCertificateChain_.getUnmodifiableView(); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of pemCertificateChain. + */ + public int getPemCertificateChainCount() { + return pemCertificateChain_.size(); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The pemCertificateChain at the given index. + */ + public java.lang.String getPemCertificateChain(int index) { + return pemCertificateChain_.get(index); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the pemCertificateChain at the given index. + */ + public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { + return pemCertificateChain_.getByteString(index); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The pemCertificateChain to set. + * @return This builder for chaining. + */ + public Builder setPemCertificateChain(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The pemCertificateChain to add. + * @return This builder for chaining. + */ + public Builder addPemCertificateChain(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The pemCertificateChain to add. + * @return This builder for chaining. + */ + public Builder addAllPemCertificateChain(java.lang.Iterable values) { + ensurePemCertificateChainIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pemCertificateChain_); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearPemCertificateChain() { + pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes of the pemCertificateChain to add. + * @return This builder for chaining. + */ + public Builder addPemCertificateChainBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.add(value); + onChanged(); + return this; + } + + private java.lang.Object instanceUid_ = ""; + /** + * + * + *
+     * Output only. The unique ID of the Instance.
+     * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The instanceUid. + */ + public java.lang.String getInstanceUid() { + java.lang.Object ref = instanceUid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceUid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The unique ID of the Instance.
+     * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for instanceUid. + */ + public com.google.protobuf.ByteString getInstanceUidBytes() { + java.lang.Object ref = instanceUid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The unique ID of the Instance.
+     * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The instanceUid to set. + * @return This builder for chaining. + */ + public Builder setInstanceUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instanceUid_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique ID of the Instance.
+     * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearInstanceUid() { + instanceUid_ = getDefaultInstance().getInstanceUid(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique ID of the Instance.
+     * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for instanceUid to set. + * @return This builder for chaining. + */ + public Builder setInstanceUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instanceUid_ = value; + bitField0_ |= 0x00000008; + 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.alloydb.v1alpha.ConnectionInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.ConnectionInfo) + private static final com.google.cloud.alloydb.v1alpha.ConnectionInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.ConnectionInfo(); + } + + public static com.google.cloud.alloydb.v1alpha.ConnectionInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionInfo 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.alloydb.v1alpha.ConnectionInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ConnectionInfoOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ConnectionInfoOrBuilder.java new file mode 100644 index 000000000000..3a1178baa775 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ConnectionInfoOrBuilder.java @@ -0,0 +1,165 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface ConnectionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.ConnectionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the ConnectionInfo singleton resource, e.g.:
+   * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+   * This field currently has no semantic meaning.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the ConnectionInfo singleton resource, e.g.:
+   * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+   * This field currently has no semantic meaning.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the pemCertificateChain. + */ + java.util.List getPemCertificateChainList(); + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of pemCertificateChain. + */ + int getPemCertificateChainCount(); + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The pemCertificateChain at the given index. + */ + java.lang.String getPemCertificateChain(int index); + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the pemCertificateChain at the given index. + */ + com.google.protobuf.ByteString getPemCertificateChainBytes(int index); + + /** + * + * + *
+   * Output only. The unique ID of the Instance.
+   * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The instanceUid. + */ + java.lang.String getInstanceUid(); + /** + * + * + *
+   * Output only. The unique ID of the Instance.
+   * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for instanceUid. + */ + com.google.protobuf.ByteString getInstanceUidBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupConfig.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupConfig.java new file mode 100644 index 000000000000..bc138417db55 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupConfig.java @@ -0,0 +1,987 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * ContinuousBackupConfig describes the continuous backups recovery
+ * configurations of a cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ContinuousBackupConfig} + */ +public final class ContinuousBackupConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.ContinuousBackupConfig) + ContinuousBackupConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContinuousBackupConfig.newBuilder() to construct. + private ContinuousBackupConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ContinuousBackupConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ContinuousBackupConfig(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.class, + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.Builder.class); + } + + private int bitField0_; + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_ = false; + /** + * + * + *
+   * Whether ContinuousBackup is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Whether ContinuousBackup is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + public static final int RECOVERY_WINDOW_DAYS_FIELD_NUMBER = 4; + private int recoveryWindowDays_ = 0; + /** + * + * + *
+   * The number of days backups and logs will be retained, which determines the
+   * window of time that data is recoverable for. If not set, it defaults to 14
+   * days.
+   * 
+ * + * int32 recovery_window_days = 4; + * + * @return The recoveryWindowDays. + */ + @java.lang.Override + public int getRecoveryWindowDays() { + return recoveryWindowDays_; + } + + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1alpha.EncryptionConfig encryptionConfig_; + /** + * + * + *
+   * The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return encryptionConfig_ != null; + } + /** + * + * + *
+   * The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + /** + * + * + *
+   * The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + 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, enabled_); + } + if (encryptionConfig_ != null) { + output.writeMessage(3, getEncryptionConfig()); + } + if (recoveryWindowDays_ != 0) { + output.writeInt32(4, recoveryWindowDays_); + } + 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, enabled_); + } + if (encryptionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEncryptionConfig()); + } + if (recoveryWindowDays_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, recoveryWindowDays_); + } + 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.alloydb.v1alpha.ContinuousBackupConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig other = + (com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig) obj; + + if (hasEnabled() != other.hasEnabled()) return false; + if (hasEnabled()) { + if (getEnabled() != other.getEnabled()) return false; + } + if (getRecoveryWindowDays() != other.getRecoveryWindowDays()) return false; + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) 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 (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); + } + hash = (37 * hash) + RECOVERY_WINDOW_DAYS_FIELD_NUMBER; + hash = (53 * hash) + getRecoveryWindowDays(); + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig 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.alloydb.v1alpha.ContinuousBackupConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig 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.alloydb.v1alpha.ContinuousBackupConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig 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.alloydb.v1alpha.ContinuousBackupConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig 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.alloydb.v1alpha.ContinuousBackupConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig 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.alloydb.v1alpha.ContinuousBackupConfig 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; + } + /** + * + * + *
+   * ContinuousBackupConfig describes the continuous backups recovery
+   * configurations of a cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ContinuousBackupConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.ContinuousBackupConfig) + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.class, + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enabled_ = false; + recoveryWindowDays_ = 0; + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig build() { + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig buildPartial() { + com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig result = + new com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enabled_ = enabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.recoveryWindowDays_ = recoveryWindowDays_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.encryptionConfig_ = + encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); + } + result.bitField0_ |= to_bitField0_; + } + + @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.alloydb.v1alpha.ContinuousBackupConfig) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig other) { + if (other == com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.getDefaultInstance()) + return this; + if (other.hasEnabled()) { + setEnabled(other.getEnabled()); + } + if (other.getRecoveryWindowDays() != 0) { + setRecoveryWindowDays(other.getRecoveryWindowDays()); + } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } + 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: + { + enabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 26: + { + input.readMessage( + getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + recoveryWindowDays_ = input.readInt32(); + bitField0_ |= 0x00000002; + 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 int bitField0_; + + private boolean enabled_; + /** + * + * + *
+     * Whether ContinuousBackup is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Whether ContinuousBackup is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + /** + * + * + *
+     * Whether ContinuousBackup is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether ContinuousBackup is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + enabled_ = false; + onChanged(); + return this; + } + + private int recoveryWindowDays_; + /** + * + * + *
+     * The number of days backups and logs will be retained, which determines the
+     * window of time that data is recoverable for. If not set, it defaults to 14
+     * days.
+     * 
+ * + * int32 recovery_window_days = 4; + * + * @return The recoveryWindowDays. + */ + @java.lang.Override + public int getRecoveryWindowDays() { + return recoveryWindowDays_; + } + /** + * + * + *
+     * The number of days backups and logs will be retained, which determines the
+     * window of time that data is recoverable for. If not set, it defaults to 14
+     * days.
+     * 
+ * + * int32 recovery_window_days = 4; + * + * @param value The recoveryWindowDays to set. + * @return This builder for chaining. + */ + public Builder setRecoveryWindowDays(int value) { + + recoveryWindowDays_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of days backups and logs will be retained, which determines the
+     * window of time that data is recoverable for. If not set, it defaults to 14
+     * days.
+     * 
+ * + * int32 recovery_window_days = 4; + * + * @return This builder for chaining. + */ + public Builder clearRecoveryWindowDays() { + bitField0_ = (bitField0_ & ~0x00000002); + recoveryWindowDays_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1alpha.EncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionConfig, + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder> + encryptionConfigBuilder_; + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + * + * @return The encryptionConfig. + */ + public com.google.cloud.alloydb.v1alpha.EncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + */ + public Builder setEncryptionConfig(com.google.cloud.alloydb.v1alpha.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + } else { + encryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + */ + public Builder setEncryptionConfig( + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + */ + public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1alpha.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); + } else { + encryptionConfig_ = value; + } + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + */ + public Builder clearEncryptionConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + */ + public com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder getEncryptionConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getEncryptionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + */ + public com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionConfig, + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder> + getEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionConfig, + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + + @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.alloydb.v1alpha.ContinuousBackupConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.ContinuousBackupConfig) + private static final com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig(); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContinuousBackupConfig 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.alloydb.v1alpha.ContinuousBackupConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupConfigOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupConfigOrBuilder.java new file mode 100644 index 000000000000..94dd063166fa --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupConfigOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface ContinuousBackupConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.ContinuousBackupConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether ContinuousBackup is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + boolean hasEnabled(); + /** + * + * + *
+   * Whether ContinuousBackup is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + boolean getEnabled(); + + /** + * + * + *
+   * The number of days backups and logs will be retained, which determines the
+   * window of time that data is recoverable for. If not set, it defaults to 14
+   * days.
+   * 
+ * + * int32 recovery_window_days = 4; + * + * @return The recoveryWindowDays. + */ + int getRecoveryWindowDays(); + + /** + * + * + *
+   * The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + /** + * + * + *
+   * The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + * + * @return The encryptionConfig. + */ + com.google.cloud.alloydb.v1alpha.EncryptionConfig getEncryptionConfig(); + /** + * + * + *
+   * The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + */ + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupInfo.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupInfo.java new file mode 100644 index 000000000000..9b420e42d0cc --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupInfo.java @@ -0,0 +1,1480 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * ContinuousBackupInfo describes the continuous backup properties of a
+ * cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ContinuousBackupInfo} + */ +public final class ContinuousBackupInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.ContinuousBackupInfo) + ContinuousBackupInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContinuousBackupInfo.newBuilder() to construct. + private ContinuousBackupInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ContinuousBackupInfo() { + schedule_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ContinuousBackupInfo(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.class, + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.Builder.class); + } + + public static final int ENCRYPTION_INFO_FIELD_NUMBER = 1; + private com.google.cloud.alloydb.v1alpha.EncryptionInfo encryptionInfo_; + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + @java.lang.Override + public boolean hasEncryptionInfo() { + return encryptionInfo_ != null; + } + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionInfo getEncryptionInfo() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + + public static final int ENABLED_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp enabledTime_; + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the enabledTime field is set. + */ + @java.lang.Override + public boolean hasEnabledTime() { + return enabledTime_ != null; + } + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enabledTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEnabledTime() { + return enabledTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : enabledTime_; + } + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEnabledTimeOrBuilder() { + return enabledTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : enabledTime_; + } + + public static final int SCHEDULE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List schedule_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.type.DayOfWeek> + schedule_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.type.DayOfWeek>() { + public com.google.type.DayOfWeek convert(java.lang.Integer from) { + com.google.type.DayOfWeek result = com.google.type.DayOfWeek.forNumber(from); + return result == null ? com.google.type.DayOfWeek.UNRECOGNIZED : result; + } + }; + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the schedule. + */ + @java.lang.Override + public java.util.List getScheduleList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.type.DayOfWeek>(schedule_, schedule_converter_); + } + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of schedule. + */ + @java.lang.Override + public int getScheduleCount() { + return schedule_.size(); + } + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The schedule at the given index. + */ + @java.lang.Override + public com.google.type.DayOfWeek getSchedule(int index) { + return schedule_converter_.convert(schedule_.get(index)); + } + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the enum numeric values on the wire for schedule. + */ + @java.lang.Override + public java.util.List getScheduleValueList() { + return schedule_; + } + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of schedule at the given index. + */ + @java.lang.Override + public int getScheduleValue(int index) { + return schedule_.get(index); + } + + private int scheduleMemoizedSerializedSize; + + 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 (encryptionInfo_ != null) { + output.writeMessage(1, getEncryptionInfo()); + } + if (enabledTime_ != null) { + output.writeMessage(2, getEnabledTime()); + } + if (getScheduleList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(scheduleMemoizedSerializedSize); + } + for (int i = 0; i < schedule_.size(); i++) { + output.writeEnumNoTag(schedule_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encryptionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEncryptionInfo()); + } + if (enabledTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEnabledTime()); + } + { + int dataSize = 0; + for (int i = 0; i < schedule_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(schedule_.get(i)); + } + size += dataSize; + if (!getScheduleList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + scheduleMemoizedSerializedSize = 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.alloydb.v1alpha.ContinuousBackupInfo)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo other = + (com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo) obj; + + if (hasEncryptionInfo() != other.hasEncryptionInfo()) return false; + if (hasEncryptionInfo()) { + if (!getEncryptionInfo().equals(other.getEncryptionInfo())) return false; + } + if (hasEnabledTime() != other.hasEnabledTime()) return false; + if (hasEnabledTime()) { + if (!getEnabledTime().equals(other.getEnabledTime())) return false; + } + if (!schedule_.equals(other.schedule_)) 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 (hasEncryptionInfo()) { + hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionInfo().hashCode(); + } + if (hasEnabledTime()) { + hash = (37 * hash) + ENABLED_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEnabledTime().hashCode(); + } + if (getScheduleCount() > 0) { + hash = (37 * hash) + SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + schedule_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo 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.alloydb.v1alpha.ContinuousBackupInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo 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.alloydb.v1alpha.ContinuousBackupInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo 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.alloydb.v1alpha.ContinuousBackupInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo 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.alloydb.v1alpha.ContinuousBackupInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo 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.alloydb.v1alpha.ContinuousBackupInfo 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; + } + /** + * + * + *
+   * ContinuousBackupInfo describes the continuous backup properties of a
+   * cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ContinuousBackupInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.ContinuousBackupInfo) + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.class, + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + enabledTime_ = null; + if (enabledTimeBuilder_ != null) { + enabledTimeBuilder_.dispose(); + enabledTimeBuilder_ = null; + } + schedule_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo build() { + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo buildPartial() { + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo result = + new com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo result) { + if (((bitField0_ & 0x00000004) != 0)) { + schedule_ = java.util.Collections.unmodifiableList(schedule_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.schedule_ = schedule_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encryptionInfo_ = + encryptionInfoBuilder_ == null ? encryptionInfo_ : encryptionInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.enabledTime_ = + enabledTimeBuilder_ == null ? enabledTime_ : enabledTimeBuilder_.build(); + } + } + + @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.alloydb.v1alpha.ContinuousBackupInfo) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo other) { + if (other == com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.getDefaultInstance()) + return this; + if (other.hasEncryptionInfo()) { + mergeEncryptionInfo(other.getEncryptionInfo()); + } + if (other.hasEnabledTime()) { + mergeEnabledTime(other.getEnabledTime()); + } + if (!other.schedule_.isEmpty()) { + if (schedule_.isEmpty()) { + schedule_ = other.schedule_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureScheduleIsMutable(); + schedule_.addAll(other.schedule_); + } + 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(getEncryptionInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEnabledTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + int tmpRaw = input.readEnum(); + ensureScheduleIsMutable(); + schedule_.add(tmpRaw); + break; + } // case 24 + case 26: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureScheduleIsMutable(); + schedule_.add(tmpRaw); + } + input.popLimit(oldLimit); + 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 com.google.cloud.alloydb.v1alpha.EncryptionInfo encryptionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionInfo, + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder> + encryptionInfoBuilder_; + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + public boolean hasEncryptionInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + public com.google.cloud.alloydb.v1alpha.EncryptionInfo getEncryptionInfo() { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } else { + return encryptionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo(com.google.cloud.alloydb.v1alpha.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionInfo_ = value; + } else { + encryptionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo( + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = builderForValue.build(); + } else { + encryptionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEncryptionInfo(com.google.cloud.alloydb.v1alpha.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && encryptionInfo_ != null + && encryptionInfo_ + != com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance()) { + getEncryptionInfoBuilder().mergeFrom(value); + } else { + encryptionInfo_ = value; + } + } else { + encryptionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEncryptionInfo() { + bitField0_ = (bitField0_ & ~0x00000001); + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder getEncryptionInfoBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getEncryptionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + if (encryptionInfoBuilder_ != null) { + return encryptionInfoBuilder_.getMessageOrBuilder(); + } else { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionInfo, + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder> + getEncryptionInfoFieldBuilder() { + if (encryptionInfoBuilder_ == null) { + encryptionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.EncryptionInfo, + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder>( + getEncryptionInfo(), getParentForChildren(), isClean()); + encryptionInfo_ = null; + } + return encryptionInfoBuilder_; + } + + private com.google.protobuf.Timestamp enabledTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + enabledTimeBuilder_; + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the enabledTime field is set. + */ + public boolean hasEnabledTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enabledTime. + */ + public com.google.protobuf.Timestamp getEnabledTime() { + if (enabledTimeBuilder_ == null) { + return enabledTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : enabledTime_; + } else { + return enabledTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEnabledTime(com.google.protobuf.Timestamp value) { + if (enabledTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enabledTime_ = value; + } else { + enabledTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEnabledTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (enabledTimeBuilder_ == null) { + enabledTime_ = builderForValue.build(); + } else { + enabledTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEnabledTime(com.google.protobuf.Timestamp value) { + if (enabledTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && enabledTime_ != null + && enabledTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEnabledTimeBuilder().mergeFrom(value); + } else { + enabledTime_ = value; + } + } else { + enabledTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEnabledTime() { + bitField0_ = (bitField0_ & ~0x00000002); + enabledTime_ = null; + if (enabledTimeBuilder_ != null) { + enabledTimeBuilder_.dispose(); + enabledTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEnabledTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEnabledTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEnabledTimeOrBuilder() { + if (enabledTimeBuilder_ != null) { + return enabledTimeBuilder_.getMessageOrBuilder(); + } else { + return enabledTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : enabledTime_; + } + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEnabledTimeFieldBuilder() { + if (enabledTimeBuilder_ == null) { + enabledTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEnabledTime(), getParentForChildren(), isClean()); + enabledTime_ = null; + } + return enabledTimeBuilder_; + } + + private java.util.List schedule_ = java.util.Collections.emptyList(); + + private void ensureScheduleIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + schedule_ = new java.util.ArrayList(schedule_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the schedule. + */ + public java.util.List getScheduleList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.type.DayOfWeek>(schedule_, schedule_converter_); + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of schedule. + */ + public int getScheduleCount() { + return schedule_.size(); + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The schedule at the given index. + */ + public com.google.type.DayOfWeek getSchedule(int index) { + return schedule_converter_.convert(schedule_.get(index)); + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The schedule to set. + * @return This builder for chaining. + */ + public Builder setSchedule(int index, com.google.type.DayOfWeek value) { + if (value == null) { + throw new NullPointerException(); + } + ensureScheduleIsMutable(); + schedule_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The schedule to add. + * @return This builder for chaining. + */ + public Builder addSchedule(com.google.type.DayOfWeek value) { + if (value == null) { + throw new NullPointerException(); + } + ensureScheduleIsMutable(); + schedule_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The schedule to add. + * @return This builder for chaining. + */ + public Builder addAllSchedule(java.lang.Iterable values) { + ensureScheduleIsMutable(); + for (com.google.type.DayOfWeek value : values) { + schedule_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSchedule() { + schedule_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the enum numeric values on the wire for schedule. + */ + public java.util.List getScheduleValueList() { + return java.util.Collections.unmodifiableList(schedule_); + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of schedule at the given index. + */ + public int getScheduleValue(int index) { + return schedule_.get(index); + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for schedule to set. + * @return This builder for chaining. + */ + public Builder setScheduleValue(int index, int value) { + ensureScheduleIsMutable(); + schedule_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for schedule to add. + * @return This builder for chaining. + */ + public Builder addScheduleValue(int value) { + ensureScheduleIsMutable(); + schedule_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The enum numeric values on the wire for schedule to add. + * @return This builder for chaining. + */ + public Builder addAllScheduleValue(java.lang.Iterable values) { + ensureScheduleIsMutable(); + for (int value : values) { + schedule_.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.alloydb.v1alpha.ContinuousBackupInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.ContinuousBackupInfo) + private static final com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo(); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContinuousBackupInfo 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.alloydb.v1alpha.ContinuousBackupInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupInfoOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupInfoOrBuilder.java new file mode 100644 index 000000000000..5cb54ed39e5c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupInfoOrBuilder.java @@ -0,0 +1,188 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface ContinuousBackupInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.ContinuousBackupInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + boolean hasEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + com.google.cloud.alloydb.v1alpha.EncryptionInfo getEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(); + + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the enabledTime field is set. + */ + boolean hasEnabledTime(); + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enabledTime. + */ + com.google.protobuf.Timestamp getEnabledTime(); + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEnabledTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the schedule. + */ + java.util.List getScheduleList(); + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of schedule. + */ + int getScheduleCount(); + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The schedule at the given index. + */ + com.google.type.DayOfWeek getSchedule(int index); + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the enum numeric values on the wire for schedule. + */ + java.util.List getScheduleValueList(); + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of schedule at the given index. + */ + int getScheduleValue(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupSource.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupSource.java new file mode 100644 index 000000000000..5a66a1654f94 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupSource.java @@ -0,0 +1,917 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message describing a ContinuousBackupSource.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ContinuousBackupSource} + */ +public final class ContinuousBackupSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.ContinuousBackupSource) + ContinuousBackupSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContinuousBackupSource.newBuilder() to construct. + private ContinuousBackupSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ContinuousBackupSource() { + cluster_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ContinuousBackupSource(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.class, + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.Builder.class); + } + + public static final int CLUSTER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object cluster_ = ""; + /** + * + * + *
+   * Required. The source cluster from which to restore. This cluster must have
+   * continuous backup enabled for this operation to succeed. For the required
+   * format, see the comment on the Cluster.name field.
+   * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The cluster. + */ + @java.lang.Override + public java.lang.String getCluster() { + java.lang.Object ref = cluster_; + 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(); + cluster_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The source cluster from which to restore. This cluster must have
+   * continuous backup enabled for this operation to succeed. For the required
+   * format, see the comment on the Cluster.name field.
+   * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for cluster. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterBytes() { + java.lang.Object ref = cluster_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cluster_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POINT_IN_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp pointInTime_; + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pointInTime field is set. + */ + @java.lang.Override + public boolean hasPointInTime() { + return pointInTime_ != null; + } + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pointInTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPointInTime() { + return pointInTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : pointInTime_; + } + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder() { + return pointInTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : pointInTime_; + } + + 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(cluster_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cluster_); + } + if (pointInTime_ != null) { + output.writeMessage(2, getPointInTime()); + } + 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(cluster_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cluster_); + } + if (pointInTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPointInTime()); + } + 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.alloydb.v1alpha.ContinuousBackupSource)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource other = + (com.google.cloud.alloydb.v1alpha.ContinuousBackupSource) obj; + + if (!getCluster().equals(other.getCluster())) return false; + if (hasPointInTime() != other.hasPointInTime()) return false; + if (hasPointInTime()) { + if (!getPointInTime().equals(other.getPointInTime())) 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) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + if (hasPointInTime()) { + hash = (37 * hash) + POINT_IN_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPointInTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupSource 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.alloydb.v1alpha.ContinuousBackupSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupSource 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.alloydb.v1alpha.ContinuousBackupSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupSource 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.alloydb.v1alpha.ContinuousBackupSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupSource 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.alloydb.v1alpha.ContinuousBackupSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupSource 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.alloydb.v1alpha.ContinuousBackupSource 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; + } + /** + * + * + *
+   * Message describing a ContinuousBackupSource.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ContinuousBackupSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.ContinuousBackupSource) + com.google.cloud.alloydb.v1alpha.ContinuousBackupSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.class, + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cluster_ = ""; + pointInTime_ = null; + if (pointInTimeBuilder_ != null) { + pointInTimeBuilder_.dispose(); + pointInTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupSource getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupSource build() { + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupSource buildPartial() { + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource result = + new com.google.cloud.alloydb.v1alpha.ContinuousBackupSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.ContinuousBackupSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cluster_ = cluster_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pointInTime_ = + pointInTimeBuilder_ == null ? pointInTime_ : pointInTimeBuilder_.build(); + } + } + + @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.alloydb.v1alpha.ContinuousBackupSource) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.ContinuousBackupSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.ContinuousBackupSource other) { + if (other == com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.getDefaultInstance()) + return this; + if (!other.getCluster().isEmpty()) { + cluster_ = other.cluster_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasPointInTime()) { + mergePointInTime(other.getPointInTime()); + } + 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: + { + cluster_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getPointInTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + 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 cluster_ = ""; + /** + * + * + *
+     * Required. The source cluster from which to restore. This cluster must have
+     * continuous backup enabled for this operation to succeed. For the required
+     * format, see the comment on the Cluster.name field.
+     * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The cluster. + */ + public java.lang.String getCluster() { + java.lang.Object ref = cluster_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cluster_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The source cluster from which to restore. This cluster must have
+     * continuous backup enabled for this operation to succeed. For the required
+     * format, see the comment on the Cluster.name field.
+     * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for cluster. + */ + public com.google.protobuf.ByteString getClusterBytes() { + java.lang.Object ref = cluster_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cluster_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The source cluster from which to restore. This cluster must have
+     * continuous backup enabled for this operation to succeed. For the required
+     * format, see the comment on the Cluster.name field.
+     * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The cluster to set. + * @return This builder for chaining. + */ + public Builder setCluster(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The source cluster from which to restore. This cluster must have
+     * continuous backup enabled for this operation to succeed. For the required
+     * format, see the comment on the Cluster.name field.
+     * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCluster() { + cluster_ = getDefaultInstance().getCluster(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The source cluster from which to restore. This cluster must have
+     * continuous backup enabled for this operation to succeed. For the required
+     * format, see the comment on the Cluster.name field.
+     * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for cluster to set. + * @return This builder for chaining. + */ + public Builder setClusterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + cluster_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp pointInTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + pointInTimeBuilder_; + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pointInTime field is set. + */ + public boolean hasPointInTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pointInTime. + */ + public com.google.protobuf.Timestamp getPointInTime() { + if (pointInTimeBuilder_ == null) { + return pointInTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : pointInTime_; + } else { + return pointInTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPointInTime(com.google.protobuf.Timestamp value) { + if (pointInTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pointInTime_ = value; + } else { + pointInTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPointInTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (pointInTimeBuilder_ == null) { + pointInTime_ = builderForValue.build(); + } else { + pointInTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePointInTime(com.google.protobuf.Timestamp value) { + if (pointInTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && pointInTime_ != null + && pointInTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getPointInTimeBuilder().mergeFrom(value); + } else { + pointInTime_ = value; + } + } else { + pointInTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPointInTime() { + bitField0_ = (bitField0_ & ~0x00000002); + pointInTime_ = null; + if (pointInTimeBuilder_ != null) { + pointInTimeBuilder_.dispose(); + pointInTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getPointInTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getPointInTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder() { + if (pointInTimeBuilder_ != null) { + return pointInTimeBuilder_.getMessageOrBuilder(); + } else { + return pointInTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : pointInTime_; + } + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getPointInTimeFieldBuilder() { + if (pointInTimeBuilder_ == null) { + pointInTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPointInTime(), getParentForChildren(), isClean()); + pointInTime_ = null; + } + return pointInTimeBuilder_; + } + + @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.alloydb.v1alpha.ContinuousBackupSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.ContinuousBackupSource) + private static final com.google.cloud.alloydb.v1alpha.ContinuousBackupSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.ContinuousBackupSource(); + } + + public static com.google.cloud.alloydb.v1alpha.ContinuousBackupSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContinuousBackupSource 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.alloydb.v1alpha.ContinuousBackupSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupSourceOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupSourceOrBuilder.java new file mode 100644 index 000000000000..fcc940c59382 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupSourceOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface ContinuousBackupSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.ContinuousBackupSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The source cluster from which to restore. This cluster must have
+   * continuous backup enabled for this operation to succeed. For the required
+   * format, see the comment on the Cluster.name field.
+   * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The cluster. + */ + java.lang.String getCluster(); + /** + * + * + *
+   * Required. The source cluster from which to restore. This cluster must have
+   * continuous backup enabled for this operation to succeed. For the required
+   * format, see the comment on the Cluster.name field.
+   * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for cluster. + */ + com.google.protobuf.ByteString getClusterBytes(); + + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pointInTime field is set. + */ + boolean hasPointInTime(); + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pointInTime. + */ + com.google.protobuf.Timestamp getPointInTime(); + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateBackupRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateBackupRequest.java new file mode 100644 index 000000000000..f8572cc8b42c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateBackupRequest.java @@ -0,0 +1,1458 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for creating a Backup
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.CreateBackupRequest} + */ +public final class CreateBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.CreateBackupRequest) + CreateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateBackupRequest.newBuilder() to construct. + private CreateBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateBackupRequest() { + parent_ = ""; + backupId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateBackupRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.CreateBackupRequest.class, + com.google.cloud.alloydb.v1alpha.CreateBackupRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * 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. Value for parent.
+   * 
+ * + * + * 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 BACKUP_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + @java.lang.Override + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + 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(); + backupId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1alpha.Backup backup_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return backup_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Backup getBackup() { + return backup_ == null ? com.google.cloud.alloydb.v1alpha.Backup.getDefaultInstance() : backup_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BackupOrBuilder getBackupOrBuilder() { + return backup_ == null ? com.google.cloud.alloydb.v1alpha.Backup.getDefaultInstance() : backup_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, backupId_); + } + if (backup_ != null) { + output.writeMessage(3, getBackup()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, backupId_); + } + if (backup_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBackup()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + 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.alloydb.v1alpha.CreateBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.CreateBackupRequest other = + (com.google.cloud.alloydb.v1alpha.CreateBackupRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getBackupId().equals(other.getBackupId())) return false; + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + BACKUP_ID_FIELD_NUMBER; + hash = (53 * hash) + getBackupId().hashCode(); + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.CreateBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateBackupRequest 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.alloydb.v1alpha.CreateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateBackupRequest 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.alloydb.v1alpha.CreateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.CreateBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateBackupRequest 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.alloydb.v1alpha.CreateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateBackupRequest 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.alloydb.v1alpha.CreateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateBackupRequest 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.alloydb.v1alpha.CreateBackupRequest 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; + } + /** + * + * + *
+   * Message for creating a Backup
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.CreateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.CreateBackupRequest) + com.google.cloud.alloydb.v1alpha.CreateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.CreateBackupRequest.class, + com.google.cloud.alloydb.v1alpha.CreateBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.CreateBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + backupId_ = ""; + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateBackupRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.CreateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateBackupRequest build() { + com.google.cloud.alloydb.v1alpha.CreateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateBackupRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.CreateBackupRequest result = + new com.google.cloud.alloydb.v1alpha.CreateBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.CreateBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backupId_ = backupId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.backup_ = backupBuilder_ == null ? backup_ : backupBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1alpha.CreateBackupRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.CreateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.CreateBackupRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.CreateBackupRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getBackupId().isEmpty()) { + backupId_ = other.backupId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + backupId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getBackupFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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. Value for parent.
+     * 
+ * + * + * 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. Value for parent.
+     * 
+ * + * + * 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. Value for parent.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object backupId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearBackupId() { + backupId_ = getDefaultInstance().getBackupId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1alpha.Backup backup_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Backup, + com.google.cloud.alloydb.v1alpha.Backup.Builder, + com.google.cloud.alloydb.v1alpha.BackupOrBuilder> + backupBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.cloud.alloydb.v1alpha.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null + ? com.google.cloud.alloydb.v1alpha.Backup.getDefaultInstance() + : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.alloydb.v1alpha.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + } else { + backupBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.alloydb.v1alpha.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.cloud.alloydb.v1alpha.Backup value) { + if (backupBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && backup_ != null + && backup_ != com.google.cloud.alloydb.v1alpha.Backup.getDefaultInstance()) { + getBackupBuilder().mergeFrom(value); + } else { + backup_ = value; + } + } else { + backupBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + bitField0_ = (bitField0_ & ~0x00000004); + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.Backup.Builder getBackupBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getBackupFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null + ? com.google.cloud.alloydb.v1alpha.Backup.getDefaultInstance() + : backup_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Backup, + com.google.cloud.alloydb.v1alpha.Backup.Builder, + com.google.cloud.alloydb.v1alpha.BackupOrBuilder> + getBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Backup, + com.google.cloud.alloydb.v1alpha.Backup.Builder, + com.google.cloud.alloydb.v1alpha.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = 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.alloydb.v1alpha.CreateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.CreateBackupRequest) + private static final com.google.cloud.alloydb.v1alpha.CreateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.CreateBackupRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.CreateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBackupRequest 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.alloydb.v1alpha.CreateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateBackupRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateBackupRequestOrBuilder.java new file mode 100644 index 000000000000..a3ee291a36cd --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateBackupRequestOrBuilder.java @@ -0,0 +1,179 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface CreateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.CreateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + java.lang.String getBackupId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + com.google.protobuf.ByteString getBackupIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.cloud.alloydb.v1alpha.Backup getBackup(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1alpha.BackupOrBuilder getBackupOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateClusterRequest.java new file mode 100644 index 000000000000..75cceacf82c9 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateClusterRequest.java @@ -0,0 +1,1474 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for creating a Cluster
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.CreateClusterRequest} + */ +public final class CreateClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.CreateClusterRequest) + CreateClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateClusterRequest.newBuilder() to construct. + private CreateClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateClusterRequest() { + parent_ = ""; + clusterId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateClusterRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.CreateClusterRequest.class, + com.google.cloud.alloydb.v1alpha.CreateClusterRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 CLUSTER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + @java.lang.Override + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + 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(); + clusterId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1alpha.Cluster cluster_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + @java.lang.Override + public boolean hasCluster() { + return cluster_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster getCluster() { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clusterId_); + } + if (cluster_ != null) { + output.writeMessage(3, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clusterId_); + } + if (cluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + 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.alloydb.v1alpha.CreateClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.CreateClusterRequest other = + (com.google.cloud.alloydb.v1alpha.CreateClusterRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getClusterId().equals(other.getClusterId())) return false; + if (hasCluster() != other.hasCluster()) return false; + if (hasCluster()) { + if (!getCluster().equals(other.getCluster())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getClusterId().hashCode(); + if (hasCluster()) { + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.CreateClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateClusterRequest 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.alloydb.v1alpha.CreateClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateClusterRequest 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.alloydb.v1alpha.CreateClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.CreateClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateClusterRequest 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.alloydb.v1alpha.CreateClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateClusterRequest 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.alloydb.v1alpha.CreateClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateClusterRequest 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.alloydb.v1alpha.CreateClusterRequest 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; + } + /** + * + * + *
+   * Message for creating a Cluster
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.CreateClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.CreateClusterRequest) + com.google.cloud.alloydb.v1alpha.CreateClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.CreateClusterRequest.class, + com.google.cloud.alloydb.v1alpha.CreateClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.CreateClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + clusterId_ = ""; + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.CreateClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateClusterRequest build() { + com.google.cloud.alloydb.v1alpha.CreateClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateClusterRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.CreateClusterRequest result = + new com.google.cloud.alloydb.v1alpha.CreateClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.CreateClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterId_ = clusterId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1alpha.CreateClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.CreateClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.CreateClusterRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.CreateClusterRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getClusterId().isEmpty()) { + clusterId_ = other.clusterId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCluster()) { + mergeCluster(other.getCluster()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + clusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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 name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object clusterId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearClusterId() { + clusterId_ = getDefaultInstance().getClusterId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1alpha.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster, + com.google.cloud.alloydb.v1alpha.Cluster.Builder, + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.alloydb.v1alpha.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1alpha.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1alpha.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.alloydb.v1alpha.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCluster() { + bitField0_ = (bitField0_ & ~0x00000004); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster, + com.google.cloud.alloydb.v1alpha.Cluster.Builder, + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster, + com.google.cloud.alloydb.v1alpha.Cluster.Builder, + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = 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.alloydb.v1alpha.CreateClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.CreateClusterRequest) + private static final com.google.cloud.alloydb.v1alpha.CreateClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.CreateClusterRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.CreateClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateClusterRequest 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.alloydb.v1alpha.CreateClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateClusterRequestOrBuilder.java new file mode 100644 index 000000000000..cde66c88ad7b --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateClusterRequestOrBuilder.java @@ -0,0 +1,182 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface CreateClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.CreateClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.alloydb.v1alpha.Cluster getCluster(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateInstanceRequest.java new file mode 100644 index 000000000000..90a80383a8ae --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateInstanceRequest.java @@ -0,0 +1,1474 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for creating a Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.CreateInstanceRequest} + */ +public final class CreateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.CreateInstanceRequest) + CreateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateInstanceRequest.newBuilder() to construct. + private CreateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateInstanceRequest() { + parent_ = ""; + instanceId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateInstanceRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.class, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 INSTANCE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + @java.lang.Override + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + 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(); + instanceId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1alpha.Instance instance_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return instance_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance getInstance() { + return instance_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.InstanceOrBuilder getInstanceOrBuilder() { + return instance_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance() + : instance_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, instanceId_); + } + if (instance_ != null) { + output.writeMessage(3, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, instanceId_); + } + if (instance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + 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.alloydb.v1alpha.CreateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest other = + (com.google.cloud.alloydb.v1alpha.CreateInstanceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequest 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.alloydb.v1alpha.CreateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequest 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.alloydb.v1alpha.CreateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequest 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.alloydb.v1alpha.CreateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequest 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.alloydb.v1alpha.CreateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequest 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.alloydb.v1alpha.CreateInstanceRequest 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; + } + /** + * + * + *
+   * Message for creating a Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.CreateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.CreateInstanceRequest) + com.google.cloud.alloydb.v1alpha.CreateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.class, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + instanceId_ = ""; + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequest build() { + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest result = + new com.google.cloud.alloydb.v1alpha.CreateInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.CreateInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceId_ = instanceId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1alpha.CreateInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.CreateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.CreateInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instanceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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 name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instanceId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + instanceId_ = getDefaultInstance().getInstanceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1alpha.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance, + com.google.cloud.alloydb.v1alpha.Instance.Builder, + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.alloydb.v1alpha.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1alpha.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + } else { + instanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1alpha.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.alloydb.v1alpha.Instance value) { + if (instanceBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && instance_ != null + && instance_ != com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); + } else { + instance_ = value; + } + } else { + instanceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + bitField0_ = (bitField0_ & ~0x00000004); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.Instance.Builder getInstanceBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance, + com.google.cloud.alloydb.v1alpha.Instance.Builder, + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance, + com.google.cloud.alloydb.v1alpha.Instance.Builder, + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = 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.alloydb.v1alpha.CreateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.CreateInstanceRequest) + private static final com.google.cloud.alloydb.v1alpha.CreateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.CreateInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateInstanceRequest 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.alloydb.v1alpha.CreateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..99fb7993e718 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateInstanceRequestOrBuilder.java @@ -0,0 +1,182 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface CreateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.CreateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.alloydb.v1alpha.Instance getInstance(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateInstanceRequests.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateInstanceRequests.java new file mode 100644 index 000000000000..6634c8ed57ab --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateInstanceRequests.java @@ -0,0 +1,1035 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * See usage below for notes.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.CreateInstanceRequests} + */ +public final class CreateInstanceRequests extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.CreateInstanceRequests) + CreateInstanceRequestsOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateInstanceRequests.newBuilder() to construct. + private CreateInstanceRequests(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateInstanceRequests() { + createInstanceRequests_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateInstanceRequests(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequests_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequests_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.class, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.Builder.class); + } + + public static final int CREATE_INSTANCE_REQUESTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + createInstanceRequests_; + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getCreateInstanceRequestsList() { + return createInstanceRequests_; + } + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getCreateInstanceRequestsOrBuilderList() { + return createInstanceRequests_; + } + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getCreateInstanceRequestsCount() { + return createInstanceRequests_.size(); + } + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequest getCreateInstanceRequests( + int index) { + return createInstanceRequests_.get(index); + } + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequestOrBuilder + getCreateInstanceRequestsOrBuilder(int index) { + return createInstanceRequests_.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 < createInstanceRequests_.size(); i++) { + output.writeMessage(1, createInstanceRequests_.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 < createInstanceRequests_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, createInstanceRequests_.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.alloydb.v1alpha.CreateInstanceRequests)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests other = + (com.google.cloud.alloydb.v1alpha.CreateInstanceRequests) obj; + + if (!getCreateInstanceRequestsList().equals(other.getCreateInstanceRequestsList())) + 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 (getCreateInstanceRequestsCount() > 0) { + hash = (37 * hash) + CREATE_INSTANCE_REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getCreateInstanceRequestsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequests parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequests 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.alloydb.v1alpha.CreateInstanceRequests parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequests 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.alloydb.v1alpha.CreateInstanceRequests parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequests parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequests parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequests 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.alloydb.v1alpha.CreateInstanceRequests parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequests 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.alloydb.v1alpha.CreateInstanceRequests parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequests 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.alloydb.v1alpha.CreateInstanceRequests 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; + } + /** + * + * + *
+   * See usage below for notes.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.CreateInstanceRequests} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.CreateInstanceRequests) + com.google.cloud.alloydb.v1alpha.CreateInstanceRequestsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequests_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequests_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.class, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (createInstanceRequestsBuilder_ == null) { + createInstanceRequests_ = java.util.Collections.emptyList(); + } else { + createInstanceRequests_ = null; + createInstanceRequestsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequests_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequests getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequests build() { + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequests buildPartial() { + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests result = + new com.google.cloud.alloydb.v1alpha.CreateInstanceRequests(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.CreateInstanceRequests result) { + if (createInstanceRequestsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + createInstanceRequests_ = java.util.Collections.unmodifiableList(createInstanceRequests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.createInstanceRequests_ = createInstanceRequests_; + } else { + result.createInstanceRequests_ = createInstanceRequestsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.CreateInstanceRequests result) { + int from_bitField0_ = bitField0_; + } + + @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.alloydb.v1alpha.CreateInstanceRequests) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.CreateInstanceRequests) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.CreateInstanceRequests other) { + if (other == com.google.cloud.alloydb.v1alpha.CreateInstanceRequests.getDefaultInstance()) + return this; + if (createInstanceRequestsBuilder_ == null) { + if (!other.createInstanceRequests_.isEmpty()) { + if (createInstanceRequests_.isEmpty()) { + createInstanceRequests_ = other.createInstanceRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.addAll(other.createInstanceRequests_); + } + onChanged(); + } + } else { + if (!other.createInstanceRequests_.isEmpty()) { + if (createInstanceRequestsBuilder_.isEmpty()) { + createInstanceRequestsBuilder_.dispose(); + createInstanceRequestsBuilder_ = null; + createInstanceRequests_ = other.createInstanceRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + createInstanceRequestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCreateInstanceRequestsFieldBuilder() + : null; + } else { + createInstanceRequestsBuilder_.addAllMessages(other.createInstanceRequests_); + } + } + } + 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.alloydb.v1alpha.CreateInstanceRequest m = + input.readMessage( + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.parser(), + extensionRegistry); + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.add(m); + } else { + createInstanceRequestsBuilder_.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 + createInstanceRequests_ = java.util.Collections.emptyList(); + + private void ensureCreateInstanceRequestsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + createInstanceRequests_ = + new java.util.ArrayList( + createInstanceRequests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.Builder, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequestOrBuilder> + createInstanceRequestsBuilder_; + + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getCreateInstanceRequestsList() { + if (createInstanceRequestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(createInstanceRequests_); + } else { + return createInstanceRequestsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getCreateInstanceRequestsCount() { + if (createInstanceRequestsBuilder_ == null) { + return createInstanceRequests_.size(); + } else { + return createInstanceRequestsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequest getCreateInstanceRequests( + int index) { + if (createInstanceRequestsBuilder_ == null) { + return createInstanceRequests_.get(index); + } else { + return createInstanceRequestsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCreateInstanceRequests( + int index, com.google.cloud.alloydb.v1alpha.CreateInstanceRequest value) { + if (createInstanceRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.set(index, value); + onChanged(); + } else { + createInstanceRequestsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCreateInstanceRequests( + int index, com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.Builder builderForValue) { + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.set(index, builderForValue.build()); + onChanged(); + } else { + createInstanceRequestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCreateInstanceRequests( + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest value) { + if (createInstanceRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.add(value); + onChanged(); + } else { + createInstanceRequestsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCreateInstanceRequests( + int index, com.google.cloud.alloydb.v1alpha.CreateInstanceRequest value) { + if (createInstanceRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.add(index, value); + onChanged(); + } else { + createInstanceRequestsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCreateInstanceRequests( + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.Builder builderForValue) { + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.add(builderForValue.build()); + onChanged(); + } else { + createInstanceRequestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCreateInstanceRequests( + int index, com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.Builder builderForValue) { + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.add(index, builderForValue.build()); + onChanged(); + } else { + createInstanceRequestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllCreateInstanceRequests( + java.lang.Iterable + values) { + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, createInstanceRequests_); + onChanged(); + } else { + createInstanceRequestsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCreateInstanceRequests() { + if (createInstanceRequestsBuilder_ == null) { + createInstanceRequests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + createInstanceRequestsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeCreateInstanceRequests(int index) { + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.remove(index); + onChanged(); + } else { + createInstanceRequestsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.Builder + getCreateInstanceRequestsBuilder(int index) { + return getCreateInstanceRequestsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequestOrBuilder + getCreateInstanceRequestsOrBuilder(int index) { + if (createInstanceRequestsBuilder_ == null) { + return createInstanceRequests_.get(index); + } else { + return createInstanceRequestsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getCreateInstanceRequestsOrBuilderList() { + if (createInstanceRequestsBuilder_ != null) { + return createInstanceRequestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(createInstanceRequests_); + } + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.Builder + addCreateInstanceRequestsBuilder() { + return getCreateInstanceRequestsFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.Builder + addCreateInstanceRequestsBuilder(int index) { + return getCreateInstanceRequestsFieldBuilder() + .addBuilder( + index, com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getCreateInstanceRequestsBuilderList() { + return getCreateInstanceRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.Builder, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequestOrBuilder> + getCreateInstanceRequestsFieldBuilder() { + if (createInstanceRequestsBuilder_ == null) { + createInstanceRequestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest.Builder, + com.google.cloud.alloydb.v1alpha.CreateInstanceRequestOrBuilder>( + createInstanceRequests_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + createInstanceRequests_ = null; + } + return createInstanceRequestsBuilder_; + } + + @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.alloydb.v1alpha.CreateInstanceRequests) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.CreateInstanceRequests) + private static final com.google.cloud.alloydb.v1alpha.CreateInstanceRequests DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.CreateInstanceRequests(); + } + + public static com.google.cloud.alloydb.v1alpha.CreateInstanceRequests getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateInstanceRequests 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.alloydb.v1alpha.CreateInstanceRequests getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateInstanceRequestsOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateInstanceRequestsOrBuilder.java new file mode 100644 index 000000000000..1c29e104f145 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateInstanceRequestsOrBuilder.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/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface CreateInstanceRequestsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.CreateInstanceRequests) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getCreateInstanceRequestsList(); + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1alpha.CreateInstanceRequest getCreateInstanceRequests(int index); + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getCreateInstanceRequestsCount(); + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getCreateInstanceRequestsOrBuilderList(); + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1alpha.CreateInstanceRequestOrBuilder + getCreateInstanceRequestsOrBuilder(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryClusterRequest.java new file mode 100644 index 000000000000..ce2b52c720d0 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryClusterRequest.java @@ -0,0 +1,1464 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** Protobuf type {@code google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} */ +public final class CreateSecondaryClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest) + CreateSecondaryClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSecondaryClusterRequest.newBuilder() to construct. + private CreateSecondaryClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSecondaryClusterRequest() { + parent_ = ""; + clusterId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSecondaryClusterRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.class, + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource (the primary cluster). For the
+   * required format, see the comment on the Cluster.name field.
+   * 
+ * + * + * 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 parent resource (the primary cluster). For the
+   * required format, see the comment on the Cluster.name field.
+   * 
+ * + * + * 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 CLUSTER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object (the secondary cluster).
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + @java.lang.Override + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + 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(); + clusterId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object (the secondary cluster).
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1alpha.Cluster cluster_; + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + @java.lang.Override + public boolean hasCluster() { + return cluster_ != null; + } + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster getCluster() { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 6; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clusterId_); + } + if (cluster_ != null) { + output.writeMessage(3, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(6, validateOnly_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clusterId_); + } + if (cluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, validateOnly_); + } + 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.alloydb.v1alpha.CreateSecondaryClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest other = + (com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getClusterId().equals(other.getClusterId())) return false; + if (hasCluster() != other.hasCluster()) return false; + if (hasCluster()) { + if (!getCluster().equals(other.getCluster())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getClusterId().hashCode(); + if (hasCluster()) { + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest 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.alloydb.v1alpha.CreateSecondaryClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest 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.alloydb.v1alpha.CreateSecondaryClusterRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest 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.alloydb.v1alpha.CreateSecondaryClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest 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.alloydb.v1alpha.CreateSecondaryClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest 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.alloydb.v1alpha.CreateSecondaryClusterRequest 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.alloydb.v1alpha.CreateSecondaryClusterRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest) + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.class, + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + clusterId_ = ""; + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest build() { + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest result = + new com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterId_ = clusterId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1alpha.CreateSecondaryClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest other) { + if (other + == com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getClusterId().isEmpty()) { + clusterId_ = other.clusterId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCluster()) { + mergeCluster(other.getCluster()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + clusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 48: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 48 + 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 name of the parent resource (the primary cluster). For the
+     * required format, see the comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource (the primary cluster). For the
+     * required format, see the comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource (the primary cluster). For the
+     * required format, see the comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource (the primary cluster). For the
+     * required format, see the comment on the Cluster.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource (the primary cluster). For the
+     * required format, see the comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object clusterId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object (the secondary cluster).
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object (the secondary cluster).
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object (the secondary cluster).
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object (the secondary cluster).
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearClusterId() { + clusterId_ = getDefaultInstance().getClusterId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object (the secondary cluster).
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1alpha.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster, + com.google.cloud.alloydb.v1alpha.Cluster.Builder, + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.alloydb.v1alpha.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1alpha.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1alpha.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.alloydb.v1alpha.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCluster() { + bitField0_ = (bitField0_ & ~0x00000004); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster, + com.google.cloud.alloydb.v1alpha.Cluster.Builder, + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster, + com.google.cloud.alloydb.v1alpha.Cluster.Builder, + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = 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.alloydb.v1alpha.CreateSecondaryClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest) + private static final com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSecondaryClusterRequest 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.alloydb.v1alpha.CreateSecondaryClusterRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryClusterRequestOrBuilder.java new file mode 100644 index 000000000000..93c00db6422b --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryClusterRequestOrBuilder.java @@ -0,0 +1,182 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface CreateSecondaryClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource (the primary cluster). For the
+   * required format, see the comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource (the primary cluster). For the
+   * required format, see the comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object (the secondary cluster).
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + /** + * + * + *
+   * Required. ID of the requesting object (the secondary cluster).
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.alloydb.v1alpha.Cluster getCluster(); + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryInstanceRequest.java new file mode 100644 index 000000000000..529dcf170ddb --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryInstanceRequest.java @@ -0,0 +1,1482 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for creating a Secondary Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} + */ +public final class CreateSecondaryInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest) + CreateSecondaryInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSecondaryInstanceRequest.newBuilder() to construct. + private CreateSecondaryInstanceRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSecondaryInstanceRequest() { + parent_ = ""; + instanceId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSecondaryInstanceRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.class, + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 INSTANCE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + @java.lang.Override + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + 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(); + instanceId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1alpha.Instance instance_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return instance_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance getInstance() { + return instance_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.InstanceOrBuilder getInstanceOrBuilder() { + return instance_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance() + : instance_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, instanceId_); + } + if (instance_ != null) { + output.writeMessage(3, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, instanceId_); + } + if (instance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + 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.alloydb.v1alpha.CreateSecondaryInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest other = + (com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest 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.alloydb.v1alpha.CreateSecondaryInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest 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.alloydb.v1alpha.CreateSecondaryInstanceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest 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.alloydb.v1alpha.CreateSecondaryInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest 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.alloydb.v1alpha.CreateSecondaryInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest 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.alloydb.v1alpha.CreateSecondaryInstanceRequest 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; + } + /** + * + * + *
+   * Message for creating a Secondary Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest) + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.class, + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + instanceId_ = ""; + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest build() { + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest result = + new com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceId_ = instanceId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1alpha.CreateSecondaryInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest other) { + if (other + == com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instanceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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 name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instanceId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + instanceId_ = getDefaultInstance().getInstanceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1alpha.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance, + com.google.cloud.alloydb.v1alpha.Instance.Builder, + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.alloydb.v1alpha.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1alpha.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + } else { + instanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1alpha.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.alloydb.v1alpha.Instance value) { + if (instanceBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && instance_ != null + && instance_ != com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); + } else { + instance_ = value; + } + } else { + instanceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + bitField0_ = (bitField0_ & ~0x00000004); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.Instance.Builder getInstanceBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance, + com.google.cloud.alloydb.v1alpha.Instance.Builder, + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance, + com.google.cloud.alloydb.v1alpha.Instance.Builder, + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = 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.alloydb.v1alpha.CreateSecondaryInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest) + private static final com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSecondaryInstanceRequest 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.alloydb.v1alpha.CreateSecondaryInstanceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..e64b2bbc541f --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryInstanceRequestOrBuilder.java @@ -0,0 +1,182 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface CreateSecondaryInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.alloydb.v1alpha.Instance getInstance(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DatabaseVersion.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DatabaseVersion.java new file mode 100644 index 000000000000..472eed52e904 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DatabaseVersion.java @@ -0,0 +1,177 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * The supported database engine versions.
+ * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.DatabaseVersion} + */ +public enum DatabaseVersion implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown database version.
+   * 
+ * + * DATABASE_VERSION_UNSPECIFIED = 0; + */ + DATABASE_VERSION_UNSPECIFIED(0), + /** + * + * + *
+   * DEPRECATED - The database version is Postgres 13.
+   * 
+ * + * POSTGRES_13 = 1 [deprecated = true]; + */ + @java.lang.Deprecated + POSTGRES_13(1), + /** + * + * + *
+   * The database version is Postgres 14.
+   * 
+ * + * POSTGRES_14 = 2; + */ + POSTGRES_14(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * This is an unknown database version.
+   * 
+ * + * DATABASE_VERSION_UNSPECIFIED = 0; + */ + public static final int DATABASE_VERSION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * DEPRECATED - The database version is Postgres 13.
+   * 
+ * + * POSTGRES_13 = 1 [deprecated = true]; + */ + @java.lang.Deprecated public static final int POSTGRES_13_VALUE = 1; + /** + * + * + *
+   * The database version is Postgres 14.
+   * 
+ * + * POSTGRES_14 = 2; + */ + public static final int POSTGRES_14_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 DatabaseVersion 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 DatabaseVersion forNumber(int value) { + switch (value) { + case 0: + return DATABASE_VERSION_UNSPECIFIED; + case 1: + return POSTGRES_13; + case 2: + return POSTGRES_14; + 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 DatabaseVersion findValueByNumber(int number) { + return DatabaseVersion.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.alloydb.v1alpha.ResourcesProto.getDescriptor().getEnumTypes().get(0); + } + + private static final DatabaseVersion[] VALUES = values(); + + public static DatabaseVersion 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 DatabaseVersion(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.DatabaseVersion) +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteBackupRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteBackupRequest.java new file mode 100644 index 000000000000..3b6f2d74a8de --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteBackupRequest.java @@ -0,0 +1,1195 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for deleting a Backup
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.DeleteBackupRequest} + */ +public final class DeleteBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.DeleteBackupRequest) + DeleteBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteBackupRequest.newBuilder() to construct. + private DeleteBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteBackupRequest() { + name_ = ""; + requestId_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteBackupRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.DeleteBackupRequest.class, + com.google.cloud.alloydb.v1alpha.DeleteBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource. For the required format, see the comment on
+   * the Backup.name field.
+   * 
+ * + * + * 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. Name of the resource. For the required format, see the comment on
+   * the Backup.name field.
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ETAG_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. The current etag of the Backup.
+   * If an etag is provided and does not match the current etag of the Backup,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The current etag of the Backup.
+   * If an etag is provided and does not match the current etag of the Backup,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, etag_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, etag_); + } + 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.alloydb.v1alpha.DeleteBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.DeleteBackupRequest other = + (com.google.cloud.alloydb.v1alpha.DeleteBackupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getEtag().equals(other.getEtag())) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.DeleteBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteBackupRequest 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.alloydb.v1alpha.DeleteBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteBackupRequest 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.alloydb.v1alpha.DeleteBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteBackupRequest 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.alloydb.v1alpha.DeleteBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteBackupRequest 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.alloydb.v1alpha.DeleteBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteBackupRequest 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.alloydb.v1alpha.DeleteBackupRequest 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; + } + /** + * + * + *
+   * Message for deleting a Backup
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.DeleteBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.DeleteBackupRequest) + com.google.cloud.alloydb.v1alpha.DeleteBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.DeleteBackupRequest.class, + com.google.cloud.alloydb.v1alpha.DeleteBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.DeleteBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + validateOnly_ = false; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DeleteBackupRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.DeleteBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DeleteBackupRequest build() { + com.google.cloud.alloydb.v1alpha.DeleteBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DeleteBackupRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.DeleteBackupRequest result = + new com.google.cloud.alloydb.v1alpha.DeleteBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.DeleteBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.etag_ = etag_; + } + } + + @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.alloydb.v1alpha.DeleteBackupRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.DeleteBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.DeleteBackupRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.DeleteBackupRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000008; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the resource. For the required format, see the comment on
+     * the Backup.name field.
+     * 
+ * + * + * 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. Name of the resource. For the required format, see the comment on
+     * the Backup.name field.
+     * 
+ * + * + * 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. Name of the resource. For the required format, see the comment on
+     * the Backup.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource. For the required format, see the comment on
+     * the Backup.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource. For the required format, see the comment on
+     * the Backup.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The current etag of the Backup.
+     * If an etag is provided and does not match the current etag of the Backup,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Backup.
+     * If an etag is provided and does not match the current etag of the Backup,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Backup.
+     * If an etag is provided and does not match the current etag of the Backup,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Backup.
+     * If an etag is provided and does not match the current etag of the Backup,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Backup.
+     * If an etag is provided and does not match the current etag of the Backup,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000008; + 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.alloydb.v1alpha.DeleteBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.DeleteBackupRequest) + private static final com.google.cloud.alloydb.v1alpha.DeleteBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.DeleteBackupRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBackupRequest 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.alloydb.v1alpha.DeleteBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteBackupRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteBackupRequestOrBuilder.java new file mode 100644 index 000000000000..af44a344666a --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteBackupRequestOrBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface DeleteBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.DeleteBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource. For the required format, see the comment on
+   * the Backup.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource. For the required format, see the comment on
+   * the Backup.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. The current etag of the Backup.
+   * If an etag is provided and does not match the current etag of the Backup,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The current etag of the Backup.
+   * If an etag is provided and does not match the current etag of the Backup,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteClusterRequest.java new file mode 100644 index 000000000000..89f3a6977739 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteClusterRequest.java @@ -0,0 +1,1289 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for deleting a Cluster
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.DeleteClusterRequest} + */ +public final class DeleteClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.DeleteClusterRequest) + DeleteClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteClusterRequest.newBuilder() to construct. + private DeleteClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteClusterRequest() { + name_ = ""; + requestId_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteClusterRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.DeleteClusterRequest.class, + com.google.cloud.alloydb.v1alpha.DeleteClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int FORCE_FIELD_NUMBER = 5; + private boolean force_ = false; + /** + * + * + *
+   * Optional. Whether to cascade delete child instances for given cluster.
+   * 
+ * + * bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (force_ != false) { + output.writeBool(5, force_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, force_); + } + 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.alloydb.v1alpha.DeleteClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.DeleteClusterRequest other = + (com.google.cloud.alloydb.v1alpha.DeleteClusterRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getForce() != other.getForce()) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.DeleteClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteClusterRequest 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.alloydb.v1alpha.DeleteClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteClusterRequest 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.alloydb.v1alpha.DeleteClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteClusterRequest 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.alloydb.v1alpha.DeleteClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteClusterRequest 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.alloydb.v1alpha.DeleteClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteClusterRequest 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.alloydb.v1alpha.DeleteClusterRequest 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; + } + /** + * + * + *
+   * Message for deleting a Cluster
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.DeleteClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.DeleteClusterRequest) + com.google.cloud.alloydb.v1alpha.DeleteClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.DeleteClusterRequest.class, + com.google.cloud.alloydb.v1alpha.DeleteClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.DeleteClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + etag_ = ""; + validateOnly_ = false; + force_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DeleteClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.DeleteClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DeleteClusterRequest build() { + com.google.cloud.alloydb.v1alpha.DeleteClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DeleteClusterRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.DeleteClusterRequest result = + new com.google.cloud.alloydb.v1alpha.DeleteClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.DeleteClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.force_ = force_; + } + } + + @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.alloydb.v1alpha.DeleteClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.DeleteClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.DeleteClusterRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.DeleteClusterRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + force_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * Optional. Whether to cascade delete child instances for given cluster.
+     * 
+ * + * bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * Optional. Whether to cascade delete child instances for given cluster.
+     * 
+ * + * bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Whether to cascade delete child instances for given cluster.
+     * 
+ * + * bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + bitField0_ = (bitField0_ & ~0x00000010); + force_ = 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.alloydb.v1alpha.DeleteClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.DeleteClusterRequest) + private static final com.google.cloud.alloydb.v1alpha.DeleteClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.DeleteClusterRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteClusterRequest 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.alloydb.v1alpha.DeleteClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteClusterRequestOrBuilder.java new file mode 100644 index 000000000000..987776ea65bf --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteClusterRequestOrBuilder.java @@ -0,0 +1,157 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface DeleteClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.DeleteClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. Whether to cascade delete child instances for given cluster.
+   * 
+ * + * bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteInstanceRequest.java new file mode 100644 index 000000000000..27080a43ec32 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteInstanceRequest.java @@ -0,0 +1,1196 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for deleting a Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.DeleteInstanceRequest} + */ +public final class DeleteInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.DeleteInstanceRequest) + DeleteInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteInstanceRequest.newBuilder() to construct. + private DeleteInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteInstanceRequest() { + name_ = ""; + requestId_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteInstanceRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest.class, + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. The current etag of the Instance.
+   * If an etag is provided and does not match the current etag of the Instance,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The current etag of the Instance.
+   * If an etag is provided and does not match the current etag of the Instance,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + 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.alloydb.v1alpha.DeleteInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest other = + (com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest 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.alloydb.v1alpha.DeleteInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest 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.alloydb.v1alpha.DeleteInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest 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.alloydb.v1alpha.DeleteInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest 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.alloydb.v1alpha.DeleteInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest 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.alloydb.v1alpha.DeleteInstanceRequest 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; + } + /** + * + * + *
+   * Message for deleting a Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.DeleteInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.DeleteInstanceRequest) + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest.class, + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + etag_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest build() { + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest result = + new com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1alpha.DeleteInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The current etag of the Instance.
+     * If an etag is provided and does not match the current etag of the Instance,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Instance.
+     * If an etag is provided and does not match the current etag of the Instance,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Instance.
+     * If an etag is provided and does not match the current etag of the Instance,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Instance.
+     * If an etag is provided and does not match the current etag of the Instance,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Instance.
+     * If an etag is provided and does not match the current etag of the Instance,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = 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.alloydb.v1alpha.DeleteInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.DeleteInstanceRequest) + private static final com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteInstanceRequest 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.alloydb.v1alpha.DeleteInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..00ad814f57af --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteInstanceRequestOrBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface DeleteInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.DeleteInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. The current etag of the Instance.
+   * If an etag is provided and does not match the current etag of the Instance,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The current etag of the Instance.
+   * If an etag is provided and does not match the current etag of the Instance,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/EncryptionConfig.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/EncryptionConfig.java new file mode 100644 index 000000000000..d16b4b095b3c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/EncryptionConfig.java @@ -0,0 +1,645 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * EncryptionConfig describes the encryption config of a cluster or a backup
+ * that is encrypted with a CMEK (customer-managed encryption key).
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.EncryptionConfig} + */ +public final class EncryptionConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.EncryptionConfig) + EncryptionConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use EncryptionConfig.newBuilder() to construct. + private EncryptionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EncryptionConfig() { + kmsKeyName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EncryptionConfig(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_EncryptionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_EncryptionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.EncryptionConfig.class, + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder.class); + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+   * The fully-qualified resource name of the KMS key.
+   * Each Cloud KMS key is regionalized and has the following format:
+   * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+   * 
+ * + * string kms_key_name = 1; + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + 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(); + kmsKeyName_ = s; + return s; + } + } + /** + * + * + *
+   * The fully-qualified resource name of the KMS key.
+   * Each Cloud KMS key is regionalized and has the following format:
+   * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+   * 
+ * + * string kms_key_name = 1; + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = 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(kmsKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kmsKeyName_); + } + 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(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kmsKeyName_); + } + 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.alloydb.v1alpha.EncryptionConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.EncryptionConfig other = + (com.google.cloud.alloydb.v1alpha.EncryptionConfig) obj; + + if (!getKmsKeyName().equals(other.getKmsKeyName())) 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) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionConfig 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.alloydb.v1alpha.EncryptionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionConfig 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.alloydb.v1alpha.EncryptionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionConfig 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.alloydb.v1alpha.EncryptionConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionConfig 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.alloydb.v1alpha.EncryptionConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionConfig 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.alloydb.v1alpha.EncryptionConfig 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; + } + /** + * + * + *
+   * EncryptionConfig describes the encryption config of a cluster or a backup
+   * that is encrypted with a CMEK (customer-managed encryption key).
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.EncryptionConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.EncryptionConfig) + com.google.cloud.alloydb.v1alpha.EncryptionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_EncryptionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_EncryptionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.EncryptionConfig.class, + com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.EncryptionConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kmsKeyName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_EncryptionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionConfig build() { + com.google.cloud.alloydb.v1alpha.EncryptionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionConfig buildPartial() { + com.google.cloud.alloydb.v1alpha.EncryptionConfig result = + new com.google.cloud.alloydb.v1alpha.EncryptionConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.EncryptionConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kmsKeyName_ = kmsKeyName_; + } + } + + @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.alloydb.v1alpha.EncryptionConfig) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.EncryptionConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.EncryptionConfig other) { + if (other == com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance()) + return this; + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + bitField0_ |= 0x00000001; + 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: + { + kmsKeyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + 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.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+     * The fully-qualified resource name of the KMS key.
+     * Each Cloud KMS key is regionalized and has the following format:
+     * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+     * 
+ * + * string kms_key_name = 1; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The fully-qualified resource name of the KMS key.
+     * Each Cloud KMS key is regionalized and has the following format:
+     * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+     * 
+ * + * string kms_key_name = 1; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The fully-qualified resource name of the KMS key.
+     * Each Cloud KMS key is regionalized and has the following format:
+     * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+     * 
+ * + * string kms_key_name = 1; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The fully-qualified resource name of the KMS key.
+     * Each Cloud KMS key is regionalized and has the following format:
+     * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+     * 
+ * + * string kms_key_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The fully-qualified resource name of the KMS key.
+     * Each Cloud KMS key is regionalized and has the following format:
+     * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+     * 
+ * + * string kms_key_name = 1; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyName_ = value; + 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.alloydb.v1alpha.EncryptionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.EncryptionConfig) + private static final com.google.cloud.alloydb.v1alpha.EncryptionConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.EncryptionConfig(); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EncryptionConfig 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.alloydb.v1alpha.EncryptionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/EncryptionConfigOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/EncryptionConfigOrBuilder.java new file mode 100644 index 000000000000..d507a5a0c9b4 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/EncryptionConfigOrBuilder.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/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface EncryptionConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.EncryptionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The fully-qualified resource name of the KMS key.
+   * Each Cloud KMS key is regionalized and has the following format:
+   * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+   * 
+ * + * string kms_key_name = 1; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + /** + * + * + *
+   * The fully-qualified resource name of the KMS key.
+   * Each Cloud KMS key is regionalized and has the following format:
+   * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+   * 
+ * + * string kms_key_name = 1; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/EncryptionInfo.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/EncryptionInfo.java new file mode 100644 index 000000000000..77a4b3f6cbc6 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/EncryptionInfo.java @@ -0,0 +1,1092 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * EncryptionInfo describes the encryption information of a cluster or a backup.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.EncryptionInfo} + */ +public final class EncryptionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.EncryptionInfo) + EncryptionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use EncryptionInfo.newBuilder() to construct. + private EncryptionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EncryptionInfo() { + encryptionType_ = 0; + kmsKeyVersions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EncryptionInfo(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_EncryptionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_EncryptionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.EncryptionInfo.class, + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder.class); + } + + /** + * + * + *
+   * Possible encryption types.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.EncryptionInfo.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The data is encrypted at rest with a key that is fully managed by Google.
+     * No key version will be populated. This is the default state.
+     * 
+ * + * GOOGLE_DEFAULT_ENCRYPTION = 1; + */ + GOOGLE_DEFAULT_ENCRYPTION(1), + /** + * + * + *
+     * The data is encrypted at rest with a key that is managed by the customer.
+     * KMS key versions will be populated.
+     * 
+ * + * CUSTOMER_MANAGED_ENCRYPTION = 2; + */ + CUSTOMER_MANAGED_ENCRYPTION(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The data is encrypted at rest with a key that is fully managed by Google.
+     * No key version will be populated. This is the default state.
+     * 
+ * + * GOOGLE_DEFAULT_ENCRYPTION = 1; + */ + public static final int GOOGLE_DEFAULT_ENCRYPTION_VALUE = 1; + /** + * + * + *
+     * The data is encrypted at rest with a key that is managed by the customer.
+     * KMS key versions will be populated.
+     * 
+ * + * CUSTOMER_MANAGED_ENCRYPTION = 2; + */ + public static final int CUSTOMER_MANAGED_ENCRYPTION_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 Type 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 Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return GOOGLE_DEFAULT_ENCRYPTION; + case 2: + return CUSTOMER_MANAGED_ENCRYPTION; + 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 Type findValueByNumber(int number) { + return Type.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.alloydb.v1alpha.EncryptionInfo.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.EncryptionInfo.Type) + } + + public static final int ENCRYPTION_TYPE_FIELD_NUMBER = 1; + private int encryptionType_ = 0; + /** + * + * + *
+   * Output only. Type of encryption.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for encryptionType. + */ + @java.lang.Override + public int getEncryptionTypeValue() { + return encryptionType_; + } + /** + * + * + *
+   * Output only. Type of encryption.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionInfo.Type getEncryptionType() { + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Type result = + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Type.forNumber(encryptionType_); + return result == null + ? com.google.cloud.alloydb.v1alpha.EncryptionInfo.Type.UNRECOGNIZED + : result; + } + + public static final int KMS_KEY_VERSIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList kmsKeyVersions_; + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the kmsKeyVersions. + */ + public com.google.protobuf.ProtocolStringList getKmsKeyVersionsList() { + return kmsKeyVersions_; + } + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of kmsKeyVersions. + */ + public int getKmsKeyVersionsCount() { + return kmsKeyVersions_.size(); + } + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The kmsKeyVersions at the given index. + */ + public java.lang.String getKmsKeyVersions(int index) { + return kmsKeyVersions_.get(index); + } + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the kmsKeyVersions at the given index. + */ + public com.google.protobuf.ByteString getKmsKeyVersionsBytes(int index) { + return kmsKeyVersions_.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 (encryptionType_ + != com.google.cloud.alloydb.v1alpha.EncryptionInfo.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, encryptionType_); + } + for (int i = 0; i < kmsKeyVersions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kmsKeyVersions_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encryptionType_ + != com.google.cloud.alloydb.v1alpha.EncryptionInfo.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, encryptionType_); + } + { + int dataSize = 0; + for (int i = 0; i < kmsKeyVersions_.size(); i++) { + dataSize += computeStringSizeNoTag(kmsKeyVersions_.getRaw(i)); + } + size += dataSize; + size += 1 * getKmsKeyVersionsList().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.alloydb.v1alpha.EncryptionInfo)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.EncryptionInfo other = + (com.google.cloud.alloydb.v1alpha.EncryptionInfo) obj; + + if (encryptionType_ != other.encryptionType_) return false; + if (!getKmsKeyVersionsList().equals(other.getKmsKeyVersionsList())) 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) + ENCRYPTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + encryptionType_; + if (getKmsKeyVersionsCount() > 0) { + hash = (37 * hash) + KMS_KEY_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyVersionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionInfo 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.alloydb.v1alpha.EncryptionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionInfo 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.alloydb.v1alpha.EncryptionInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionInfo 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.alloydb.v1alpha.EncryptionInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionInfo 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.alloydb.v1alpha.EncryptionInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionInfo 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.alloydb.v1alpha.EncryptionInfo 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; + } + /** + * + * + *
+   * EncryptionInfo describes the encryption information of a cluster or a backup.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.EncryptionInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.EncryptionInfo) + com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_EncryptionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_EncryptionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.EncryptionInfo.class, + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.EncryptionInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encryptionType_ = 0; + kmsKeyVersions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_EncryptionInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionInfo getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionInfo build() { + com.google.cloud.alloydb.v1alpha.EncryptionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionInfo buildPartial() { + com.google.cloud.alloydb.v1alpha.EncryptionInfo result = + new com.google.cloud.alloydb.v1alpha.EncryptionInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.EncryptionInfo result) { + if (((bitField0_ & 0x00000002) != 0)) { + kmsKeyVersions_ = kmsKeyVersions_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.kmsKeyVersions_ = kmsKeyVersions_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.EncryptionInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encryptionType_ = encryptionType_; + } + } + + @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.alloydb.v1alpha.EncryptionInfo) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.EncryptionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.EncryptionInfo other) { + if (other == com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance()) + return this; + if (other.encryptionType_ != 0) { + setEncryptionTypeValue(other.getEncryptionTypeValue()); + } + if (!other.kmsKeyVersions_.isEmpty()) { + if (kmsKeyVersions_.isEmpty()) { + kmsKeyVersions_ = other.kmsKeyVersions_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureKmsKeyVersionsIsMutable(); + kmsKeyVersions_.addAll(other.kmsKeyVersions_); + } + 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: + { + encryptionType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureKmsKeyVersionsIsMutable(); + kmsKeyVersions_.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 int encryptionType_ = 0; + /** + * + * + *
+     * Output only. Type of encryption.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for encryptionType. + */ + @java.lang.Override + public int getEncryptionTypeValue() { + return encryptionType_; + } + /** + * + * + *
+     * Output only. Type of encryption.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for encryptionType to set. + * @return This builder for chaining. + */ + public Builder setEncryptionTypeValue(int value) { + encryptionType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of encryption.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.EncryptionInfo.Type getEncryptionType() { + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Type result = + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Type.forNumber(encryptionType_); + return result == null + ? com.google.cloud.alloydb.v1alpha.EncryptionInfo.Type.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Type of encryption.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The encryptionType to set. + * @return This builder for chaining. + */ + public Builder setEncryptionType(com.google.cloud.alloydb.v1alpha.EncryptionInfo.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + encryptionType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of encryption.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearEncryptionType() { + bitField0_ = (bitField0_ & ~0x00000001); + encryptionType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList kmsKeyVersions_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureKmsKeyVersionsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + kmsKeyVersions_ = new com.google.protobuf.LazyStringArrayList(kmsKeyVersions_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the kmsKeyVersions. + */ + public com.google.protobuf.ProtocolStringList getKmsKeyVersionsList() { + return kmsKeyVersions_.getUnmodifiableView(); + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of kmsKeyVersions. + */ + public int getKmsKeyVersionsCount() { + return kmsKeyVersions_.size(); + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The kmsKeyVersions at the given index. + */ + public java.lang.String getKmsKeyVersions(int index) { + return kmsKeyVersions_.get(index); + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the kmsKeyVersions at the given index. + */ + public com.google.protobuf.ByteString getKmsKeyVersionsBytes(int index) { + return kmsKeyVersions_.getByteString(index); + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The kmsKeyVersions to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKmsKeyVersionsIsMutable(); + kmsKeyVersions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The kmsKeyVersions to add. + * @return This builder for chaining. + */ + public Builder addKmsKeyVersions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKmsKeyVersionsIsMutable(); + kmsKeyVersions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param values The kmsKeyVersions to add. + * @return This builder for chaining. + */ + public Builder addAllKmsKeyVersions(java.lang.Iterable values) { + ensureKmsKeyVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, kmsKeyVersions_); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyVersions() { + kmsKeyVersions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the kmsKeyVersions to add. + * @return This builder for chaining. + */ + public Builder addKmsKeyVersionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureKmsKeyVersionsIsMutable(); + kmsKeyVersions_.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.alloydb.v1alpha.EncryptionInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.EncryptionInfo) + private static final com.google.cloud.alloydb.v1alpha.EncryptionInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.EncryptionInfo(); + } + + public static com.google.cloud.alloydb.v1alpha.EncryptionInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EncryptionInfo 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.alloydb.v1alpha.EncryptionInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/EncryptionInfoOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/EncryptionInfoOrBuilder.java new file mode 100644 index 000000000000..ac42a0a7c6a7 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/EncryptionInfoOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface EncryptionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.EncryptionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Type of encryption.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for encryptionType. + */ + int getEncryptionTypeValue(); + /** + * + * + *
+   * Output only. Type of encryption.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionType. + */ + com.google.cloud.alloydb.v1alpha.EncryptionInfo.Type getEncryptionType(); + + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the kmsKeyVersions. + */ + java.util.List getKmsKeyVersionsList(); + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of kmsKeyVersions. + */ + int getKmsKeyVersionsCount(); + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The kmsKeyVersions at the given index. + */ + java.lang.String getKmsKeyVersions(int index); + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the kmsKeyVersions at the given index. + */ + com.google.protobuf.ByteString getKmsKeyVersionsBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/FailoverInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/FailoverInstanceRequest.java new file mode 100644 index 000000000000..a48c671c9b22 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/FailoverInstanceRequest.java @@ -0,0 +1,1000 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for triggering failover on an Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.FailoverInstanceRequest} + */ +public final class FailoverInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.FailoverInstanceRequest) + FailoverInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use FailoverInstanceRequest.newBuilder() to construct. + private FailoverInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FailoverInstanceRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FailoverInstanceRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_FailoverInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_FailoverInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest.class, + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the failover.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + 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.alloydb.v1alpha.FailoverInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest other = + (com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest 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.alloydb.v1alpha.FailoverInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest 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.alloydb.v1alpha.FailoverInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest 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.alloydb.v1alpha.FailoverInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest 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.alloydb.v1alpha.FailoverInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest 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.alloydb.v1alpha.FailoverInstanceRequest 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; + } + /** + * + * + *
+   * Message for triggering failover on an Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.FailoverInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.FailoverInstanceRequest) + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_FailoverInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_FailoverInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest.class, + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_FailoverInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest build() { + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest result = + new com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1alpha.FailoverInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + 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 java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the failover.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the failover.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the failover.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = 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.alloydb.v1alpha.FailoverInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.FailoverInstanceRequest) + private static final com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailoverInstanceRequest 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.alloydb.v1alpha.FailoverInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/FailoverInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/FailoverInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..898f3e094c65 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/FailoverInstanceRequestOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface FailoverInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.FailoverInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the failover.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateRequest.java new file mode 100644 index 000000000000..f05812bfcd7f --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateRequest.java @@ -0,0 +1,1422 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for requests to generate a client certificate signed by the Cluster
+ * CA.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} + */ +public final class GenerateClientCertificateRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest) + GenerateClientCertificateRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateClientCertificateRequest.newBuilder() to construct. + private GenerateClientCertificateRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateClientCertificateRequest() { + parent_ = ""; + requestId_ = ""; + pemCsr_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateClientCertificateRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.class, + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   *  * projects/{project}/locations/{location}/clusters/{cluster}
+   * 
+ * + * + * 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 parent resource. The required format is:
+   *  * projects/{project}/locations/{location}/clusters/{cluster}
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PEM_CSR_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pemCsr_ = ""; + /** + * + * + *
+   * Optional. A pem-encoded X.509 certificate signing request (CSR).
+   * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pemCsr. + */ + @java.lang.Override + public java.lang.String getPemCsr() { + java.lang.Object ref = pemCsr_; + 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(); + pemCsr_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A pem-encoded X.509 certificate signing request (CSR).
+   * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pemCsr. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPemCsrBytes() { + java.lang.Object ref = pemCsr_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pemCsr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CERT_DURATION_FIELD_NUMBER = 4; + private com.google.protobuf.Duration certDuration_; + /** + * + * + *
+   * Optional. An optional hint to the endpoint to generate the client
+   * certificate with the requested duration. The duration can be from 1 hour to
+   * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+   * unspecified or is not honored, then the endpoint will pick an appropriate
+   * default duration.
+   * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the certDuration field is set. + */ + @java.lang.Override + public boolean hasCertDuration() { + return certDuration_ != null; + } + /** + * + * + *
+   * Optional. An optional hint to the endpoint to generate the client
+   * certificate with the requested duration. The duration can be from 1 hour to
+   * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+   * unspecified or is not honored, then the endpoint will pick an appropriate
+   * default duration.
+   * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The certDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getCertDuration() { + return certDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : certDuration_; + } + /** + * + * + *
+   * Optional. An optional hint to the endpoint to generate the client
+   * certificate with the requested duration. The duration can be from 1 hour to
+   * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+   * unspecified or is not honored, then the endpoint will pick an appropriate
+   * default duration.
+   * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getCertDurationOrBuilder() { + return certDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : certDuration_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pemCsr_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pemCsr_); + } + if (certDuration_ != null) { + output.writeMessage(4, getCertDuration()); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pemCsr_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pemCsr_); + } + if (certDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCertDuration()); + } + 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.alloydb.v1alpha.GenerateClientCertificateRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest other = + (com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getPemCsr().equals(other.getPemCsr())) return false; + if (hasCertDuration() != other.hasCertDuration()) return false; + if (hasCertDuration()) { + if (!getCertDuration().equals(other.getCertDuration())) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + PEM_CSR_FIELD_NUMBER; + hash = (53 * hash) + getPemCsr().hashCode(); + if (hasCertDuration()) { + hash = (37 * hash) + CERT_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getCertDuration().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest 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.alloydb.v1alpha.GenerateClientCertificateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest 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.alloydb.v1alpha.GenerateClientCertificateRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest 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.alloydb.v1alpha.GenerateClientCertificateRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + 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.alloydb.v1alpha.GenerateClientCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest 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.alloydb.v1alpha.GenerateClientCertificateRequest 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; + } + /** + * + * + *
+   * Message for requests to generate a client certificate signed by the Cluster
+   * CA.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest) + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.class, + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.Builder.class); + } + + // Construct using + // com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + requestId_ = ""; + pemCsr_ = ""; + certDuration_ = null; + if (certDurationBuilder_ != null) { + certDurationBuilder_.dispose(); + certDurationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest build() { + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest result = + new com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pemCsr_ = pemCsr_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.certDuration_ = + certDurationBuilder_ == null ? certDuration_ : certDurationBuilder_.build(); + } + } + + @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.alloydb.v1alpha.GenerateClientCertificateRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest other) { + if (other + == com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPemCsr().isEmpty()) { + pemCsr_ = other.pemCsr_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCertDuration()) { + mergeCertDuration(other.getCertDuration()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + pemCsr_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getCertDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     *  * projects/{project}/locations/{location}/clusters/{cluster}
+     * 
+ * + * + * 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 parent resource. The required format is:
+     *  * projects/{project}/locations/{location}/clusters/{cluster}
+     * 
+ * + * + * 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 parent resource. The required format is:
+     *  * projects/{project}/locations/{location}/clusters/{cluster}
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     *  * projects/{project}/locations/{location}/clusters/{cluster}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     *  * projects/{project}/locations/{location}/clusters/{cluster}
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object pemCsr_ = ""; + /** + * + * + *
+     * Optional. A pem-encoded X.509 certificate signing request (CSR).
+     * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pemCsr. + */ + public java.lang.String getPemCsr() { + java.lang.Object ref = pemCsr_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pemCsr_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A pem-encoded X.509 certificate signing request (CSR).
+     * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pemCsr. + */ + public com.google.protobuf.ByteString getPemCsrBytes() { + java.lang.Object ref = pemCsr_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pemCsr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A pem-encoded X.509 certificate signing request (CSR).
+     * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pemCsr to set. + * @return This builder for chaining. + */ + public Builder setPemCsr(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pemCsr_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pem-encoded X.509 certificate signing request (CSR).
+     * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPemCsr() { + pemCsr_ = getDefaultInstance().getPemCsr(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pem-encoded X.509 certificate signing request (CSR).
+     * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pemCsr to set. + * @return This builder for chaining. + */ + public Builder setPemCsrBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pemCsr_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Duration certDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + certDurationBuilder_; + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the certDuration field is set. + */ + public boolean hasCertDuration() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The certDuration. + */ + public com.google.protobuf.Duration getCertDuration() { + if (certDurationBuilder_ == null) { + return certDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : certDuration_; + } else { + return certDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCertDuration(com.google.protobuf.Duration value) { + if (certDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + certDuration_ = value; + } else { + certDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCertDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (certDurationBuilder_ == null) { + certDuration_ = builderForValue.build(); + } else { + certDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeCertDuration(com.google.protobuf.Duration value) { + if (certDurationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && certDuration_ != null + && certDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getCertDurationBuilder().mergeFrom(value); + } else { + certDuration_ = value; + } + } else { + certDurationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearCertDuration() { + bitField0_ = (bitField0_ & ~0x00000008); + certDuration_ = null; + if (certDurationBuilder_ != null) { + certDurationBuilder_.dispose(); + certDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Duration.Builder getCertDurationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCertDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.DurationOrBuilder getCertDurationOrBuilder() { + if (certDurationBuilder_ != null) { + return certDurationBuilder_.getMessageOrBuilder(); + } else { + return certDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : certDuration_; + } + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getCertDurationFieldBuilder() { + if (certDurationBuilder_ == null) { + certDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getCertDuration(), getParentForChildren(), isClean()); + certDuration_ = null; + } + return certDurationBuilder_; + } + + @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.alloydb.v1alpha.GenerateClientCertificateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest) + private static final com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateClientCertificateRequest 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.alloydb.v1alpha.GenerateClientCertificateRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateRequestOrBuilder.java new file mode 100644 index 000000000000..82e8e54f26dc --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateRequestOrBuilder.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/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface GenerateClientCertificateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   *  * projects/{project}/locations/{location}/clusters/{cluster}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   *  * projects/{project}/locations/{location}/clusters/{cluster}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. A pem-encoded X.509 certificate signing request (CSR).
+   * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pemCsr. + */ + java.lang.String getPemCsr(); + /** + * + * + *
+   * Optional. A pem-encoded X.509 certificate signing request (CSR).
+   * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pemCsr. + */ + com.google.protobuf.ByteString getPemCsrBytes(); + + /** + * + * + *
+   * Optional. An optional hint to the endpoint to generate the client
+   * certificate with the requested duration. The duration can be from 1 hour to
+   * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+   * unspecified or is not honored, then the endpoint will pick an appropriate
+   * default duration.
+   * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the certDuration field is set. + */ + boolean hasCertDuration(); + /** + * + * + *
+   * Optional. An optional hint to the endpoint to generate the client
+   * certificate with the requested duration. The duration can be from 1 hour to
+   * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+   * unspecified or is not honored, then the endpoint will pick an appropriate
+   * default duration.
+   * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The certDuration. + */ + com.google.protobuf.Duration getCertDuration(); + /** + * + * + *
+   * Optional. An optional hint to the endpoint to generate the client
+   * certificate with the requested duration. The duration can be from 1 hour to
+   * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+   * unspecified or is not honored, then the endpoint will pick an appropriate
+   * default duration.
+   * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.DurationOrBuilder getCertDurationOrBuilder(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateResponse.java new file mode 100644 index 000000000000..c9b5b1f18c63 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateResponse.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/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message returned by a GenerateClientCertificate operation.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} + */ +public final class GenerateClientCertificateResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse) + GenerateClientCertificateResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateClientCertificateResponse.newBuilder() to construct. + private GenerateClientCertificateResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateClientCertificateResponse() { + pemCertificate_ = ""; + pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateClientCertificateResponse(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.class, + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.Builder.class); + } + + public static final int PEM_CERTIFICATE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object pemCertificate_ = ""; + /** + * + * + *
+   * Output only. The pem-encoded, signed X.509 certificate.
+   * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pemCertificate. + */ + @java.lang.Override + public java.lang.String getPemCertificate() { + java.lang.Object ref = pemCertificate_; + 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(); + pemCertificate_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The pem-encoded, signed X.509 certificate.
+   * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for pemCertificate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPemCertificateBytes() { + java.lang.Object ref = pemCertificate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pemCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PEM_CERTIFICATE_CHAIN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList pemCertificateChain_; + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the pemCertificateChain. + */ + public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { + return pemCertificateChain_; + } + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of pemCertificateChain. + */ + public int getPemCertificateChainCount() { + return pemCertificateChain_.size(); + } + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The pemCertificateChain at the given index. + */ + public java.lang.String getPemCertificateChain(int index) { + return pemCertificateChain_.get(index); + } + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the pemCertificateChain at the given index. + */ + public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { + return pemCertificateChain_.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(pemCertificate_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pemCertificate_); + } + for (int i = 0; i < pemCertificateChain_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pemCertificateChain_.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(pemCertificate_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pemCertificate_); + } + { + int dataSize = 0; + for (int i = 0; i < pemCertificateChain_.size(); i++) { + dataSize += computeStringSizeNoTag(pemCertificateChain_.getRaw(i)); + } + size += dataSize; + size += 1 * getPemCertificateChainList().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.alloydb.v1alpha.GenerateClientCertificateResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse other = + (com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse) obj; + + if (!getPemCertificate().equals(other.getPemCertificate())) return false; + if (!getPemCertificateChainList().equals(other.getPemCertificateChainList())) 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) + PEM_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getPemCertificate().hashCode(); + if (getPemCertificateChainCount() > 0) { + hash = (37 * hash) + PEM_CERTIFICATE_CHAIN_FIELD_NUMBER; + hash = (53 * hash) + getPemCertificateChainList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse 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.alloydb.v1alpha.GenerateClientCertificateResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse 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.alloydb.v1alpha.GenerateClientCertificateResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse 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.alloydb.v1alpha.GenerateClientCertificateResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + 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.alloydb.v1alpha.GenerateClientCertificateResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse 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.alloydb.v1alpha.GenerateClientCertificateResponse 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; + } + /** + * + * + *
+   * Message returned by a GenerateClientCertificate operation.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse) + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.class, + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.Builder.class); + } + + // Construct using + // com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pemCertificate_ = ""; + pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse build() { + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse buildPartial() { + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse result = + new com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse result) { + if (((bitField0_ & 0x00000002) != 0)) { + pemCertificateChain_ = pemCertificateChain_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.pemCertificateChain_ = pemCertificateChain_; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pemCertificate_ = pemCertificate_; + } + } + + @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.alloydb.v1alpha.GenerateClientCertificateResponse) { + return mergeFrom( + (com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse other) { + if (other + == com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + .getDefaultInstance()) return this; + if (!other.getPemCertificate().isEmpty()) { + pemCertificate_ = other.pemCertificate_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.pemCertificateChain_.isEmpty()) { + if (pemCertificateChain_.isEmpty()) { + pemCertificateChain_ = other.pemCertificateChain_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.addAll(other.pemCertificateChain_); + } + 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: + { + pemCertificate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.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 pemCertificate_ = ""; + /** + * + * + *
+     * Output only. The pem-encoded, signed X.509 certificate.
+     * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pemCertificate. + */ + public java.lang.String getPemCertificate() { + java.lang.Object ref = pemCertificate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pemCertificate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The pem-encoded, signed X.509 certificate.
+     * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for pemCertificate. + */ + public com.google.protobuf.ByteString getPemCertificateBytes() { + java.lang.Object ref = pemCertificate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pemCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The pem-encoded, signed X.509 certificate.
+     * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The pemCertificate to set. + * @return This builder for chaining. + */ + public Builder setPemCertificate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pemCertificate_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded, signed X.509 certificate.
+     * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPemCertificate() { + pemCertificate_ = getDefaultInstance().getPemCertificate(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded, signed X.509 certificate.
+     * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for pemCertificate to set. + * @return This builder for chaining. + */ + public Builder setPemCertificateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pemCertificate_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList pemCertificateChain_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePemCertificateChainIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + pemCertificateChain_ = new com.google.protobuf.LazyStringArrayList(pemCertificateChain_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the pemCertificateChain. + */ + public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { + return pemCertificateChain_.getUnmodifiableView(); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of pemCertificateChain. + */ + public int getPemCertificateChainCount() { + return pemCertificateChain_.size(); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The pemCertificateChain at the given index. + */ + public java.lang.String getPemCertificateChain(int index) { + return pemCertificateChain_.get(index); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the pemCertificateChain at the given index. + */ + public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { + return pemCertificateChain_.getByteString(index); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The pemCertificateChain to set. + * @return This builder for chaining. + */ + public Builder setPemCertificateChain(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The pemCertificateChain to add. + * @return This builder for chaining. + */ + public Builder addPemCertificateChain(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The pemCertificateChain to add. + * @return This builder for chaining. + */ + public Builder addAllPemCertificateChain(java.lang.Iterable values) { + ensurePemCertificateChainIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pemCertificateChain_); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearPemCertificateChain() { + pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes of the pemCertificateChain to add. + * @return This builder for chaining. + */ + public Builder addPemCertificateChainBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.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.alloydb.v1alpha.GenerateClientCertificateResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse) + private static final com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse(); + } + + public static com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateClientCertificateResponse 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.alloydb.v1alpha.GenerateClientCertificateResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateResponseOrBuilder.java new file mode 100644 index 000000000000..6f16113315f5 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface GenerateClientCertificateResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The pem-encoded, signed X.509 certificate.
+   * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pemCertificate. + */ + java.lang.String getPemCertificate(); + /** + * + * + *
+   * Output only. The pem-encoded, signed X.509 certificate.
+   * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for pemCertificate. + */ + com.google.protobuf.ByteString getPemCertificateBytes(); + + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the pemCertificateChain. + */ + java.util.List getPemCertificateChainList(); + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of pemCertificateChain. + */ + int getPemCertificateChainCount(); + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The pemCertificateChain at the given index. + */ + java.lang.String getPemCertificateChain(int index); + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the pemCertificateChain at the given index. + */ + com.google.protobuf.ByteString getPemCertificateChainBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetBackupRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetBackupRequest.java new file mode 100644 index 000000000000..0ceeb6b9a5bf --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetBackupRequest.java @@ -0,0 +1,643 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for getting a Backup
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.GetBackupRequest} + */ +public final class GetBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.GetBackupRequest) + GetBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetBackupRequest.newBuilder() to construct. + private GetBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetBackupRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetBackupRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.GetBackupRequest.class, + com.google.cloud.alloydb.v1alpha.GetBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * 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. Name of the resource
+   * 
+ * + * + * 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.alloydb.v1alpha.GetBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.GetBackupRequest other = + (com.google.cloud.alloydb.v1alpha.GetBackupRequest) 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.alloydb.v1alpha.GetBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GetBackupRequest 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.alloydb.v1alpha.GetBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GetBackupRequest 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.alloydb.v1alpha.GetBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GetBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.GetBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GetBackupRequest 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.alloydb.v1alpha.GetBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GetBackupRequest 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.alloydb.v1alpha.GetBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GetBackupRequest 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.alloydb.v1alpha.GetBackupRequest 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; + } + /** + * + * + *
+   * Message for getting a Backup
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.GetBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.GetBackupRequest) + com.google.cloud.alloydb.v1alpha.GetBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.GetBackupRequest.class, + com.google.cloud.alloydb.v1alpha.GetBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.GetBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetBackupRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.GetBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetBackupRequest build() { + com.google.cloud.alloydb.v1alpha.GetBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetBackupRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.GetBackupRequest result = + new com.google.cloud.alloydb.v1alpha.GetBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.GetBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.alloydb.v1alpha.GetBackupRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.GetBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.GetBackupRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.GetBackupRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + 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(); + bitField0_ |= 0x00000001; + 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.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * 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; + 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.alloydb.v1alpha.GetBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.GetBackupRequest) + private static final com.google.cloud.alloydb.v1alpha.GetBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.GetBackupRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.GetBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBackupRequest 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.alloydb.v1alpha.GetBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetBackupRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetBackupRequestOrBuilder.java new file mode 100644 index 000000000000..5754a87a1a99 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetBackupRequestOrBuilder.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/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface GetBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.GetBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * 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-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetClusterRequest.java new file mode 100644 index 000000000000..06deacac006c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetClusterRequest.java @@ -0,0 +1,650 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for getting a Cluster
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.GetClusterRequest} + */ +public final class GetClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.GetClusterRequest) + GetClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetClusterRequest.newBuilder() to construct. + private GetClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetClusterRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetClusterRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.GetClusterRequest.class, + com.google.cloud.alloydb.v1alpha.GetClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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.alloydb.v1alpha.GetClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.GetClusterRequest other = + (com.google.cloud.alloydb.v1alpha.GetClusterRequest) 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.alloydb.v1alpha.GetClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GetClusterRequest 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.alloydb.v1alpha.GetClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GetClusterRequest 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.alloydb.v1alpha.GetClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GetClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.GetClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GetClusterRequest 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.alloydb.v1alpha.GetClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GetClusterRequest 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.alloydb.v1alpha.GetClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GetClusterRequest 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.alloydb.v1alpha.GetClusterRequest 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; + } + /** + * + * + *
+   * Message for getting a Cluster
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.GetClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.GetClusterRequest) + com.google.cloud.alloydb.v1alpha.GetClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.GetClusterRequest.class, + com.google.cloud.alloydb.v1alpha.GetClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.GetClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.GetClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetClusterRequest build() { + com.google.cloud.alloydb.v1alpha.GetClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetClusterRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.GetClusterRequest result = + new com.google.cloud.alloydb.v1alpha.GetClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.GetClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.alloydb.v1alpha.GetClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.GetClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.GetClusterRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.GetClusterRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + 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(); + bitField0_ |= 0x00000001; + 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.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + 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.alloydb.v1alpha.GetClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.GetClusterRequest) + private static final com.google.cloud.alloydb.v1alpha.GetClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.GetClusterRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.GetClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetClusterRequest 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.alloydb.v1alpha.GetClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetClusterRequestOrBuilder.java new file mode 100644 index 000000000000..34f57fe3a249 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetClusterRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface GetClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.GetClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetConnectionInfoRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetConnectionInfoRequest.java new file mode 100644 index 000000000000..46050d71ce31 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetConnectionInfoRequest.java @@ -0,0 +1,903 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Request message for GetConnectionInfo.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} + */ +public final class GetConnectionInfoRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.GetConnectionInfoRequest) + GetConnectionInfoRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetConnectionInfoRequest.newBuilder() to construct. + private GetConnectionInfoRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetConnectionInfoRequest() { + parent_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetConnectionInfoRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetConnectionInfoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetConnectionInfoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.class, + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+   * 
+ * + * + * 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 parent resource. The required format is:
+   * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, 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(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, 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.alloydb.v1alpha.GetConnectionInfoRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest other = + (com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().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.alloydb.v1alpha.GetConnectionInfoRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest 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.alloydb.v1alpha.GetConnectionInfoRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest 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.alloydb.v1alpha.GetConnectionInfoRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest 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.alloydb.v1alpha.GetConnectionInfoRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest 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.alloydb.v1alpha.GetConnectionInfoRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest 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.alloydb.v1alpha.GetConnectionInfoRequest 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 GetConnectionInfo.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.GetConnectionInfoRequest) + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetConnectionInfoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetConnectionInfoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.class, + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetConnectionInfoRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest build() { + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest result = + new com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + } + + @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.alloydb.v1alpha.GetConnectionInfoRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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 parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+     * 
+ * + * + * 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 parent resource. The required format is:
+     * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+     * 
+ * + * + * 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 parent resource. The required format is:
+     * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + 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.alloydb.v1alpha.GetConnectionInfoRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.GetConnectionInfoRequest) + private static final com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetConnectionInfoRequest 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.alloydb.v1alpha.GetConnectionInfoRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetConnectionInfoRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetConnectionInfoRequestOrBuilder.java new file mode 100644 index 000000000000..6145c2dc13db --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetConnectionInfoRequestOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface GetConnectionInfoRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.GetConnectionInfoRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetInstanceRequest.java new file mode 100644 index 000000000000..de0724561b82 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetInstanceRequest.java @@ -0,0 +1,800 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for getting a Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.GetInstanceRequest} + */ +public final class GetInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.GetInstanceRequest) + GetInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetInstanceRequest.newBuilder() to construct. + private GetInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetInstanceRequest() { + name_ = ""; + view_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetInstanceRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.GetInstanceRequest.class, + com.google.cloud.alloydb.v1alpha.GetInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 VIEW_FIELD_NUMBER = 2; + private int view_ = 0; + /** + * + * + *
+   * The view of the instance to return.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.InstanceView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * The view of the instance to return.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.InstanceView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.InstanceView getView() { + com.google.cloud.alloydb.v1alpha.InstanceView result = + com.google.cloud.alloydb.v1alpha.InstanceView.forNumber(view_); + return result == null ? com.google.cloud.alloydb.v1alpha.InstanceView.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 (view_ + != com.google.cloud.alloydb.v1alpha.InstanceView.INSTANCE_VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(2, view_); + } + 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 (view_ + != com.google.cloud.alloydb.v1alpha.InstanceView.INSTANCE_VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } + 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.alloydb.v1alpha.GetInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.GetInstanceRequest other = + (com.google.cloud.alloydb.v1alpha.GetInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (view_ != other.view_) 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) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.GetInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GetInstanceRequest 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.alloydb.v1alpha.GetInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GetInstanceRequest 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.alloydb.v1alpha.GetInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GetInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.GetInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GetInstanceRequest 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.alloydb.v1alpha.GetInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GetInstanceRequest 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.alloydb.v1alpha.GetInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GetInstanceRequest 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.alloydb.v1alpha.GetInstanceRequest 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; + } + /** + * + * + *
+   * Message for getting a Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.GetInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.GetInstanceRequest) + com.google.cloud.alloydb.v1alpha.GetInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.GetInstanceRequest.class, + com.google.cloud.alloydb.v1alpha.GetInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.GetInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + view_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.GetInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetInstanceRequest build() { + com.google.cloud.alloydb.v1alpha.GetInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.GetInstanceRequest result = + new com.google.cloud.alloydb.v1alpha.GetInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.GetInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.view_ = view_; + } + } + + @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.alloydb.v1alpha.GetInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.GetInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.GetInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.GetInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + view_ = input.readEnum(); + 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 java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int view_ = 0; + /** + * + * + *
+     * The view of the instance to return.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.InstanceView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * The view of the instance to return.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.InstanceView view = 2; + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + view_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The view of the instance to return.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.InstanceView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.InstanceView getView() { + com.google.cloud.alloydb.v1alpha.InstanceView result = + com.google.cloud.alloydb.v1alpha.InstanceView.forNumber(view_); + return result == null ? com.google.cloud.alloydb.v1alpha.InstanceView.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The view of the instance to return.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.InstanceView view = 2; + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.alloydb.v1alpha.InstanceView value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The view of the instance to return.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.InstanceView view = 2; + * + * @return This builder for chaining. + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000002); + view_ = 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.alloydb.v1alpha.GetInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.GetInstanceRequest) + private static final com.google.cloud.alloydb.v1alpha.GetInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.GetInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.GetInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetInstanceRequest 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.alloydb.v1alpha.GetInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..3b4013f9d991 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetInstanceRequestOrBuilder.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/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface GetInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.GetInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The view of the instance to return.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.InstanceView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * The view of the instance to return.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.InstanceView view = 2; + * + * @return The view. + */ + com.google.cloud.alloydb.v1alpha.InstanceView getView(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Instance.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Instance.java new file mode 100644 index 000000000000..80042f104408 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Instance.java @@ -0,0 +1,10030 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * An Instance is a computing unit that an end customer can connect to.
+ * It's the main unit of computing resources in AlloyDB.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Instance} + */ +public final class Instance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.Instance) + InstanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Instance.newBuilder() to construct. + private Instance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Instance() { + name_ = ""; + displayName_ = ""; + uid_ = ""; + state_ = 0; + instanceType_ = 0; + availabilityType_ = 0; + gceZone_ = ""; + nodes_ = java.util.Collections.emptyList(); + ipAddress_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Instance(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + case 13: + return internalGetDatabaseFlags(); + case 18: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Instance.class, + com.google.cloud.alloydb.v1alpha.Instance.Builder.class); + } + + /** + * + * + *
+   * Instance State
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.Instance.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The instance is active and running.
+     * 
+ * + * READY = 1; + */ + READY(1), + /** + * + * + *
+     * The instance is stopped. Instance name and IP resources are preserved.
+     * 
+ * + * STOPPED = 2; + */ + STOPPED(2), + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 3; + */ + CREATING(3), + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + /** + * + * + *
+     * The instance is down for maintenance.
+     * 
+ * + * MAINTENANCE = 5; + */ + MAINTENANCE(5), + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * an operation on the instance.
+     * Note: Instances in this state would tried to be auto-repaired. And
+     * Customers should be able to restart, update or delete these instances.
+     * 
+ * + * FAILED = 6; + */ + FAILED(6), + /** + * + * + *
+     * Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that
+     * index unused in case that state also needs to exposed via consumer apis
+     * in future.
+     * The instance has been configured to sync data from some other source.
+     * 
+ * + * BOOTSTRAPPING = 8; + */ + BOOTSTRAPPING(8), + /** + * + * + *
+     * The instance is being promoted.
+     * 
+ * + * PROMOTING = 9; + */ + PROMOTING(9), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The instance is active and running.
+     * 
+ * + * READY = 1; + */ + public static final int READY_VALUE = 1; + /** + * + * + *
+     * The instance is stopped. Instance name and IP resources are preserved.
+     * 
+ * + * STOPPED = 2; + */ + public static final int STOPPED_VALUE = 2; + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 3; + */ + public static final int CREATING_VALUE = 3; + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + /** + * + * + *
+     * The instance is down for maintenance.
+     * 
+ * + * MAINTENANCE = 5; + */ + public static final int MAINTENANCE_VALUE = 5; + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * an operation on the instance.
+     * Note: Instances in this state would tried to be auto-repaired. And
+     * Customers should be able to restart, update or delete these instances.
+     * 
+ * + * FAILED = 6; + */ + public static final int FAILED_VALUE = 6; + /** + * + * + *
+     * Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that
+     * index unused in case that state also needs to exposed via consumer apis
+     * in future.
+     * The instance has been configured to sync data from some other source.
+     * 
+ * + * BOOTSTRAPPING = 8; + */ + public static final int BOOTSTRAPPING_VALUE = 8; + /** + * + * + *
+     * The instance is being promoted.
+     * 
+ * + * PROMOTING = 9; + */ + public static final int PROMOTING_VALUE = 9; + + 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 READY; + case 2: + return STOPPED; + case 3: + return CREATING; + case 4: + return DELETING; + case 5: + return MAINTENANCE; + case 6: + return FAILED; + case 8: + return BOOTSTRAPPING; + case 9: + return PROMOTING; + 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.alloydb.v1alpha.Instance.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.alloydb.v1alpha.Instance.State) + } + + /** + * + * + *
+   * Type of an Instance
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.Instance.InstanceType} + */ + public enum InstanceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The type of the instance is unknown.
+     * 
+ * + * INSTANCE_TYPE_UNSPECIFIED = 0; + */ + INSTANCE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * PRIMARY instances support read and write operations.
+     * 
+ * + * PRIMARY = 1; + */ + PRIMARY(1), + /** + * + * + *
+     * READ POOL instances support read operations only. Each read pool instance
+     * consists of one or more homogeneous nodes.
+     *  * Read pool of size 1 can only have zonal availability.
+     *  * Read pools with node count of 2 or more can have regional
+     *    availability (nodes are present in 2 or more zones in a region).
+     * 
+ * + * READ_POOL = 2; + */ + READ_POOL(2), + /** + * + * + *
+     * SECONDARY instances support read operations only. SECONDARY instance
+     * is a cross-region read replica
+     * 
+ * + * SECONDARY = 3; + */ + SECONDARY(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The type of the instance is unknown.
+     * 
+ * + * INSTANCE_TYPE_UNSPECIFIED = 0; + */ + public static final int INSTANCE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * PRIMARY instances support read and write operations.
+     * 
+ * + * PRIMARY = 1; + */ + public static final int PRIMARY_VALUE = 1; + /** + * + * + *
+     * READ POOL instances support read operations only. Each read pool instance
+     * consists of one or more homogeneous nodes.
+     *  * Read pool of size 1 can only have zonal availability.
+     *  * Read pools with node count of 2 or more can have regional
+     *    availability (nodes are present in 2 or more zones in a region).
+     * 
+ * + * READ_POOL = 2; + */ + public static final int READ_POOL_VALUE = 2; + /** + * + * + *
+     * SECONDARY instances support read operations only. SECONDARY instance
+     * is a cross-region read replica
+     * 
+ * + * SECONDARY = 3; + */ + public static final int SECONDARY_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 InstanceType 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 InstanceType forNumber(int value) { + switch (value) { + case 0: + return INSTANCE_TYPE_UNSPECIFIED; + case 1: + return PRIMARY; + case 2: + return READ_POOL; + case 3: + return SECONDARY; + 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 InstanceType findValueByNumber(int number) { + return InstanceType.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.alloydb.v1alpha.Instance.getDescriptor().getEnumTypes().get(1); + } + + private static final InstanceType[] VALUES = values(); + + public static InstanceType 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 InstanceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.Instance.InstanceType) + } + + /** + * + * + *
+   * The Availability type of an instance. Potential values:
+   *   <br><b>ZONAL</b>: The instance serves data from only one zone.
+   * Outages in that zone affect instance availability.
+   *   <br><b>REGIONAL</b>: The instance can serve data from more than one zone
+   *   in a region (it is highly available).
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.Instance.AvailabilityType} + */ + public enum AvailabilityType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * This is an unknown Availability type.
+     * 
+ * + * AVAILABILITY_TYPE_UNSPECIFIED = 0; + */ + AVAILABILITY_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Zonal available instance.
+     * 
+ * + * ZONAL = 1; + */ + ZONAL(1), + /** + * + * + *
+     * Regional (or Highly) available instance.
+     * 
+ * + * REGIONAL = 2; + */ + REGIONAL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * This is an unknown Availability type.
+     * 
+ * + * AVAILABILITY_TYPE_UNSPECIFIED = 0; + */ + public static final int AVAILABILITY_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Zonal available instance.
+     * 
+ * + * ZONAL = 1; + */ + public static final int ZONAL_VALUE = 1; + /** + * + * + *
+     * Regional (or Highly) available instance.
+     * 
+ * + * REGIONAL = 2; + */ + public static final int REGIONAL_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 AvailabilityType 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 AvailabilityType forNumber(int value) { + switch (value) { + case 0: + return AVAILABILITY_TYPE_UNSPECIFIED; + case 1: + return ZONAL; + case 2: + return REGIONAL; + 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 AvailabilityType findValueByNumber(int number) { + return AvailabilityType.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.alloydb.v1alpha.Instance.getDescriptor().getEnumTypes().get(2); + } + + private static final AvailabilityType[] VALUES = values(); + + public static AvailabilityType 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 AvailabilityType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.Instance.AvailabilityType) + } + + public interface MachineConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.Instance.MachineConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The number of CPU's in the VM instance.
+     * 
+ * + * int32 cpu_count = 1; + * + * @return The cpuCount. + */ + int getCpuCount(); + } + /** + * + * + *
+   * MachineConfig describes the configuration of a machine.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Instance.MachineConfig} + */ + public static final class MachineConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.Instance.MachineConfig) + MachineConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use MachineConfig.newBuilder() to construct. + private MachineConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MachineConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MachineConfig(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_MachineConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_MachineConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.class, + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.Builder.class); + } + + public static final int CPU_COUNT_FIELD_NUMBER = 1; + private int cpuCount_ = 0; + /** + * + * + *
+     * The number of CPU's in the VM instance.
+     * 
+ * + * int32 cpu_count = 1; + * + * @return The cpuCount. + */ + @java.lang.Override + public int getCpuCount() { + return cpuCount_; + } + + 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 (cpuCount_ != 0) { + output.writeInt32(1, cpuCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (cpuCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, cpuCount_); + } + 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.alloydb.v1alpha.Instance.MachineConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig other = + (com.google.cloud.alloydb.v1alpha.Instance.MachineConfig) obj; + + if (getCpuCount() != other.getCpuCount()) 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) + CPU_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getCpuCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.Instance.MachineConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.MachineConfig 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.alloydb.v1alpha.Instance.MachineConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.MachineConfig 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.alloydb.v1alpha.Instance.MachineConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.MachineConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.MachineConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.MachineConfig 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.alloydb.v1alpha.Instance.MachineConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.MachineConfig 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.alloydb.v1alpha.Instance.MachineConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.MachineConfig 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.alloydb.v1alpha.Instance.MachineConfig 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; + } + /** + * + * + *
+     * MachineConfig describes the configuration of a machine.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Instance.MachineConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.Instance.MachineConfig) + com.google.cloud.alloydb.v1alpha.Instance.MachineConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_MachineConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_MachineConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.class, + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cpuCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_MachineConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.MachineConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.MachineConfig build() { + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.MachineConfig buildPartial() { + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig result = + new com.google.cloud.alloydb.v1alpha.Instance.MachineConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.Instance.MachineConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cpuCount_ = cpuCount_; + } + } + + @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.alloydb.v1alpha.Instance.MachineConfig) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.Instance.MachineConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.Instance.MachineConfig other) { + if (other == com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.getDefaultInstance()) + return this; + if (other.getCpuCount() != 0) { + setCpuCount(other.getCpuCount()); + } + 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: + { + cpuCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + 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 bitField0_; + + private int cpuCount_; + /** + * + * + *
+       * The number of CPU's in the VM instance.
+       * 
+ * + * int32 cpu_count = 1; + * + * @return The cpuCount. + */ + @java.lang.Override + public int getCpuCount() { + return cpuCount_; + } + /** + * + * + *
+       * The number of CPU's in the VM instance.
+       * 
+ * + * int32 cpu_count = 1; + * + * @param value The cpuCount to set. + * @return This builder for chaining. + */ + public Builder setCpuCount(int value) { + + cpuCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The number of CPU's in the VM instance.
+       * 
+ * + * int32 cpu_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearCpuCount() { + bitField0_ = (bitField0_ & ~0x00000001); + cpuCount_ = 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.alloydb.v1alpha.Instance.MachineConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.Instance.MachineConfig) + private static final com.google.cloud.alloydb.v1alpha.Instance.MachineConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.Instance.MachineConfig(); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.MachineConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MachineConfig 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.alloydb.v1alpha.Instance.MachineConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface NodeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.Instance.Node) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The Compute Engine zone of the VM e.g. "us-central1-b".
+     * 
+ * + * string zone_id = 1; + * + * @return The zoneId. + */ + java.lang.String getZoneId(); + /** + * + * + *
+     * The Compute Engine zone of the VM e.g. "us-central1-b".
+     * 
+ * + * string zone_id = 1; + * + * @return The bytes for zoneId. + */ + com.google.protobuf.ByteString getZoneIdBytes(); + + /** + * + * + *
+     * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+     * 
+ * + * string id = 2; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+     * 
+ * + * string id = 2; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * The private IP address of the VM e.g. "10.57.0.34".
+     * 
+ * + * string ip = 3; + * + * @return The ip. + */ + java.lang.String getIp(); + /** + * + * + *
+     * The private IP address of the VM e.g. "10.57.0.34".
+     * 
+ * + * string ip = 3; + * + * @return The bytes for ip. + */ + com.google.protobuf.ByteString getIpBytes(); + + /** + * + * + *
+     * Determined by state of the compute VM and postgres-service health.
+     * Compute VM state can have values listed in
+     * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+     * postgres-service health can have values: HEALTHY and UNHEALTHY.
+     * 
+ * + * string state = 4; + * + * @return The state. + */ + java.lang.String getState(); + /** + * + * + *
+     * Determined by state of the compute VM and postgres-service health.
+     * Compute VM state can have values listed in
+     * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+     * postgres-service health can have values: HEALTHY and UNHEALTHY.
+     * 
+ * + * string state = 4; + * + * @return The bytes for state. + */ + com.google.protobuf.ByteString getStateBytes(); + } + /** + * + * + *
+   * Details of a single node in the instance.
+   * Nodes in an AlloyDB instance are ephemereal, they can change during
+   * update, failover, autohealing and resize operations.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Instance.Node} + */ + public static final class Node extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.Instance.Node) + NodeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Node.newBuilder() to construct. + private Node(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Node() { + zoneId_ = ""; + id_ = ""; + ip_ = ""; + state_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Node(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_Node_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Instance.Node.class, + com.google.cloud.alloydb.v1alpha.Instance.Node.Builder.class); + } + + public static final int ZONE_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object zoneId_ = ""; + /** + * + * + *
+     * The Compute Engine zone of the VM e.g. "us-central1-b".
+     * 
+ * + * string zone_id = 1; + * + * @return The zoneId. + */ + @java.lang.Override + public java.lang.String getZoneId() { + java.lang.Object ref = zoneId_; + 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(); + zoneId_ = s; + return s; + } + } + /** + * + * + *
+     * The Compute Engine zone of the VM e.g. "us-central1-b".
+     * 
+ * + * string zone_id = 1; + * + * @return The bytes for zoneId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getZoneIdBytes() { + java.lang.Object ref = zoneId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zoneId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+     * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+     * 
+ * + * string id = 2; + * + * @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; + } + } + /** + * + * + *
+     * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+     * 
+ * + * string id = 2; + * + * @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 IP_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object ip_ = ""; + /** + * + * + *
+     * The private IP address of the VM e.g. "10.57.0.34".
+     * 
+ * + * string ip = 3; + * + * @return The ip. + */ + @java.lang.Override + public java.lang.String getIp() { + java.lang.Object ref = ip_; + 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(); + ip_ = s; + return s; + } + } + /** + * + * + *
+     * The private IP address of the VM e.g. "10.57.0.34".
+     * 
+ * + * string ip = 3; + * + * @return The bytes for ip. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpBytes() { + java.lang.Object ref = ip_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ip_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object state_ = ""; + /** + * + * + *
+     * Determined by state of the compute VM and postgres-service health.
+     * Compute VM state can have values listed in
+     * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+     * postgres-service health can have values: HEALTHY and UNHEALTHY.
+     * 
+ * + * string state = 4; + * + * @return The state. + */ + @java.lang.Override + public java.lang.String getState() { + java.lang.Object ref = state_; + 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(); + state_ = s; + return s; + } + } + /** + * + * + *
+     * Determined by state of the compute VM and postgres-service health.
+     * Compute VM state can have values listed in
+     * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+     * postgres-service health can have values: HEALTHY and UNHEALTHY.
+     * 
+ * + * string state = 4; + * + * @return The bytes for state. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStateBytes() { + java.lang.Object ref = state_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + state_ = 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(zoneId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, zoneId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ip_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, ip_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(state_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, 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(zoneId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, zoneId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ip_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, ip_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(state_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, 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.alloydb.v1alpha.Instance.Node)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.Instance.Node other = + (com.google.cloud.alloydb.v1alpha.Instance.Node) obj; + + if (!getZoneId().equals(other.getZoneId())) return false; + if (!getId().equals(other.getId())) return false; + if (!getIp().equals(other.getIp())) return false; + if (!getState().equals(other.getState())) 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) + ZONE_ID_FIELD_NUMBER; + hash = (53 * hash) + getZoneId().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + IP_FIELD_NUMBER; + hash = (53 * hash) + getIp().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + getState().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.Instance.Node parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.Node 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.alloydb.v1alpha.Instance.Node parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.Node 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.alloydb.v1alpha.Instance.Node parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.Node parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.Node parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.Node 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.alloydb.v1alpha.Instance.Node parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.Node 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.alloydb.v1alpha.Instance.Node parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.Node 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.alloydb.v1alpha.Instance.Node 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; + } + /** + * + * + *
+     * Details of a single node in the instance.
+     * Nodes in an AlloyDB instance are ephemereal, they can change during
+     * update, failover, autohealing and resize operations.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Instance.Node} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.Instance.Node) + com.google.cloud.alloydb.v1alpha.Instance.NodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_Node_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Instance.Node.class, + com.google.cloud.alloydb.v1alpha.Instance.Node.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.Instance.Node.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + zoneId_ = ""; + id_ = ""; + ip_ = ""; + state_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_Node_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.Node getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.Instance.Node.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.Node build() { + com.google.cloud.alloydb.v1alpha.Instance.Node result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.Node buildPartial() { + com.google.cloud.alloydb.v1alpha.Instance.Node result = + new com.google.cloud.alloydb.v1alpha.Instance.Node(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.Instance.Node result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.zoneId_ = zoneId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ip_ = ip_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.state_ = state_; + } + } + + @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.alloydb.v1alpha.Instance.Node) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.Instance.Node) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.Instance.Node other) { + if (other == com.google.cloud.alloydb.v1alpha.Instance.Node.getDefaultInstance()) + return this; + if (!other.getZoneId().isEmpty()) { + zoneId_ = other.zoneId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getIp().isEmpty()) { + ip_ = other.ip_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getState().isEmpty()) { + state_ = other.state_; + bitField0_ |= 0x00000008; + 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: + { + zoneId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + ip_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + state_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object zoneId_ = ""; + /** + * + * + *
+       * The Compute Engine zone of the VM e.g. "us-central1-b".
+       * 
+ * + * string zone_id = 1; + * + * @return The zoneId. + */ + public java.lang.String getZoneId() { + java.lang.Object ref = zoneId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + zoneId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The Compute Engine zone of the VM e.g. "us-central1-b".
+       * 
+ * + * string zone_id = 1; + * + * @return The bytes for zoneId. + */ + public com.google.protobuf.ByteString getZoneIdBytes() { + java.lang.Object ref = zoneId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zoneId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The Compute Engine zone of the VM e.g. "us-central1-b".
+       * 
+ * + * string zone_id = 1; + * + * @param value The zoneId to set. + * @return This builder for chaining. + */ + public Builder setZoneId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + zoneId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The Compute Engine zone of the VM e.g. "us-central1-b".
+       * 
+ * + * string zone_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearZoneId() { + zoneId_ = getDefaultInstance().getZoneId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The Compute Engine zone of the VM e.g. "us-central1-b".
+       * 
+ * + * string zone_id = 1; + * + * @param value The bytes for zoneId to set. + * @return This builder for chaining. + */ + public Builder setZoneIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + zoneId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+       * 
+ * + * string id = 2; + * + * @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; + } + } + /** + * + * + *
+       * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+       * 
+ * + * string id = 2; + * + * @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; + } + } + /** + * + * + *
+       * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+       * 
+ * + * string id = 2; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+       * 
+ * + * string id = 2; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+       * 
+ * + * string id = 2; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object ip_ = ""; + /** + * + * + *
+       * The private IP address of the VM e.g. "10.57.0.34".
+       * 
+ * + * string ip = 3; + * + * @return The ip. + */ + public java.lang.String getIp() { + java.lang.Object ref = ip_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ip_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The private IP address of the VM e.g. "10.57.0.34".
+       * 
+ * + * string ip = 3; + * + * @return The bytes for ip. + */ + public com.google.protobuf.ByteString getIpBytes() { + java.lang.Object ref = ip_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ip_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The private IP address of the VM e.g. "10.57.0.34".
+       * 
+ * + * string ip = 3; + * + * @param value The ip to set. + * @return This builder for chaining. + */ + public Builder setIp(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ip_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * The private IP address of the VM e.g. "10.57.0.34".
+       * 
+ * + * string ip = 3; + * + * @return This builder for chaining. + */ + public Builder clearIp() { + ip_ = getDefaultInstance().getIp(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * The private IP address of the VM e.g. "10.57.0.34".
+       * 
+ * + * string ip = 3; + * + * @param value The bytes for ip to set. + * @return This builder for chaining. + */ + public Builder setIpBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ip_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object state_ = ""; + /** + * + * + *
+       * Determined by state of the compute VM and postgres-service health.
+       * Compute VM state can have values listed in
+       * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+       * postgres-service health can have values: HEALTHY and UNHEALTHY.
+       * 
+ * + * string state = 4; + * + * @return The state. + */ + public java.lang.String getState() { + java.lang.Object ref = state_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + state_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Determined by state of the compute VM and postgres-service health.
+       * Compute VM state can have values listed in
+       * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+       * postgres-service health can have values: HEALTHY and UNHEALTHY.
+       * 
+ * + * string state = 4; + * + * @return The bytes for state. + */ + public com.google.protobuf.ByteString getStateBytes() { + java.lang.Object ref = state_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + state_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Determined by state of the compute VM and postgres-service health.
+       * Compute VM state can have values listed in
+       * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+       * postgres-service health can have values: HEALTHY and UNHEALTHY.
+       * 
+ * + * string state = 4; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + state_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Determined by state of the compute VM and postgres-service health.
+       * Compute VM state can have values listed in
+       * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+       * postgres-service health can have values: HEALTHY and UNHEALTHY.
+       * 
+ * + * string state = 4; + * + * @return This builder for chaining. + */ + public Builder clearState() { + state_ = getDefaultInstance().getState(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+       * Determined by state of the compute VM and postgres-service health.
+       * Compute VM state can have values listed in
+       * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+       * postgres-service health can have values: HEALTHY and UNHEALTHY.
+       * 
+ * + * string state = 4; + * + * @param value The bytes for state to set. + * @return This builder for chaining. + */ + public Builder setStateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + state_ = value; + bitField0_ |= 0x00000008; + 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.alloydb.v1alpha.Instance.Node) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.Instance.Node) + private static final com.google.cloud.alloydb.v1alpha.Instance.Node DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.Instance.Node(); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.Node getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Node 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.alloydb.v1alpha.Instance.Node getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryInsightsInstanceConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Record application tags for an instance.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_application_tags = 2; + * + * @return Whether the recordApplicationTags field is set. + */ + boolean hasRecordApplicationTags(); + /** + * + * + *
+     * Record application tags for an instance.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_application_tags = 2; + * + * @return The recordApplicationTags. + */ + boolean getRecordApplicationTags(); + + /** + * + * + *
+     * Record client address for an instance. Client address is PII information.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_client_address = 3; + * + * @return Whether the recordClientAddress field is set. + */ + boolean hasRecordClientAddress(); + /** + * + * + *
+     * Record client address for an instance. Client address is PII information.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_client_address = 3; + * + * @return The recordClientAddress. + */ + boolean getRecordClientAddress(); + + /** + * + * + *
+     * Query string length. The default value is 1024.
+     * Any integer between 256 and 4500 is considered valid.
+     * 
+ * + * uint32 query_string_length = 4; + * + * @return The queryStringLength. + */ + int getQueryStringLength(); + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. The default value is 5.
+     * Any integer between 0 and 20 is considered valid.
+     * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return Whether the queryPlansPerMinute field is set. + */ + boolean hasQueryPlansPerMinute(); + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. The default value is 5.
+     * Any integer between 0 and 20 is considered valid.
+     * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return The queryPlansPerMinute. + */ + int getQueryPlansPerMinute(); + } + /** + * + * + *
+   * QueryInsights Instance specific configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} + */ + public static final class QueryInsightsInstanceConfig + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig) + QueryInsightsInstanceConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryInsightsInstanceConfig.newBuilder() to construct. + private QueryInsightsInstanceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryInsightsInstanceConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryInsightsInstanceConfig(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_QueryInsightsInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_QueryInsightsInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.class, + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.Builder.class); + } + + private int bitField0_; + public static final int RECORD_APPLICATION_TAGS_FIELD_NUMBER = 2; + private boolean recordApplicationTags_ = false; + /** + * + * + *
+     * Record application tags for an instance.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_application_tags = 2; + * + * @return Whether the recordApplicationTags field is set. + */ + @java.lang.Override + public boolean hasRecordApplicationTags() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Record application tags for an instance.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_application_tags = 2; + * + * @return The recordApplicationTags. + */ + @java.lang.Override + public boolean getRecordApplicationTags() { + return recordApplicationTags_; + } + + public static final int RECORD_CLIENT_ADDRESS_FIELD_NUMBER = 3; + private boolean recordClientAddress_ = false; + /** + * + * + *
+     * Record client address for an instance. Client address is PII information.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_client_address = 3; + * + * @return Whether the recordClientAddress field is set. + */ + @java.lang.Override + public boolean hasRecordClientAddress() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Record client address for an instance. Client address is PII information.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_client_address = 3; + * + * @return The recordClientAddress. + */ + @java.lang.Override + public boolean getRecordClientAddress() { + return recordClientAddress_; + } + + public static final int QUERY_STRING_LENGTH_FIELD_NUMBER = 4; + private int queryStringLength_ = 0; + /** + * + * + *
+     * Query string length. The default value is 1024.
+     * Any integer between 256 and 4500 is considered valid.
+     * 
+ * + * uint32 query_string_length = 4; + * + * @return The queryStringLength. + */ + @java.lang.Override + public int getQueryStringLength() { + return queryStringLength_; + } + + public static final int QUERY_PLANS_PER_MINUTE_FIELD_NUMBER = 5; + private int queryPlansPerMinute_ = 0; + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. The default value is 5.
+     * Any integer between 0 and 20 is considered valid.
+     * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return Whether the queryPlansPerMinute field is set. + */ + @java.lang.Override + public boolean hasQueryPlansPerMinute() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. The default value is 5.
+     * Any integer between 0 and 20 is considered valid.
+     * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return The queryPlansPerMinute. + */ + @java.lang.Override + public int getQueryPlansPerMinute() { + return queryPlansPerMinute_; + } + + 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(2, recordApplicationTags_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(3, recordClientAddress_); + } + if (queryStringLength_ != 0) { + output.writeUInt32(4, queryStringLength_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeUInt32(5, queryPlansPerMinute_); + } + 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(2, recordApplicationTags_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, recordClientAddress_); + } + if (queryStringLength_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(4, queryStringLength_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(5, queryPlansPerMinute_); + } + 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.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig other = + (com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig) obj; + + if (hasRecordApplicationTags() != other.hasRecordApplicationTags()) return false; + if (hasRecordApplicationTags()) { + if (getRecordApplicationTags() != other.getRecordApplicationTags()) return false; + } + if (hasRecordClientAddress() != other.hasRecordClientAddress()) return false; + if (hasRecordClientAddress()) { + if (getRecordClientAddress() != other.getRecordClientAddress()) return false; + } + if (getQueryStringLength() != other.getQueryStringLength()) return false; + if (hasQueryPlansPerMinute() != other.hasQueryPlansPerMinute()) return false; + if (hasQueryPlansPerMinute()) { + if (getQueryPlansPerMinute() != other.getQueryPlansPerMinute()) 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 (hasRecordApplicationTags()) { + hash = (37 * hash) + RECORD_APPLICATION_TAGS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRecordApplicationTags()); + } + if (hasRecordClientAddress()) { + hash = (37 * hash) + RECORD_CLIENT_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRecordClientAddress()); + } + hash = (37 * hash) + QUERY_STRING_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getQueryStringLength(); + if (hasQueryPlansPerMinute()) { + hash = (37 * hash) + QUERY_PLANS_PER_MINUTE_FIELD_NUMBER; + hash = (53 * hash) + getQueryPlansPerMinute(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig 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.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig 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.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig 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.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + 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.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig 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.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig 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; + } + /** + * + * + *
+     * QueryInsights Instance specific configuration.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig) + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_QueryInsightsInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_QueryInsightsInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.class, + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.Builder + .class); + } + + // Construct using + // com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + recordApplicationTags_ = false; + recordClientAddress_ = false; + queryStringLength_ = 0; + queryPlansPerMinute_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_QueryInsightsInstanceConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig build() { + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig buildPartial() { + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig result = + new com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.recordApplicationTags_ = recordApplicationTags_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.recordClientAddress_ = recordClientAddress_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.queryStringLength_ = queryStringLength_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.queryPlansPerMinute_ = queryPlansPerMinute_; + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @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.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig) { + return mergeFrom( + (com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig other) { + if (other + == com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + .getDefaultInstance()) return this; + if (other.hasRecordApplicationTags()) { + setRecordApplicationTags(other.getRecordApplicationTags()); + } + if (other.hasRecordClientAddress()) { + setRecordClientAddress(other.getRecordClientAddress()); + } + if (other.getQueryStringLength() != 0) { + setQueryStringLength(other.getQueryStringLength()); + } + if (other.hasQueryPlansPerMinute()) { + setQueryPlansPerMinute(other.getQueryPlansPerMinute()); + } + 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 16: + { + recordApplicationTags_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 16 + case 24: + { + recordClientAddress_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 24 + case 32: + { + queryStringLength_ = input.readUInt32(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 40: + { + queryPlansPerMinute_ = input.readUInt32(); + bitField0_ |= 0x00000008; + break; + } // case 40 + 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 recordApplicationTags_; + /** + * + * + *
+       * Record application tags for an instance.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_application_tags = 2; + * + * @return Whether the recordApplicationTags field is set. + */ + @java.lang.Override + public boolean hasRecordApplicationTags() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Record application tags for an instance.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_application_tags = 2; + * + * @return The recordApplicationTags. + */ + @java.lang.Override + public boolean getRecordApplicationTags() { + return recordApplicationTags_; + } + /** + * + * + *
+       * Record application tags for an instance.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_application_tags = 2; + * + * @param value The recordApplicationTags to set. + * @return This builder for chaining. + */ + public Builder setRecordApplicationTags(boolean value) { + + recordApplicationTags_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Record application tags for an instance.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_application_tags = 2; + * + * @return This builder for chaining. + */ + public Builder clearRecordApplicationTags() { + bitField0_ = (bitField0_ & ~0x00000001); + recordApplicationTags_ = false; + onChanged(); + return this; + } + + private boolean recordClientAddress_; + /** + * + * + *
+       * Record client address for an instance. Client address is PII information.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_client_address = 3; + * + * @return Whether the recordClientAddress field is set. + */ + @java.lang.Override + public boolean hasRecordClientAddress() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Record client address for an instance. Client address is PII information.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_client_address = 3; + * + * @return The recordClientAddress. + */ + @java.lang.Override + public boolean getRecordClientAddress() { + return recordClientAddress_; + } + /** + * + * + *
+       * Record client address for an instance. Client address is PII information.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_client_address = 3; + * + * @param value The recordClientAddress to set. + * @return This builder for chaining. + */ + public Builder setRecordClientAddress(boolean value) { + + recordClientAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Record client address for an instance. Client address is PII information.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_client_address = 3; + * + * @return This builder for chaining. + */ + public Builder clearRecordClientAddress() { + bitField0_ = (bitField0_ & ~0x00000002); + recordClientAddress_ = false; + onChanged(); + return this; + } + + private int queryStringLength_; + /** + * + * + *
+       * Query string length. The default value is 1024.
+       * Any integer between 256 and 4500 is considered valid.
+       * 
+ * + * uint32 query_string_length = 4; + * + * @return The queryStringLength. + */ + @java.lang.Override + public int getQueryStringLength() { + return queryStringLength_; + } + /** + * + * + *
+       * Query string length. The default value is 1024.
+       * Any integer between 256 and 4500 is considered valid.
+       * 
+ * + * uint32 query_string_length = 4; + * + * @param value The queryStringLength to set. + * @return This builder for chaining. + */ + public Builder setQueryStringLength(int value) { + + queryStringLength_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Query string length. The default value is 1024.
+       * Any integer between 256 and 4500 is considered valid.
+       * 
+ * + * uint32 query_string_length = 4; + * + * @return This builder for chaining. + */ + public Builder clearQueryStringLength() { + bitField0_ = (bitField0_ & ~0x00000004); + queryStringLength_ = 0; + onChanged(); + return this; + } + + private int queryPlansPerMinute_; + /** + * + * + *
+       * Number of query execution plans captured by Insights per minute
+       * for all queries combined. The default value is 5.
+       * Any integer between 0 and 20 is considered valid.
+       * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return Whether the queryPlansPerMinute field is set. + */ + @java.lang.Override + public boolean hasQueryPlansPerMinute() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+       * Number of query execution plans captured by Insights per minute
+       * for all queries combined. The default value is 5.
+       * Any integer between 0 and 20 is considered valid.
+       * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return The queryPlansPerMinute. + */ + @java.lang.Override + public int getQueryPlansPerMinute() { + return queryPlansPerMinute_; + } + /** + * + * + *
+       * Number of query execution plans captured by Insights per minute
+       * for all queries combined. The default value is 5.
+       * Any integer between 0 and 20 is considered valid.
+       * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @param value The queryPlansPerMinute to set. + * @return This builder for chaining. + */ + public Builder setQueryPlansPerMinute(int value) { + + queryPlansPerMinute_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Number of query execution plans captured by Insights per minute
+       * for all queries combined. The default value is 5.
+       * Any integer between 0 and 20 is considered valid.
+       * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return This builder for chaining. + */ + public Builder clearQueryPlansPerMinute() { + bitField0_ = (bitField0_ & ~0x00000008); + queryPlansPerMinute_ = 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.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig) + private static final com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig(); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryInsightsInstanceConfig 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.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ReadPoolConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Read capacity, i.e. number of nodes in a read pool instance.
+     * 
+ * + * int32 node_count = 1; + * + * @return The nodeCount. + */ + int getNodeCount(); + } + /** + * + * + *
+   * Configuration for a read pool instance.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} + */ + public static final class ReadPoolConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) + ReadPoolConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadPoolConfig.newBuilder() to construct. + private ReadPoolConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadPoolConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReadPoolConfig(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.class, + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.Builder.class); + } + + public static final int NODE_COUNT_FIELD_NUMBER = 1; + private int nodeCount_ = 0; + /** + * + * + *
+     * Read capacity, i.e. number of nodes in a read pool instance.
+     * 
+ * + * int32 node_count = 1; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + + 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 (nodeCount_ != 0) { + output.writeInt32(1, nodeCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (nodeCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, nodeCount_); + } + 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.alloydb.v1alpha.Instance.ReadPoolConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig other = + (com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) obj; + + if (getNodeCount() != other.getNodeCount()) 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) + NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getNodeCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig 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.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig 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.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig 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.alloydb.v1alpha.Instance.ReadPoolConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig 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.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig 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.alloydb.v1alpha.Instance.ReadPoolConfig 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; + } + /** + * + * + *
+     * Configuration for a read pool instance.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.class, + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + nodeCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig build() { + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig buildPartial() { + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig result = + new com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.nodeCount_ = nodeCount_; + } + } + + @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.alloydb.v1alpha.Instance.ReadPoolConfig) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig other) { + if (other == com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.getDefaultInstance()) + return this; + if (other.getNodeCount() != 0) { + setNodeCount(other.getNodeCount()); + } + 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: + { + nodeCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + 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 bitField0_; + + private int nodeCount_; + /** + * + * + *
+       * Read capacity, i.e. number of nodes in a read pool instance.
+       * 
+ * + * int32 node_count = 1; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + /** + * + * + *
+       * Read capacity, i.e. number of nodes in a read pool instance.
+       * 
+ * + * int32 node_count = 1; + * + * @param value The nodeCount to set. + * @return This builder for chaining. + */ + public Builder setNodeCount(int value) { + + nodeCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Read capacity, i.e. number of nodes in a read pool instance.
+       * 
+ * + * int32 node_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearNodeCount() { + bitField0_ = (bitField0_ & ~0x00000001); + nodeCount_ = 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.alloydb.v1alpha.Instance.ReadPoolConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) + private static final com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig(); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadPoolConfig 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.alloydb.v1alpha.Instance.ReadPoolConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The name of the instance resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+   * where the cluster and instance ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the instance resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The name of the instance resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+   * where the cluster and instance ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the instance resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * User-settable and human-readable display name for the Instance.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * User-settable and human-readable display name for the Instance.
+   * 
+ * + * 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 UID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + 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(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int DELETE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + + public static final int LABELS_FIELD_NUMBER = 7; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATE_FIELD_NUMBER = 8; + private int state_ = 0; + /** + * + * + *
+   * Output only. The current serving state of the instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current serving state of the instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.State getState() { + com.google.cloud.alloydb.v1alpha.Instance.State result = + com.google.cloud.alloydb.v1alpha.Instance.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1alpha.Instance.State.UNRECOGNIZED : result; + } + + public static final int INSTANCE_TYPE_FIELD_NUMBER = 9; + private int instanceType_ = 0; + /** + * + * + *
+   * Required. The type of the instance. Specified at creation time.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for instanceType. + */ + @java.lang.Override + public int getInstanceTypeValue() { + return instanceType_; + } + /** + * + * + *
+   * Required. The type of the instance. Specified at creation time.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instanceType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.InstanceType getInstanceType() { + com.google.cloud.alloydb.v1alpha.Instance.InstanceType result = + com.google.cloud.alloydb.v1alpha.Instance.InstanceType.forNumber(instanceType_); + return result == null + ? com.google.cloud.alloydb.v1alpha.Instance.InstanceType.UNRECOGNIZED + : result; + } + + public static final int MACHINE_CONFIG_FIELD_NUMBER = 10; + private com.google.cloud.alloydb.v1alpha.Instance.MachineConfig machineConfig_; + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + * + * @return Whether the machineConfig field is set. + */ + @java.lang.Override + public boolean hasMachineConfig() { + return machineConfig_ != null; + } + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + * + * @return The machineConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.MachineConfig getMachineConfig() { + return machineConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.getDefaultInstance() + : machineConfig_; + } + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.MachineConfigOrBuilder + getMachineConfigOrBuilder() { + return machineConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.getDefaultInstance() + : machineConfig_; + } + + public static final int AVAILABILITY_TYPE_FIELD_NUMBER = 11; + private int availabilityType_ = 0; + /** + * + * + *
+   * Availability type of an Instance.
+   * Defaults to REGIONAL for both primary and read instances.
+   * Note that primary and read instances can have different availability types.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; + * + * @return The enum numeric value on the wire for availabilityType. + */ + @java.lang.Override + public int getAvailabilityTypeValue() { + return availabilityType_; + } + /** + * + * + *
+   * Availability type of an Instance.
+   * Defaults to REGIONAL for both primary and read instances.
+   * Note that primary and read instances can have different availability types.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; + * + * @return The availabilityType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.AvailabilityType getAvailabilityType() { + com.google.cloud.alloydb.v1alpha.Instance.AvailabilityType result = + com.google.cloud.alloydb.v1alpha.Instance.AvailabilityType.forNumber(availabilityType_); + return result == null + ? com.google.cloud.alloydb.v1alpha.Instance.AvailabilityType.UNRECOGNIZED + : result; + } + + public static final int GCE_ZONE_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object gceZone_ = ""; + /** + * + * + *
+   * The Compute Engine zone that the instance should serve from, per
+   * https://cloud.google.com/compute/docs/regions-zones
+   * This can ONLY be specified for ZONAL instances.
+   * If present for a REGIONAL instance, an error will be thrown.
+   * If this is absent for a ZONAL instance, instance is created in a random
+   * zone with available capacity.
+   * 
+ * + * string gce_zone = 12; + * + * @return The gceZone. + */ + @java.lang.Override + public java.lang.String getGceZone() { + java.lang.Object ref = gceZone_; + 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(); + gceZone_ = s; + return s; + } + } + /** + * + * + *
+   * The Compute Engine zone that the instance should serve from, per
+   * https://cloud.google.com/compute/docs/regions-zones
+   * This can ONLY be specified for ZONAL instances.
+   * If present for a REGIONAL instance, an error will be thrown.
+   * If this is absent for a ZONAL instance, instance is created in a random
+   * zone with available capacity.
+   * 
+ * + * string gce_zone = 12; + * + * @return The bytes for gceZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGceZoneBytes() { + java.lang.Object ref = gceZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_FLAGS_FIELD_NUMBER = 13; + + private static final class DatabaseFlagsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_DatabaseFlagsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField databaseFlags_; + + private com.google.protobuf.MapField + internalGetDatabaseFlags() { + if (databaseFlags_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DatabaseFlagsDefaultEntryHolder.defaultEntry); + } + return databaseFlags_; + } + + public int getDatabaseFlagsCount() { + return internalGetDatabaseFlags().getMap().size(); + } + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public boolean containsDatabaseFlags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetDatabaseFlags().getMap().containsKey(key); + } + /** Use {@link #getDatabaseFlagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDatabaseFlags() { + return getDatabaseFlagsMap(); + } + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public java.util.Map getDatabaseFlagsMap() { + return internalGetDatabaseFlags().getMap(); + } + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public /* nullable */ java.lang.String getDatabaseFlagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDatabaseFlags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public java.lang.String getDatabaseFlagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDatabaseFlags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int WRITABLE_NODE_FIELD_NUMBER = 19; + private com.google.cloud.alloydb.v1alpha.Instance.Node writableNode_; + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writableNode field is set. + */ + @java.lang.Override + public boolean hasWritableNode() { + return writableNode_ != null; + } + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writableNode. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.Node getWritableNode() { + return writableNode_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.Node.getDefaultInstance() + : writableNode_; + } + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.NodeOrBuilder getWritableNodeOrBuilder() { + return writableNode_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.Node.getDefaultInstance() + : writableNode_; + } + + public static final int NODES_FIELD_NUMBER = 20; + + @SuppressWarnings("serial") + private java.util.List nodes_; + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getNodesList() { + return nodes_; + } + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getNodesOrBuilderList() { + return nodes_; + } + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getNodesCount() { + return nodes_.size(); + } + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.Node getNodes(int index) { + return nodes_.get(index); + } + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.NodeOrBuilder getNodesOrBuilder(int index) { + return nodes_.get(index); + } + + public static final int QUERY_INSIGHTS_CONFIG_FIELD_NUMBER = 21; + private com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + queryInsightsConfig_; + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return Whether the queryInsightsConfig field is set. + */ + @java.lang.Override + public boolean hasQueryInsightsConfig() { + return queryInsightsConfig_ != null; + } + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return The queryInsightsConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + getQueryInsightsConfig() { + return queryInsightsConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.getDefaultInstance() + : queryInsightsConfig_; + } + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfigOrBuilder + getQueryInsightsConfigOrBuilder() { + return queryInsightsConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.getDefaultInstance() + : queryInsightsConfig_; + } + + public static final int READ_POOL_CONFIG_FIELD_NUMBER = 14; + private com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig readPoolConfig_; + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return Whether the readPoolConfig field is set. + */ + @java.lang.Override + public boolean hasReadPoolConfig() { + return readPoolConfig_ != null; + } + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return The readPoolConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig getReadPoolConfig() { + return readPoolConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.getDefaultInstance() + : readPoolConfig_; + } + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfigOrBuilder + getReadPoolConfigOrBuilder() { + return readPoolConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.getDefaultInstance() + : readPoolConfig_; + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object ipAddress_ = ""; + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ipAddress. + */ + @java.lang.Override + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + 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(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for ipAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECONCILING_FIELD_NUMBER = 16; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+   * Set to true if the current state of Instance does not match the user's
+   * intended state, and the service is actively updating the resource to
+   * reconcile them. This can happen due to user-triggered updates or
+   * system actions like failover or maintenance.
+   * 
+ * + * bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int ETAG_FIELD_NUMBER = 17; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 17; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 17; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 18; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().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(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(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uid_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (deleteTime_ != null) { + output.writeMessage(6, getDeleteTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 7); + if (state_ != com.google.cloud.alloydb.v1alpha.Instance.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, state_); + } + if (instanceType_ + != com.google.cloud.alloydb.v1alpha.Instance.InstanceType.INSTANCE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, instanceType_); + } + if (machineConfig_ != null) { + output.writeMessage(10, getMachineConfig()); + } + if (availabilityType_ + != com.google.cloud.alloydb.v1alpha.Instance.AvailabilityType.AVAILABILITY_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(11, availabilityType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gceZone_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, gceZone_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetDatabaseFlags(), DatabaseFlagsDefaultEntryHolder.defaultEntry, 13); + if (readPoolConfig_ != null) { + output.writeMessage(14, getReadPoolConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, ipAddress_); + } + if (reconciling_ != false) { + output.writeBool(16, reconciling_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, etag_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 18); + if (writableNode_ != null) { + output.writeMessage(19, getWritableNode()); + } + for (int i = 0; i < nodes_.size(); i++) { + output.writeMessage(20, nodes_.get(i)); + } + if (queryInsightsConfig_ != null) { + output.writeMessage(21, getQueryInsightsConfig()); + } + 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(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uid_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDeleteTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, labels__); + } + if (state_ != com.google.cloud.alloydb.v1alpha.Instance.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, state_); + } + if (instanceType_ + != com.google.cloud.alloydb.v1alpha.Instance.InstanceType.INSTANCE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, instanceType_); + } + if (machineConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getMachineConfig()); + } + if (availabilityType_ + != com.google.cloud.alloydb.v1alpha.Instance.AvailabilityType.AVAILABILITY_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, availabilityType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gceZone_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, gceZone_); + } + for (java.util.Map.Entry entry : + internalGetDatabaseFlags().getMap().entrySet()) { + com.google.protobuf.MapEntry databaseFlags__ = + DatabaseFlagsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, databaseFlags__); + } + if (readPoolConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getReadPoolConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, ipAddress_); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(16, reconciling_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, etag_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, annotations__); + } + if (writableNode_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getWritableNode()); + } + for (int i = 0; i < nodes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, nodes_.get(i)); + } + if (queryInsightsConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(21, getQueryInsightsConfig()); + } + 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.alloydb.v1alpha.Instance)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.Instance other = + (com.google.cloud.alloydb.v1alpha.Instance) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (state_ != other.state_) return false; + if (instanceType_ != other.instanceType_) return false; + if (hasMachineConfig() != other.hasMachineConfig()) return false; + if (hasMachineConfig()) { + if (!getMachineConfig().equals(other.getMachineConfig())) return false; + } + if (availabilityType_ != other.availabilityType_) return false; + if (!getGceZone().equals(other.getGceZone())) return false; + if (!internalGetDatabaseFlags().equals(other.internalGetDatabaseFlags())) return false; + if (hasWritableNode() != other.hasWritableNode()) return false; + if (hasWritableNode()) { + if (!getWritableNode().equals(other.getWritableNode())) return false; + } + if (!getNodesList().equals(other.getNodesList())) return false; + if (hasQueryInsightsConfig() != other.hasQueryInsightsConfig()) return false; + if (hasQueryInsightsConfig()) { + if (!getQueryInsightsConfig().equals(other.getQueryInsightsConfig())) return false; + } + if (hasReadPoolConfig() != other.hasReadPoolConfig()) return false; + if (hasReadPoolConfig()) { + if (!getReadPoolConfig().equals(other.getReadPoolConfig())) return false; + } + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (getReconciling() != other.getReconciling()) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) 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(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + INSTANCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + instanceType_; + if (hasMachineConfig()) { + hash = (37 * hash) + MACHINE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getMachineConfig().hashCode(); + } + hash = (37 * hash) + AVAILABILITY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + availabilityType_; + hash = (37 * hash) + GCE_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getGceZone().hashCode(); + if (!internalGetDatabaseFlags().getMap().isEmpty()) { + hash = (37 * hash) + DATABASE_FLAGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetDatabaseFlags().hashCode(); + } + if (hasWritableNode()) { + hash = (37 * hash) + WRITABLE_NODE_FIELD_NUMBER; + hash = (53 * hash) + getWritableNode().hashCode(); + } + if (getNodesCount() > 0) { + hash = (37 * hash) + NODES_FIELD_NUMBER; + hash = (53 * hash) + getNodesList().hashCode(); + } + if (hasQueryInsightsConfig()) { + hash = (37 * hash) + QUERY_INSIGHTS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getQueryInsightsConfig().hashCode(); + } + if (hasReadPoolConfig()) { + hash = (37 * hash) + READ_POOL_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getReadPoolConfig().hashCode(); + } + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.Instance parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance 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.alloydb.v1alpha.Instance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance 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.alloydb.v1alpha.Instance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Instance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance 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.alloydb.v1alpha.Instance parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance 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.alloydb.v1alpha.Instance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance 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.alloydb.v1alpha.Instance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An Instance is a computing unit that an end customer can connect to.
+   * It's the main unit of computing resources in AlloyDB.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Instance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.Instance) + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + case 13: + return internalGetDatabaseFlags(); + case 18: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableLabels(); + case 13: + return internalGetMutableDatabaseFlags(); + case 18: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Instance.class, + com.google.cloud.alloydb.v1alpha.Instance.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.Instance.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + uid_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + state_ = 0; + instanceType_ = 0; + machineConfig_ = null; + if (machineConfigBuilder_ != null) { + machineConfigBuilder_.dispose(); + machineConfigBuilder_ = null; + } + availabilityType_ = 0; + gceZone_ = ""; + internalGetMutableDatabaseFlags().clear(); + writableNode_ = null; + if (writableNodeBuilder_ != null) { + writableNodeBuilder_.dispose(); + writableNodeBuilder_ = null; + } + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + } else { + nodes_ = null; + nodesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00004000); + queryInsightsConfig_ = null; + if (queryInsightsConfigBuilder_ != null) { + queryInsightsConfigBuilder_.dispose(); + queryInsightsConfigBuilder_ = null; + } + readPoolConfig_ = null; + if (readPoolConfigBuilder_ != null) { + readPoolConfigBuilder_.dispose(); + readPoolConfigBuilder_ = null; + } + ipAddress_ = ""; + reconciling_ = false; + etag_ = ""; + internalGetMutableAnnotations().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance build() { + com.google.cloud.alloydb.v1alpha.Instance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance buildPartial() { + com.google.cloud.alloydb.v1alpha.Instance result = + new com.google.cloud.alloydb.v1alpha.Instance(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.alloydb.v1alpha.Instance result) { + if (nodesBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0)) { + nodes_ = java.util.Collections.unmodifiableList(nodes_); + bitField0_ = (bitField0_ & ~0x00004000); + } + result.nodes_ = nodes_; + } else { + result.nodes_ = nodesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.Instance result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.instanceType_ = instanceType_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.machineConfig_ = + machineConfigBuilder_ == null ? machineConfig_ : machineConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.availabilityType_ = availabilityType_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.gceZone_ = gceZone_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.databaseFlags_ = internalGetDatabaseFlags(); + result.databaseFlags_.makeImmutable(); + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.writableNode_ = + writableNodeBuilder_ == null ? writableNode_ : writableNodeBuilder_.build(); + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.queryInsightsConfig_ = + queryInsightsConfigBuilder_ == null + ? queryInsightsConfig_ + : queryInsightsConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.readPoolConfig_ = + readPoolConfigBuilder_ == null ? readPoolConfig_ : readPoolConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.ipAddress_ = ipAddress_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + } + + @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.alloydb.v1alpha.Instance) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.Instance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.Instance other) { + if (other == com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000040; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.instanceType_ != 0) { + setInstanceTypeValue(other.getInstanceTypeValue()); + } + if (other.hasMachineConfig()) { + mergeMachineConfig(other.getMachineConfig()); + } + if (other.availabilityType_ != 0) { + setAvailabilityTypeValue(other.getAvailabilityTypeValue()); + } + if (!other.getGceZone().isEmpty()) { + gceZone_ = other.gceZone_; + bitField0_ |= 0x00000800; + onChanged(); + } + internalGetMutableDatabaseFlags().mergeFrom(other.internalGetDatabaseFlags()); + bitField0_ |= 0x00001000; + if (other.hasWritableNode()) { + mergeWritableNode(other.getWritableNode()); + } + if (nodesBuilder_ == null) { + if (!other.nodes_.isEmpty()) { + if (nodes_.isEmpty()) { + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00004000); + } else { + ensureNodesIsMutable(); + nodes_.addAll(other.nodes_); + } + onChanged(); + } + } else { + if (!other.nodes_.isEmpty()) { + if (nodesBuilder_.isEmpty()) { + nodesBuilder_.dispose(); + nodesBuilder_ = null; + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00004000); + nodesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNodesFieldBuilder() + : null; + } else { + nodesBuilder_.addAllMessages(other.nodes_); + } + } + } + if (other.hasQueryInsightsConfig()) { + mergeQueryInsightsConfig(other.getQueryInsightsConfig()); + } + if (other.hasReadPoolConfig()) { + mergeReadPoolConfig(other.getReadPoolConfig()); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + bitField0_ |= 0x00020000; + onChanged(); + } + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00080000; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00100000; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: + { + instanceType_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 82: + { + input.readMessage(getMachineConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 88: + { + availabilityType_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 98: + { + gceZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 106: + { + com.google.protobuf.MapEntry databaseFlags__ = + input.readMessage( + DatabaseFlagsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableDatabaseFlags() + .getMutableMap() + .put(databaseFlags__.getKey(), databaseFlags__.getValue()); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 114: + { + input.readMessage(getReadPoolConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 114 + case 122: + { + ipAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00020000; + break; + } // case 122 + case 128: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00040000; + break; + } // case 128 + case 138: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00080000; + break; + } // case 138 + case 146: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00100000; + break; + } // case 146 + case 154: + { + input.readMessage(getWritableNodeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 154 + case 162: + { + com.google.cloud.alloydb.v1alpha.Instance.Node m = + input.readMessage( + com.google.cloud.alloydb.v1alpha.Instance.Node.parser(), extensionRegistry); + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(m); + } else { + nodesBuilder_.addMessage(m); + } + break; + } // case 162 + case 170: + { + input.readMessage( + getQueryInsightsConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00008000; + break; + } // case 170 + 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_ = ""; + /** + * + * + *
+     * Output only. The name of the instance resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+     * where the cluster and instance ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the instance resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the instance resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+     * where the cluster and instance ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the instance resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the instance resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+     * where the cluster and instance ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the instance resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the instance resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+     * where the cluster and instance ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the instance resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the instance resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+     * where the cluster and instance ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the instance resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * User-settable and human-readable display name for the Instance.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Instance.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Instance.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Instance.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Instance.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + 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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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 deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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; + } else { + deleteTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); + } else { + deleteTime_ = value; + } + } else { + deleteTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + bitField0_ = (bitField0_ & ~0x00000020); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_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> + 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_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000040; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000040; + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current serving state of the instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current serving state of the instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current serving state of the instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.State getState() { + com.google.cloud.alloydb.v1alpha.Instance.State result = + com.google.cloud.alloydb.v1alpha.Instance.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1alpha.Instance.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current serving state of the instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.alloydb.v1alpha.Instance.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current serving state of the instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000080); + state_ = 0; + onChanged(); + return this; + } + + private int instanceType_ = 0; + /** + * + * + *
+     * Required. The type of the instance. Specified at creation time.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for instanceType. + */ + @java.lang.Override + public int getInstanceTypeValue() { + return instanceType_; + } + /** + * + * + *
+     * Required. The type of the instance. Specified at creation time.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for instanceType to set. + * @return This builder for chaining. + */ + public Builder setInstanceTypeValue(int value) { + instanceType_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of the instance. Specified at creation time.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instanceType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.InstanceType getInstanceType() { + com.google.cloud.alloydb.v1alpha.Instance.InstanceType result = + com.google.cloud.alloydb.v1alpha.Instance.InstanceType.forNumber(instanceType_); + return result == null + ? com.google.cloud.alloydb.v1alpha.Instance.InstanceType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The type of the instance. Specified at creation time.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The instanceType to set. + * @return This builder for chaining. + */ + public Builder setInstanceType(com.google.cloud.alloydb.v1alpha.Instance.InstanceType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + instanceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of the instance. Specified at creation time.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearInstanceType() { + bitField0_ = (bitField0_ & ~0x00000100); + instanceType_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1alpha.Instance.MachineConfig machineConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig, + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.Builder, + com.google.cloud.alloydb.v1alpha.Instance.MachineConfigOrBuilder> + machineConfigBuilder_; + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + * + * @return Whether the machineConfig field is set. + */ + public boolean hasMachineConfig() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + * + * @return The machineConfig. + */ + public com.google.cloud.alloydb.v1alpha.Instance.MachineConfig getMachineConfig() { + if (machineConfigBuilder_ == null) { + return machineConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.getDefaultInstance() + : machineConfig_; + } else { + return machineConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + */ + public Builder setMachineConfig(com.google.cloud.alloydb.v1alpha.Instance.MachineConfig value) { + if (machineConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + machineConfig_ = value; + } else { + machineConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + */ + public Builder setMachineConfig( + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.Builder builderForValue) { + if (machineConfigBuilder_ == null) { + machineConfig_ = builderForValue.build(); + } else { + machineConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + */ + public Builder mergeMachineConfig( + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig value) { + if (machineConfigBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && machineConfig_ != null + && machineConfig_ + != com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.getDefaultInstance()) { + getMachineConfigBuilder().mergeFrom(value); + } else { + machineConfig_ = value; + } + } else { + machineConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + */ + public Builder clearMachineConfig() { + bitField0_ = (bitField0_ & ~0x00000200); + machineConfig_ = null; + if (machineConfigBuilder_ != null) { + machineConfigBuilder_.dispose(); + machineConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + */ + public com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.Builder + getMachineConfigBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getMachineConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + */ + public com.google.cloud.alloydb.v1alpha.Instance.MachineConfigOrBuilder + getMachineConfigOrBuilder() { + if (machineConfigBuilder_ != null) { + return machineConfigBuilder_.getMessageOrBuilder(); + } else { + return machineConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.getDefaultInstance() + : machineConfig_; + } + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig, + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.Builder, + com.google.cloud.alloydb.v1alpha.Instance.MachineConfigOrBuilder> + getMachineConfigFieldBuilder() { + if (machineConfigBuilder_ == null) { + machineConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig, + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig.Builder, + com.google.cloud.alloydb.v1alpha.Instance.MachineConfigOrBuilder>( + getMachineConfig(), getParentForChildren(), isClean()); + machineConfig_ = null; + } + return machineConfigBuilder_; + } + + private int availabilityType_ = 0; + /** + * + * + *
+     * Availability type of an Instance.
+     * Defaults to REGIONAL for both primary and read instances.
+     * Note that primary and read instances can have different availability types.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; + * + * @return The enum numeric value on the wire for availabilityType. + */ + @java.lang.Override + public int getAvailabilityTypeValue() { + return availabilityType_; + } + /** + * + * + *
+     * Availability type of an Instance.
+     * Defaults to REGIONAL for both primary and read instances.
+     * Note that primary and read instances can have different availability types.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; + * + * @param value The enum numeric value on the wire for availabilityType to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityTypeValue(int value) { + availabilityType_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Availability type of an Instance.
+     * Defaults to REGIONAL for both primary and read instances.
+     * Note that primary and read instances can have different availability types.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; + * + * @return The availabilityType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.AvailabilityType getAvailabilityType() { + com.google.cloud.alloydb.v1alpha.Instance.AvailabilityType result = + com.google.cloud.alloydb.v1alpha.Instance.AvailabilityType.forNumber(availabilityType_); + return result == null + ? com.google.cloud.alloydb.v1alpha.Instance.AvailabilityType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Availability type of an Instance.
+     * Defaults to REGIONAL for both primary and read instances.
+     * Note that primary and read instances can have different availability types.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; + * + * @param value The availabilityType to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityType( + com.google.cloud.alloydb.v1alpha.Instance.AvailabilityType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + availabilityType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Availability type of an Instance.
+     * Defaults to REGIONAL for both primary and read instances.
+     * Note that primary and read instances can have different availability types.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; + * + * @return This builder for chaining. + */ + public Builder clearAvailabilityType() { + bitField0_ = (bitField0_ & ~0x00000400); + availabilityType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object gceZone_ = ""; + /** + * + * + *
+     * The Compute Engine zone that the instance should serve from, per
+     * https://cloud.google.com/compute/docs/regions-zones
+     * This can ONLY be specified for ZONAL instances.
+     * If present for a REGIONAL instance, an error will be thrown.
+     * If this is absent for a ZONAL instance, instance is created in a random
+     * zone with available capacity.
+     * 
+ * + * string gce_zone = 12; + * + * @return The gceZone. + */ + public java.lang.String getGceZone() { + java.lang.Object ref = gceZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gceZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Compute Engine zone that the instance should serve from, per
+     * https://cloud.google.com/compute/docs/regions-zones
+     * This can ONLY be specified for ZONAL instances.
+     * If present for a REGIONAL instance, an error will be thrown.
+     * If this is absent for a ZONAL instance, instance is created in a random
+     * zone with available capacity.
+     * 
+ * + * string gce_zone = 12; + * + * @return The bytes for gceZone. + */ + public com.google.protobuf.ByteString getGceZoneBytes() { + java.lang.Object ref = gceZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Compute Engine zone that the instance should serve from, per
+     * https://cloud.google.com/compute/docs/regions-zones
+     * This can ONLY be specified for ZONAL instances.
+     * If present for a REGIONAL instance, an error will be thrown.
+     * If this is absent for a ZONAL instance, instance is created in a random
+     * zone with available capacity.
+     * 
+ * + * string gce_zone = 12; + * + * @param value The gceZone to set. + * @return This builder for chaining. + */ + public Builder setGceZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + gceZone_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * The Compute Engine zone that the instance should serve from, per
+     * https://cloud.google.com/compute/docs/regions-zones
+     * This can ONLY be specified for ZONAL instances.
+     * If present for a REGIONAL instance, an error will be thrown.
+     * If this is absent for a ZONAL instance, instance is created in a random
+     * zone with available capacity.
+     * 
+ * + * string gce_zone = 12; + * + * @return This builder for chaining. + */ + public Builder clearGceZone() { + gceZone_ = getDefaultInstance().getGceZone(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+     * The Compute Engine zone that the instance should serve from, per
+     * https://cloud.google.com/compute/docs/regions-zones
+     * This can ONLY be specified for ZONAL instances.
+     * If present for a REGIONAL instance, an error will be thrown.
+     * If this is absent for a ZONAL instance, instance is created in a random
+     * zone with available capacity.
+     * 
+ * + * string gce_zone = 12; + * + * @param value The bytes for gceZone to set. + * @return This builder for chaining. + */ + public Builder setGceZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + gceZone_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private com.google.protobuf.MapField databaseFlags_; + + private com.google.protobuf.MapField + internalGetDatabaseFlags() { + if (databaseFlags_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DatabaseFlagsDefaultEntryHolder.defaultEntry); + } + return databaseFlags_; + } + + private com.google.protobuf.MapField + internalGetMutableDatabaseFlags() { + if (databaseFlags_ == null) { + databaseFlags_ = + com.google.protobuf.MapField.newMapField(DatabaseFlagsDefaultEntryHolder.defaultEntry); + } + if (!databaseFlags_.isMutable()) { + databaseFlags_ = databaseFlags_.copy(); + } + bitField0_ |= 0x00001000; + onChanged(); + return databaseFlags_; + } + + public int getDatabaseFlagsCount() { + return internalGetDatabaseFlags().getMap().size(); + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public boolean containsDatabaseFlags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetDatabaseFlags().getMap().containsKey(key); + } + /** Use {@link #getDatabaseFlagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDatabaseFlags() { + return getDatabaseFlagsMap(); + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public java.util.Map getDatabaseFlagsMap() { + return internalGetDatabaseFlags().getMap(); + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public /* nullable */ java.lang.String getDatabaseFlagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDatabaseFlags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public java.lang.String getDatabaseFlagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDatabaseFlags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearDatabaseFlags() { + bitField0_ = (bitField0_ & ~0x00001000); + internalGetMutableDatabaseFlags().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + public Builder removeDatabaseFlags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableDatabaseFlags().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableDatabaseFlags() { + bitField0_ |= 0x00001000; + return internalGetMutableDatabaseFlags().getMutableMap(); + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + public Builder putDatabaseFlags(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableDatabaseFlags().getMutableMap().put(key, value); + bitField0_ |= 0x00001000; + return this; + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + public Builder putAllDatabaseFlags(java.util.Map values) { + internalGetMutableDatabaseFlags().getMutableMap().putAll(values); + bitField0_ |= 0x00001000; + return this; + } + + private com.google.cloud.alloydb.v1alpha.Instance.Node writableNode_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.Node, + com.google.cloud.alloydb.v1alpha.Instance.Node.Builder, + com.google.cloud.alloydb.v1alpha.Instance.NodeOrBuilder> + writableNodeBuilder_; + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writableNode field is set. + */ + public boolean hasWritableNode() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writableNode. + */ + public com.google.cloud.alloydb.v1alpha.Instance.Node getWritableNode() { + if (writableNodeBuilder_ == null) { + return writableNode_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.Node.getDefaultInstance() + : writableNode_; + } else { + return writableNodeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setWritableNode(com.google.cloud.alloydb.v1alpha.Instance.Node value) { + if (writableNodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + writableNode_ = value; + } else { + writableNodeBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setWritableNode( + com.google.cloud.alloydb.v1alpha.Instance.Node.Builder builderForValue) { + if (writableNodeBuilder_ == null) { + writableNode_ = builderForValue.build(); + } else { + writableNodeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeWritableNode(com.google.cloud.alloydb.v1alpha.Instance.Node value) { + if (writableNodeBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && writableNode_ != null + && writableNode_ + != com.google.cloud.alloydb.v1alpha.Instance.Node.getDefaultInstance()) { + getWritableNodeBuilder().mergeFrom(value); + } else { + writableNode_ = value; + } + } else { + writableNodeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearWritableNode() { + bitField0_ = (bitField0_ & ~0x00002000); + writableNode_ = null; + if (writableNodeBuilder_ != null) { + writableNodeBuilder_.dispose(); + writableNodeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.Instance.Node.Builder getWritableNodeBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getWritableNodeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.Instance.NodeOrBuilder getWritableNodeOrBuilder() { + if (writableNodeBuilder_ != null) { + return writableNodeBuilder_.getMessageOrBuilder(); + } else { + return writableNode_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.Node.getDefaultInstance() + : writableNode_; + } + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.Node, + com.google.cloud.alloydb.v1alpha.Instance.Node.Builder, + com.google.cloud.alloydb.v1alpha.Instance.NodeOrBuilder> + getWritableNodeFieldBuilder() { + if (writableNodeBuilder_ == null) { + writableNodeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.Node, + com.google.cloud.alloydb.v1alpha.Instance.Node.Builder, + com.google.cloud.alloydb.v1alpha.Instance.NodeOrBuilder>( + getWritableNode(), getParentForChildren(), isClean()); + writableNode_ = null; + } + return writableNodeBuilder_; + } + + private java.util.List nodes_ = + java.util.Collections.emptyList(); + + private void ensureNodesIsMutable() { + if (!((bitField0_ & 0x00004000) != 0)) { + nodes_ = new java.util.ArrayList(nodes_); + bitField0_ |= 0x00004000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.Node, + com.google.cloud.alloydb.v1alpha.Instance.Node.Builder, + com.google.cloud.alloydb.v1alpha.Instance.NodeOrBuilder> + nodesBuilder_; + + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getNodesList() { + if (nodesBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodes_); + } else { + return nodesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getNodesCount() { + if (nodesBuilder_ == null) { + return nodes_.size(); + } else { + return nodesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.Instance.Node getNodes(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodes(int index, com.google.cloud.alloydb.v1alpha.Instance.Node value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.set(index, value); + onChanged(); + } else { + nodesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodes( + int index, com.google.cloud.alloydb.v1alpha.Instance.Node.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.set(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes(com.google.cloud.alloydb.v1alpha.Instance.Node value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(value); + onChanged(); + } else { + nodesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes(int index, com.google.cloud.alloydb.v1alpha.Instance.Node value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(index, value); + onChanged(); + } else { + nodesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + com.google.cloud.alloydb.v1alpha.Instance.Node.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + int index, com.google.cloud.alloydb.v1alpha.Instance.Node.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllNodes( + java.lang.Iterable values) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, nodes_); + onChanged(); + } else { + nodesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearNodes() { + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + } else { + nodesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeNodes(int index) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.remove(index); + onChanged(); + } else { + nodesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.Instance.Node.Builder getNodesBuilder(int index) { + return getNodesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.Instance.NodeOrBuilder getNodesOrBuilder(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getNodesOrBuilderList() { + if (nodesBuilder_ != null) { + return nodesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodes_); + } + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.Instance.Node.Builder addNodesBuilder() { + return getNodesFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1alpha.Instance.Node.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.Instance.Node.Builder addNodesBuilder(int index) { + return getNodesFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1alpha.Instance.Node.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getNodesBuilderList() { + return getNodesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.Node, + com.google.cloud.alloydb.v1alpha.Instance.Node.Builder, + com.google.cloud.alloydb.v1alpha.Instance.NodeOrBuilder> + getNodesFieldBuilder() { + if (nodesBuilder_ == null) { + nodesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.Node, + com.google.cloud.alloydb.v1alpha.Instance.Node.Builder, + com.google.cloud.alloydb.v1alpha.Instance.NodeOrBuilder>( + nodes_, ((bitField0_ & 0x00004000) != 0), getParentForChildren(), isClean()); + nodes_ = null; + } + return nodesBuilder_; + } + + private com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + queryInsightsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig, + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.Builder, + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfigOrBuilder> + queryInsightsConfigBuilder_; + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return Whether the queryInsightsConfig field is set. + */ + public boolean hasQueryInsightsConfig() { + return ((bitField0_ & 0x00008000) != 0); + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return The queryInsightsConfig. + */ + public com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + getQueryInsightsConfig() { + if (queryInsightsConfigBuilder_ == null) { + return queryInsightsConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + .getDefaultInstance() + : queryInsightsConfig_; + } else { + return queryInsightsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public Builder setQueryInsightsConfig( + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig value) { + if (queryInsightsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryInsightsConfig_ = value; + } else { + queryInsightsConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public Builder setQueryInsightsConfig( + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.Builder + builderForValue) { + if (queryInsightsConfigBuilder_ == null) { + queryInsightsConfig_ = builderForValue.build(); + } else { + queryInsightsConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public Builder mergeQueryInsightsConfig( + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig value) { + if (queryInsightsConfigBuilder_ == null) { + if (((bitField0_ & 0x00008000) != 0) + && queryInsightsConfig_ != null + && queryInsightsConfig_ + != com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + .getDefaultInstance()) { + getQueryInsightsConfigBuilder().mergeFrom(value); + } else { + queryInsightsConfig_ = value; + } + } else { + queryInsightsConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public Builder clearQueryInsightsConfig() { + bitField0_ = (bitField0_ & ~0x00008000); + queryInsightsConfig_ = null; + if (queryInsightsConfigBuilder_ != null) { + queryInsightsConfigBuilder_.dispose(); + queryInsightsConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.Builder + getQueryInsightsConfigBuilder() { + bitField0_ |= 0x00008000; + onChanged(); + return getQueryInsightsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfigOrBuilder + getQueryInsightsConfigOrBuilder() { + if (queryInsightsConfigBuilder_ != null) { + return queryInsightsConfigBuilder_.getMessageOrBuilder(); + } else { + return queryInsightsConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + .getDefaultInstance() + : queryInsightsConfig_; + } + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig, + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.Builder, + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfigOrBuilder> + getQueryInsightsConfigFieldBuilder() { + if (queryInsightsConfigBuilder_ == null) { + queryInsightsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig, + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.Builder, + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfigOrBuilder>( + getQueryInsightsConfig(), getParentForChildren(), isClean()); + queryInsightsConfig_ = null; + } + return queryInsightsConfigBuilder_; + } + + private com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig readPoolConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig, + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.Builder, + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfigOrBuilder> + readPoolConfigBuilder_; + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return Whether the readPoolConfig field is set. + */ + public boolean hasReadPoolConfig() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return The readPoolConfig. + */ + public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig getReadPoolConfig() { + if (readPoolConfigBuilder_ == null) { + return readPoolConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.getDefaultInstance() + : readPoolConfig_; + } else { + return readPoolConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + */ + public Builder setReadPoolConfig( + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig value) { + if (readPoolConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readPoolConfig_ = value; + } else { + readPoolConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + */ + public Builder setReadPoolConfig( + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.Builder builderForValue) { + if (readPoolConfigBuilder_ == null) { + readPoolConfig_ = builderForValue.build(); + } else { + readPoolConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + */ + public Builder mergeReadPoolConfig( + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig value) { + if (readPoolConfigBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && readPoolConfig_ != null + && readPoolConfig_ + != com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.getDefaultInstance()) { + getReadPoolConfigBuilder().mergeFrom(value); + } else { + readPoolConfig_ = value; + } + } else { + readPoolConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + */ + public Builder clearReadPoolConfig() { + bitField0_ = (bitField0_ & ~0x00010000); + readPoolConfig_ = null; + if (readPoolConfigBuilder_ != null) { + readPoolConfigBuilder_.dispose(); + readPoolConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + */ + public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.Builder + getReadPoolConfigBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return getReadPoolConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + */ + public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfigOrBuilder + getReadPoolConfigOrBuilder() { + if (readPoolConfigBuilder_ != null) { + return readPoolConfigBuilder_.getMessageOrBuilder(); + } else { + return readPoolConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.getDefaultInstance() + : readPoolConfig_; + } + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig, + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.Builder, + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfigOrBuilder> + getReadPoolConfigFieldBuilder() { + if (readPoolConfigBuilder_ == null) { + readPoolConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig, + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.Builder, + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfigOrBuilder>( + getReadPoolConfig(), getParentForChildren(), isClean()); + readPoolConfig_ = null; + } + return readPoolConfigBuilder_; + } + + private java.lang.Object ipAddress_ = ""; + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ipAddress_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + ipAddress_ = getDefaultInstance().getIpAddress(); + bitField0_ = (bitField0_ & ~0x00020000); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ipAddress_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Instance does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Instance does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Instance does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00040000); + reconciling_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 17; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 17; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 17; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 17; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00080000); + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 17; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00100000; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00100000); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00100000; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00100000; + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00100000; + 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.alloydb.v1alpha.Instance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.Instance) + private static final com.google.cloud.alloydb.v1alpha.Instance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.Instance(); + } + + public static com.google.cloud.alloydb.v1alpha.Instance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Instance 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.alloydb.v1alpha.Instance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceName.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceName.java new file mode 100644 index 000000000000..60974a89895e --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceName.java @@ -0,0 +1,259 @@ +/* + * 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.alloydb.v1alpha; + +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 InstanceName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CLUSTER_INSTANCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String cluster; + private final String instance; + + @Deprecated + protected InstanceName() { + project = null; + location = null; + cluster = null; + instance = null; + } + + private InstanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + cluster = Preconditions.checkNotNull(builder.getCluster()); + instance = Preconditions.checkNotNull(builder.getInstance()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public String getInstance() { + return instance; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static InstanceName of(String project, String location, String cluster, String instance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCluster(cluster) + .setInstance(instance) + .build(); + } + + public static String format(String project, String location, String cluster, String instance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCluster(cluster) + .setInstance(instance) + .build() + .toString(); + } + + public static InstanceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CLUSTER_INSTANCE.validatedMatch( + formattedString, "InstanceName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("cluster"), + matchMap.get("instance")); + } + + 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 (InstanceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CLUSTER_INSTANCE.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 (cluster != null) { + fieldMapBuilder.put("cluster", cluster); + } + if (instance != null) { + fieldMapBuilder.put("instance", instance); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CLUSTER_INSTANCE.instantiate( + "project", project, "location", location, "cluster", cluster, "instance", instance); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + InstanceName that = ((InstanceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.cluster, that.cluster) + && Objects.equals(this.instance, that.instance); + } + 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(cluster); + h *= 1000003; + h ^= Objects.hashCode(instance); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}. + */ + public static class Builder { + private String project; + private String location; + private String cluster; + private String instance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public String getInstance() { + return instance; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCluster(String cluster) { + this.cluster = cluster; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + private Builder(InstanceName instanceName) { + this.project = instanceName.project; + this.location = instanceName.location; + this.cluster = instanceName.cluster; + this.instance = instanceName.instance; + } + + public InstanceName build() { + return new InstanceName(this); + } + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceOrBuilder.java new file mode 100644 index 000000000000..635d695beb3f --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceOrBuilder.java @@ -0,0 +1,888 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface InstanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.Instance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The name of the instance resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+   * where the cluster and instance ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the instance resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The name of the instance resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+   * where the cluster and instance ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the instance resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * User-settable and human-readable display name for the Instance.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * User-settable and human-readable display name for the Instance.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The current serving state of the instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current serving state of the instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.alloydb.v1alpha.Instance.State getState(); + + /** + * + * + *
+   * Required. The type of the instance. Specified at creation time.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for instanceType. + */ + int getInstanceTypeValue(); + /** + * + * + *
+   * Required. The type of the instance. Specified at creation time.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instanceType. + */ + com.google.cloud.alloydb.v1alpha.Instance.InstanceType getInstanceType(); + + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + * + * @return Whether the machineConfig field is set. + */ + boolean hasMachineConfig(); + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + * + * @return The machineConfig. + */ + com.google.cloud.alloydb.v1alpha.Instance.MachineConfig getMachineConfig(); + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + */ + com.google.cloud.alloydb.v1alpha.Instance.MachineConfigOrBuilder getMachineConfigOrBuilder(); + + /** + * + * + *
+   * Availability type of an Instance.
+   * Defaults to REGIONAL for both primary and read instances.
+   * Note that primary and read instances can have different availability types.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; + * + * @return The enum numeric value on the wire for availabilityType. + */ + int getAvailabilityTypeValue(); + /** + * + * + *
+   * Availability type of an Instance.
+   * Defaults to REGIONAL for both primary and read instances.
+   * Note that primary and read instances can have different availability types.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; + * + * @return The availabilityType. + */ + com.google.cloud.alloydb.v1alpha.Instance.AvailabilityType getAvailabilityType(); + + /** + * + * + *
+   * The Compute Engine zone that the instance should serve from, per
+   * https://cloud.google.com/compute/docs/regions-zones
+   * This can ONLY be specified for ZONAL instances.
+   * If present for a REGIONAL instance, an error will be thrown.
+   * If this is absent for a ZONAL instance, instance is created in a random
+   * zone with available capacity.
+   * 
+ * + * string gce_zone = 12; + * + * @return The gceZone. + */ + java.lang.String getGceZone(); + /** + * + * + *
+   * The Compute Engine zone that the instance should serve from, per
+   * https://cloud.google.com/compute/docs/regions-zones
+   * This can ONLY be specified for ZONAL instances.
+   * If present for a REGIONAL instance, an error will be thrown.
+   * If this is absent for a ZONAL instance, instance is created in a random
+   * zone with available capacity.
+   * 
+ * + * string gce_zone = 12; + * + * @return The bytes for gceZone. + */ + com.google.protobuf.ByteString getGceZoneBytes(); + + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + int getDatabaseFlagsCount(); + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + boolean containsDatabaseFlags(java.lang.String key); + /** Use {@link #getDatabaseFlagsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getDatabaseFlags(); + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + java.util.Map getDatabaseFlagsMap(); + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + /* nullable */ + java.lang.String getDatabaseFlagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + java.lang.String getDatabaseFlagsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writableNode field is set. + */ + boolean hasWritableNode(); + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writableNode. + */ + com.google.cloud.alloydb.v1alpha.Instance.Node getWritableNode(); + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1alpha.Instance.NodeOrBuilder getWritableNodeOrBuilder(); + + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getNodesList(); + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1alpha.Instance.Node getNodes(int index); + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getNodesCount(); + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getNodesOrBuilderList(); + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1alpha.Instance.NodeOrBuilder getNodesOrBuilder(int index); + + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return Whether the queryInsightsConfig field is set. + */ + boolean hasQueryInsightsConfig(); + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return The queryInsightsConfig. + */ + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig getQueryInsightsConfig(); + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + com.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfigOrBuilder + getQueryInsightsConfigOrBuilder(); + + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return Whether the readPoolConfig field is set. + */ + boolean hasReadPoolConfig(); + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return The readPoolConfig. + */ + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig getReadPoolConfig(); + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + */ + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfigOrBuilder getReadPoolConfigOrBuilder(); + + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+   * Set to true if the current state of Instance does not match the user's
+   * intended state, and the service is actively updating the resource to
+   * reconcile them. This can happen due to user-triggered updates or
+   * system actions like failover or maintenance.
+   * 
+ * + * bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 17; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 17; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceView.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceView.java new file mode 100644 index 000000000000..83725cd4dceb --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceView.java @@ -0,0 +1,183 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * View on Instance. Pass this enum to rpcs that returns an Instance message to
+ * control which subsets of fields to get.
+ * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.InstanceView} + */ +public enum InstanceView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
+   * 
+ * + * INSTANCE_VIEW_UNSPECIFIED = 0; + */ + INSTANCE_VIEW_UNSPECIFIED(0), + /** + * + * + *
+   * BASIC server responses for a primary or read instance include all the
+   * relevant instance details, excluding the details of each node in the
+   * instance. The default value.
+   * 
+ * + * INSTANCE_VIEW_BASIC = 1; + */ + INSTANCE_VIEW_BASIC(1), + /** + * + * + *
+   * FULL response is equivalent to BASIC for primary instance (for now).
+   * For read pool instance, this includes details of each node in the pool.
+   * 
+ * + * INSTANCE_VIEW_FULL = 2; + */ + INSTANCE_VIEW_FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
+   * 
+ * + * INSTANCE_VIEW_UNSPECIFIED = 0; + */ + public static final int INSTANCE_VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * BASIC server responses for a primary or read instance include all the
+   * relevant instance details, excluding the details of each node in the
+   * instance. The default value.
+   * 
+ * + * INSTANCE_VIEW_BASIC = 1; + */ + public static final int INSTANCE_VIEW_BASIC_VALUE = 1; + /** + * + * + *
+   * FULL response is equivalent to BASIC for primary instance (for now).
+   * For read pool instance, this includes details of each node in the pool.
+   * 
+ * + * INSTANCE_VIEW_FULL = 2; + */ + public static final int INSTANCE_VIEW_FULL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static InstanceView 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 InstanceView forNumber(int value) { + switch (value) { + case 0: + return INSTANCE_VIEW_UNSPECIFIED; + case 1: + return INSTANCE_VIEW_BASIC; + case 2: + return INSTANCE_VIEW_FULL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public InstanceView findValueByNumber(int number) { + return InstanceView.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.alloydb.v1alpha.ResourcesProto.getDescriptor().getEnumTypes().get(1); + } + + private static final InstanceView[] VALUES = values(); + + public static InstanceView 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 InstanceView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.InstanceView) +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListBackupsRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListBackupsRequest.java new file mode 100644 index 000000000000..a7e8eaf31f3d --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListBackupsRequest.java @@ -0,0 +1,1286 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for requesting list of Backups
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListBackupsRequest} + */ +public final class ListBackupsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.ListBackupsRequest) + ListBackupsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupsRequest.newBuilder() to construct. + private ListBackupsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupsRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListBackupsRequest.class, + com.google.cloud.alloydb.v1alpha.ListBackupsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value for ListBackupsRequest
+   * 
+ * + * + * 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 value for ListBackupsRequest
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @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; + } + } + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @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; + } + } + + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.alloydb.v1alpha.ListBackupsRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.ListBackupsRequest other = + (com.google.cloud.alloydb.v1alpha.ListBackupsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsRequest 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.alloydb.v1alpha.ListBackupsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsRequest 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.alloydb.v1alpha.ListBackupsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsRequest 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.alloydb.v1alpha.ListBackupsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsRequest 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.alloydb.v1alpha.ListBackupsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsRequest 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.alloydb.v1alpha.ListBackupsRequest 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; + } + /** + * + * + *
+   * Message for requesting list of Backups
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListBackupsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.ListBackupsRequest) + com.google.cloud.alloydb.v1alpha.ListBackupsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListBackupsRequest.class, + com.google.cloud.alloydb.v1alpha.ListBackupsRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.ListBackupsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListBackupsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListBackupsRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.ListBackupsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListBackupsRequest build() { + com.google.cloud.alloydb.v1alpha.ListBackupsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListBackupsRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.ListBackupsRequest result = + new com.google.cloud.alloydb.v1alpha.ListBackupsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.ListBackupsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @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.alloydb.v1alpha.ListBackupsRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.ListBackupsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.ListBackupsRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.ListBackupsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + 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 parent_ = ""; + /** + * + * + *
+     * Required. Parent value for ListBackupsRequest
+     * 
+ * + * + * 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 value for ListBackupsRequest
+     * 
+ * + * + * 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 value for ListBackupsRequest
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListBackupsRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListBackupsRequest
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @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; + } + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @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; + } + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @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; + bitField0_ |= 0x00000010; + 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.alloydb.v1alpha.ListBackupsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.ListBackupsRequest) + private static final com.google.cloud.alloydb.v1alpha.ListBackupsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.ListBackupsRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsRequest 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.alloydb.v1alpha.ListBackupsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListBackupsRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListBackupsRequestOrBuilder.java new file mode 100644 index 000000000000..7681bdd51640 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListBackupsRequestOrBuilder.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/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface ListBackupsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.ListBackupsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value for ListBackupsRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value for ListBackupsRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListBackupsResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListBackupsResponse.java new file mode 100644 index 000000000000..babec71d67fd --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListBackupsResponse.java @@ -0,0 +1,1393 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for response to listing Backups
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListBackupsResponse} + */ +public final class ListBackupsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.ListBackupsResponse) + ListBackupsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupsResponse.newBuilder() to construct. + private ListBackupsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupsResponse() { + backups_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupsResponse(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListBackupsResponse.class, + com.google.cloud.alloydb.v1alpha.ListBackupsResponse.Builder.class); + } + + public static final int BACKUPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List backups_; + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + @java.lang.Override + public java.util.List getBackupsList() { + return backups_; + } + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + @java.lang.Override + public java.util.List + getBackupsOrBuilderList() { + return backups_; + } + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + @java.lang.Override + public int getBackupsCount() { + return backups_.size(); + } + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Backup getBackups(int index) { + return backups_.get(index); + } + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BackupOrBuilder getBackupsOrBuilder(int index) { + return backups_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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 UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.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 < backups_.size(); i++) { + output.writeMessage(1, backups_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(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 < backups_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, backups_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().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.alloydb.v1alpha.ListBackupsResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.ListBackupsResponse other = + (com.google.cloud.alloydb.v1alpha.ListBackupsResponse) obj; + + if (!getBackupsList().equals(other.getBackupsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) 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 (getBackupsCount() > 0) { + hash = (37 * hash) + BACKUPS_FIELD_NUMBER; + hash = (53 * hash) + getBackupsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsResponse 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.alloydb.v1alpha.ListBackupsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsResponse 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.alloydb.v1alpha.ListBackupsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsResponse 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.alloydb.v1alpha.ListBackupsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsResponse 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.alloydb.v1alpha.ListBackupsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsResponse 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.alloydb.v1alpha.ListBackupsResponse 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; + } + /** + * + * + *
+   * Message for response to listing Backups
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListBackupsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.ListBackupsResponse) + com.google.cloud.alloydb.v1alpha.ListBackupsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListBackupsResponse.class, + com.google.cloud.alloydb.v1alpha.ListBackupsResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.ListBackupsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + } else { + backups_ = null; + backupsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListBackupsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListBackupsResponse getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.ListBackupsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListBackupsResponse build() { + com.google.cloud.alloydb.v1alpha.ListBackupsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListBackupsResponse buildPartial() { + com.google.cloud.alloydb.v1alpha.ListBackupsResponse result = + new com.google.cloud.alloydb.v1alpha.ListBackupsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.ListBackupsResponse result) { + if (backupsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + backups_ = java.util.Collections.unmodifiableList(backups_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.backups_ = backups_; + } else { + result.backups_ = backupsBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.ListBackupsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.alloydb.v1alpha.ListBackupsResponse) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.ListBackupsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.ListBackupsResponse other) { + if (other == com.google.cloud.alloydb.v1alpha.ListBackupsResponse.getDefaultInstance()) + return this; + if (backupsBuilder_ == null) { + if (!other.backups_.isEmpty()) { + if (backups_.isEmpty()) { + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBackupsIsMutable(); + backups_.addAll(other.backups_); + } + onChanged(); + } + } else { + if (!other.backups_.isEmpty()) { + if (backupsBuilder_.isEmpty()) { + backupsBuilder_.dispose(); + backupsBuilder_ = null; + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + backupsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBackupsFieldBuilder() + : null; + } else { + backupsBuilder_.addAllMessages(other.backups_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.alloydb.v1alpha.Backup m = + input.readMessage( + com.google.cloud.alloydb.v1alpha.Backup.parser(), extensionRegistry); + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(m); + } else { + backupsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + 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 backups_ = + java.util.Collections.emptyList(); + + private void ensureBackupsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + backups_ = new java.util.ArrayList(backups_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Backup, + com.google.cloud.alloydb.v1alpha.Backup.Builder, + com.google.cloud.alloydb.v1alpha.BackupOrBuilder> + backupsBuilder_; + + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public java.util.List getBackupsList() { + if (backupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(backups_); + } else { + return backupsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public int getBackupsCount() { + if (backupsBuilder_ == null) { + return backups_.size(); + } else { + return backupsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public com.google.cloud.alloydb.v1alpha.Backup getBackups(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public Builder setBackups(int index, com.google.cloud.alloydb.v1alpha.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.set(index, value); + onChanged(); + } else { + backupsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public Builder setBackups( + int index, com.google.cloud.alloydb.v1alpha.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.set(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public Builder addBackups(com.google.cloud.alloydb.v1alpha.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(value); + onChanged(); + } else { + backupsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public Builder addBackups(int index, com.google.cloud.alloydb.v1alpha.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(index, value); + onChanged(); + } else { + backupsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public Builder addBackups(com.google.cloud.alloydb.v1alpha.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public Builder addBackups( + int index, com.google.cloud.alloydb.v1alpha.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public Builder addAllBackups( + java.lang.Iterable values) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, backups_); + onChanged(); + } else { + backupsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public Builder clearBackups() { + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + backupsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public Builder removeBackups(int index) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.remove(index); + onChanged(); + } else { + backupsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public com.google.cloud.alloydb.v1alpha.Backup.Builder getBackupsBuilder(int index) { + return getBackupsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public com.google.cloud.alloydb.v1alpha.BackupOrBuilder getBackupsOrBuilder(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public java.util.List + getBackupsOrBuilderList() { + if (backupsBuilder_ != null) { + return backupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(backups_); + } + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public com.google.cloud.alloydb.v1alpha.Backup.Builder addBackupsBuilder() { + return getBackupsFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1alpha.Backup.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public com.google.cloud.alloydb.v1alpha.Backup.Builder addBackupsBuilder(int index) { + return getBackupsFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1alpha.Backup.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + public java.util.List getBackupsBuilderList() { + return getBackupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Backup, + com.google.cloud.alloydb.v1alpha.Backup.Builder, + com.google.cloud.alloydb.v1alpha.BackupOrBuilder> + getBackupsFieldBuilder() { + if (backupsBuilder_ == null) { + backupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Backup, + com.google.cloud.alloydb.v1alpha.Backup.Builder, + com.google.cloud.alloydb.v1alpha.BackupOrBuilder>( + backups_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + backups_ = null; + } + return backupsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.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.alloydb.v1alpha.ListBackupsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.ListBackupsResponse) + private static final com.google.cloud.alloydb.v1alpha.ListBackupsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.ListBackupsResponse(); + } + + public static com.google.cloud.alloydb.v1alpha.ListBackupsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsResponse 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.alloydb.v1alpha.ListBackupsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListBackupsResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListBackupsResponseOrBuilder.java new file mode 100644 index 000000000000..7e1860f5b805 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListBackupsResponseOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface ListBackupsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.ListBackupsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + java.util.List getBackupsList(); + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + com.google.cloud.alloydb.v1alpha.Backup getBackups(int index); + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + int getBackupsCount(); + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + java.util.List + getBackupsOrBuilderList(); + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + com.google.cloud.alloydb.v1alpha.BackupOrBuilder getBackupsOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListClustersRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListClustersRequest.java new file mode 100644 index 000000000000..1bd9d2f0f854 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListClustersRequest.java @@ -0,0 +1,1307 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for requesting list of Clusters
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListClustersRequest} + */ +public final class ListClustersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.ListClustersRequest) + ListClustersRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListClustersRequest.newBuilder() to construct. + private ListClustersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListClustersRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListClustersRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListClustersRequest.class, + com.google.cloud.alloydb.v1alpha.ListClustersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with the following format:
+   *  * projects/{project}/locations/-
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Cluster.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with the following format:
+   *  * projects/{project}/locations/-
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.alloydb.v1alpha.ListClustersRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.ListClustersRequest other = + (com.google.cloud.alloydb.v1alpha.ListClustersRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersRequest 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.alloydb.v1alpha.ListClustersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersRequest 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.alloydb.v1alpha.ListClustersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersRequest 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.alloydb.v1alpha.ListClustersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersRequest 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.alloydb.v1alpha.ListClustersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersRequest 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.alloydb.v1alpha.ListClustersRequest 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; + } + /** + * + * + *
+   * Message for requesting list of Clusters
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListClustersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.ListClustersRequest) + com.google.cloud.alloydb.v1alpha.ListClustersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListClustersRequest.class, + com.google.cloud.alloydb.v1alpha.ListClustersRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.ListClustersRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListClustersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListClustersRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.ListClustersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListClustersRequest build() { + com.google.cloud.alloydb.v1alpha.ListClustersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListClustersRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.ListClustersRequest result = + new com.google.cloud.alloydb.v1alpha.ListClustersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.ListClustersRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @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.alloydb.v1alpha.ListClustersRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.ListClustersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.ListClustersRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.ListClustersRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + 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 parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with the following format:
+     *  * projects/{project}/locations/-
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with the following format:
+     *  * projects/{project}/locations/-
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with the following format:
+     *  * projects/{project}/locations/-
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with the following format:
+     *  * projects/{project}/locations/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with the following format:
+     *  * projects/{project}/locations/-
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000010; + 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.alloydb.v1alpha.ListClustersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.ListClustersRequest) + private static final com.google.cloud.alloydb.v1alpha.ListClustersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.ListClustersRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListClustersRequest 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.alloydb.v1alpha.ListClustersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListClustersRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListClustersRequestOrBuilder.java new file mode 100644 index 000000000000..1ff6127b1b3b --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListClustersRequestOrBuilder.java @@ -0,0 +1,149 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface ListClustersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.ListClustersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with the following format:
+   *  * projects/{project}/locations/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with the following format:
+   *  * projects/{project}/locations/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListClustersResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListClustersResponse.java new file mode 100644 index 000000000000..4cfdd01b17e3 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListClustersResponse.java @@ -0,0 +1,1395 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for response to listing Clusters
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListClustersResponse} + */ +public final class ListClustersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.ListClustersResponse) + ListClustersResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListClustersResponse.newBuilder() to construct. + private ListClustersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListClustersResponse() { + clusters_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListClustersResponse(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListClustersResponse.class, + com.google.cloud.alloydb.v1alpha.ListClustersResponse.Builder.class); + } + + public static final int CLUSTERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List clusters_; + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + @java.lang.Override + public java.util.List getClustersList() { + return clusters_; + } + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + @java.lang.Override + public java.util.List + getClustersOrBuilderList() { + return clusters_; + } + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + @java.lang.Override + public int getClustersCount() { + return clusters_.size(); + } + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster getClusters(int index) { + return clusters_.get(index); + } + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ClusterOrBuilder getClustersOrBuilder(int index) { + return clusters_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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 UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.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 < clusters_.size(); i++) { + output.writeMessage(1, clusters_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(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 < clusters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, clusters_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().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.alloydb.v1alpha.ListClustersResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.ListClustersResponse other = + (com.google.cloud.alloydb.v1alpha.ListClustersResponse) obj; + + if (!getClustersList().equals(other.getClustersList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) 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 (getClustersCount() > 0) { + hash = (37 * hash) + CLUSTERS_FIELD_NUMBER; + hash = (53 * hash) + getClustersList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersResponse 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.alloydb.v1alpha.ListClustersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersResponse 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.alloydb.v1alpha.ListClustersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersResponse 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.alloydb.v1alpha.ListClustersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersResponse 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.alloydb.v1alpha.ListClustersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersResponse 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.alloydb.v1alpha.ListClustersResponse 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; + } + /** + * + * + *
+   * Message for response to listing Clusters
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListClustersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.ListClustersResponse) + com.google.cloud.alloydb.v1alpha.ListClustersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListClustersResponse.class, + com.google.cloud.alloydb.v1alpha.ListClustersResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.ListClustersResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (clustersBuilder_ == null) { + clusters_ = java.util.Collections.emptyList(); + } else { + clusters_ = null; + clustersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListClustersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListClustersResponse getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.ListClustersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListClustersResponse build() { + com.google.cloud.alloydb.v1alpha.ListClustersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListClustersResponse buildPartial() { + com.google.cloud.alloydb.v1alpha.ListClustersResponse result = + new com.google.cloud.alloydb.v1alpha.ListClustersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.ListClustersResponse result) { + if (clustersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + clusters_ = java.util.Collections.unmodifiableList(clusters_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.clusters_ = clusters_; + } else { + result.clusters_ = clustersBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.ListClustersResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.alloydb.v1alpha.ListClustersResponse) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.ListClustersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.ListClustersResponse other) { + if (other == com.google.cloud.alloydb.v1alpha.ListClustersResponse.getDefaultInstance()) + return this; + if (clustersBuilder_ == null) { + if (!other.clusters_.isEmpty()) { + if (clusters_.isEmpty()) { + clusters_ = other.clusters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureClustersIsMutable(); + clusters_.addAll(other.clusters_); + } + onChanged(); + } + } else { + if (!other.clusters_.isEmpty()) { + if (clustersBuilder_.isEmpty()) { + clustersBuilder_.dispose(); + clustersBuilder_ = null; + clusters_ = other.clusters_; + bitField0_ = (bitField0_ & ~0x00000001); + clustersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getClustersFieldBuilder() + : null; + } else { + clustersBuilder_.addAllMessages(other.clusters_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.alloydb.v1alpha.Cluster m = + input.readMessage( + com.google.cloud.alloydb.v1alpha.Cluster.parser(), extensionRegistry); + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(m); + } else { + clustersBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + 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 clusters_ = + java.util.Collections.emptyList(); + + private void ensureClustersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + clusters_ = new java.util.ArrayList(clusters_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster, + com.google.cloud.alloydb.v1alpha.Cluster.Builder, + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder> + clustersBuilder_; + + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public java.util.List getClustersList() { + if (clustersBuilder_ == null) { + return java.util.Collections.unmodifiableList(clusters_); + } else { + return clustersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public int getClustersCount() { + if (clustersBuilder_ == null) { + return clusters_.size(); + } else { + return clustersBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public com.google.cloud.alloydb.v1alpha.Cluster getClusters(int index) { + if (clustersBuilder_ == null) { + return clusters_.get(index); + } else { + return clustersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public Builder setClusters(int index, com.google.cloud.alloydb.v1alpha.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.set(index, value); + onChanged(); + } else { + clustersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public Builder setClusters( + int index, com.google.cloud.alloydb.v1alpha.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.set(index, builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public Builder addClusters(com.google.cloud.alloydb.v1alpha.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.add(value); + onChanged(); + } else { + clustersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public Builder addClusters(int index, com.google.cloud.alloydb.v1alpha.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.add(index, value); + onChanged(); + } else { + clustersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public Builder addClusters(com.google.cloud.alloydb.v1alpha.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public Builder addClusters( + int index, com.google.cloud.alloydb.v1alpha.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(index, builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public Builder addAllClusters( + java.lang.Iterable values) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clusters_); + onChanged(); + } else { + clustersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public Builder clearClusters() { + if (clustersBuilder_ == null) { + clusters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + clustersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public Builder removeClusters(int index) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.remove(index); + onChanged(); + } else { + clustersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public com.google.cloud.alloydb.v1alpha.Cluster.Builder getClustersBuilder(int index) { + return getClustersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public com.google.cloud.alloydb.v1alpha.ClusterOrBuilder getClustersOrBuilder(int index) { + if (clustersBuilder_ == null) { + return clusters_.get(index); + } else { + return clustersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public java.util.List + getClustersOrBuilderList() { + if (clustersBuilder_ != null) { + return clustersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(clusters_); + } + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public com.google.cloud.alloydb.v1alpha.Cluster.Builder addClustersBuilder() { + return getClustersFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public com.google.cloud.alloydb.v1alpha.Cluster.Builder addClustersBuilder(int index) { + return getClustersFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + public java.util.List + getClustersBuilderList() { + return getClustersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster, + com.google.cloud.alloydb.v1alpha.Cluster.Builder, + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder> + getClustersFieldBuilder() { + if (clustersBuilder_ == null) { + clustersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster, + com.google.cloud.alloydb.v1alpha.Cluster.Builder, + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder>( + clusters_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + clusters_ = null; + } + return clustersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.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.alloydb.v1alpha.ListClustersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.ListClustersResponse) + private static final com.google.cloud.alloydb.v1alpha.ListClustersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.ListClustersResponse(); + } + + public static com.google.cloud.alloydb.v1alpha.ListClustersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListClustersResponse 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.alloydb.v1alpha.ListClustersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListClustersResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListClustersResponseOrBuilder.java new file mode 100644 index 000000000000..df2e055d0e52 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListClustersResponseOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface ListClustersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.ListClustersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + java.util.List getClustersList(); + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + com.google.cloud.alloydb.v1alpha.Cluster getClusters(int index); + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + int getClustersCount(); + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + java.util.List + getClustersOrBuilderList(); + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder getClustersOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListInstancesRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListInstancesRequest.java new file mode 100644 index 000000000000..1b0eaa48b3b4 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListInstancesRequest.java @@ -0,0 +1,1322 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for requesting list of Instances
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListInstancesRequest} + */ +public final class ListInstancesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.ListInstancesRequest) + ListInstancesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInstancesRequest.newBuilder() to construct. + private ListInstancesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInstancesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListInstancesRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListInstancesRequest.class, + com.google.cloud.alloydb.v1alpha.ListInstancesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with one of the following
+   * formats:
+   *  * projects/{project}/locations/-/clusters/-
+   *  * projects/{project}/locations/{region}/clusters/-
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Instance.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with one of the following
+   * formats:
+   *  * projects/{project}/locations/-/clusters/-
+   *  * projects/{project}/locations/{region}/clusters/-
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.alloydb.v1alpha.ListInstancesRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.ListInstancesRequest other = + (com.google.cloud.alloydb.v1alpha.ListInstancesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesRequest 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.alloydb.v1alpha.ListInstancesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesRequest 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.alloydb.v1alpha.ListInstancesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesRequest 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.alloydb.v1alpha.ListInstancesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesRequest 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.alloydb.v1alpha.ListInstancesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesRequest 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.alloydb.v1alpha.ListInstancesRequest 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; + } + /** + * + * + *
+   * Message for requesting list of Instances
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListInstancesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.ListInstancesRequest) + com.google.cloud.alloydb.v1alpha.ListInstancesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListInstancesRequest.class, + com.google.cloud.alloydb.v1alpha.ListInstancesRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.ListInstancesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListInstancesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListInstancesRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.ListInstancesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListInstancesRequest build() { + com.google.cloud.alloydb.v1alpha.ListInstancesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListInstancesRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.ListInstancesRequest result = + new com.google.cloud.alloydb.v1alpha.ListInstancesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.ListInstancesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @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.alloydb.v1alpha.ListInstancesRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.ListInstancesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.ListInstancesRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.ListInstancesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + 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 parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with one of the following
+     * formats:
+     *  * projects/{project}/locations/-/clusters/-
+     *  * projects/{project}/locations/{region}/clusters/-
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with one of the following
+     * formats:
+     *  * projects/{project}/locations/-/clusters/-
+     *  * projects/{project}/locations/{region}/clusters/-
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with one of the following
+     * formats:
+     *  * projects/{project}/locations/-/clusters/-
+     *  * projects/{project}/locations/{region}/clusters/-
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with one of the following
+     * formats:
+     *  * projects/{project}/locations/-/clusters/-
+     *  * projects/{project}/locations/{region}/clusters/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with one of the following
+     * formats:
+     *  * projects/{project}/locations/-/clusters/-
+     *  * projects/{project}/locations/{region}/clusters/-
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000010; + 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.alloydb.v1alpha.ListInstancesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.ListInstancesRequest) + private static final com.google.cloud.alloydb.v1alpha.ListInstancesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.ListInstancesRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesRequest 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.alloydb.v1alpha.ListInstancesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListInstancesRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListInstancesRequestOrBuilder.java new file mode 100644 index 000000000000..dd67675efbc7 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListInstancesRequestOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface ListInstancesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.ListInstancesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with one of the following
+   * formats:
+   *  * projects/{project}/locations/-/clusters/-
+   *  * projects/{project}/locations/{region}/clusters/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with one of the following
+   * formats:
+   *  * projects/{project}/locations/-/clusters/-
+   *  * projects/{project}/locations/{region}/clusters/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListInstancesResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListInstancesResponse.java new file mode 100644 index 000000000000..fb6d5fb517b1 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListInstancesResponse.java @@ -0,0 +1,1395 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for response to listing Instances
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListInstancesResponse} + */ +public final class ListInstancesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.ListInstancesResponse) + ListInstancesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInstancesResponse.newBuilder() to construct. + private ListInstancesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInstancesResponse() { + instances_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListInstancesResponse(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListInstancesResponse.class, + com.google.cloud.alloydb.v1alpha.ListInstancesResponse.Builder.class); + } + + public static final int INSTANCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List instances_; + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + @java.lang.Override + public java.util.List getInstancesList() { + return instances_; + } + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + @java.lang.Override + public java.util.List + getInstancesOrBuilderList() { + return instances_; + } + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance getInstances(int index) { + return instances_.get(index); + } + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.InstanceOrBuilder getInstancesOrBuilder(int index) { + return instances_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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 UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.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 < instances_.size(); i++) { + output.writeMessage(1, instances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(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 < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, instances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().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.alloydb.v1alpha.ListInstancesResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.ListInstancesResponse other = + (com.google.cloud.alloydb.v1alpha.ListInstancesResponse) obj; + + if (!getInstancesList().equals(other.getInstancesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) 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 (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesResponse 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.alloydb.v1alpha.ListInstancesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesResponse 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.alloydb.v1alpha.ListInstancesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesResponse 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.alloydb.v1alpha.ListInstancesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesResponse 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.alloydb.v1alpha.ListInstancesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesResponse 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.alloydb.v1alpha.ListInstancesResponse 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; + } + /** + * + * + *
+   * Message for response to listing Instances
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListInstancesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.ListInstancesResponse) + com.google.cloud.alloydb.v1alpha.ListInstancesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListInstancesResponse.class, + com.google.cloud.alloydb.v1alpha.ListInstancesResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.ListInstancesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + } else { + instances_ = null; + instancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListInstancesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListInstancesResponse getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.ListInstancesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListInstancesResponse build() { + com.google.cloud.alloydb.v1alpha.ListInstancesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListInstancesResponse buildPartial() { + com.google.cloud.alloydb.v1alpha.ListInstancesResponse result = + new com.google.cloud.alloydb.v1alpha.ListInstancesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.ListInstancesResponse result) { + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.ListInstancesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.alloydb.v1alpha.ListInstancesResponse) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.ListInstancesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.ListInstancesResponse other) { + if (other == com.google.cloud.alloydb.v1alpha.ListInstancesResponse.getDefaultInstance()) + return this; + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.alloydb.v1alpha.Instance m = + input.readMessage( + com.google.cloud.alloydb.v1alpha.Instance.parser(), extensionRegistry); + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(m); + } else { + instancesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + 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 instances_ = + java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instances_ = new java.util.ArrayList(instances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance, + com.google.cloud.alloydb.v1alpha.Instance.Builder, + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public java.util.List getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1alpha.Instance getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder setInstances(int index, com.google.cloud.alloydb.v1alpha.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder setInstances( + int index, com.google.cloud.alloydb.v1alpha.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.alloydb.v1alpha.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder addInstances(int index, com.google.cloud.alloydb.v1alpha.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.alloydb.v1alpha.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder addInstances( + int index, com.google.cloud.alloydb.v1alpha.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder addAllInstances( + java.lang.Iterable values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1alpha.Instance.Builder getInstancesBuilder(int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1alpha.InstanceOrBuilder getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public java.util.List + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1alpha.Instance.Builder addInstancesBuilder() { + return getInstancesFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1alpha.Instance.Builder addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + public java.util.List + getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance, + com.google.cloud.alloydb.v1alpha.Instance.Builder, + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance, + com.google.cloud.alloydb.v1alpha.Instance.Builder, + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder>( + instances_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.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.alloydb.v1alpha.ListInstancesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.ListInstancesResponse) + private static final com.google.cloud.alloydb.v1alpha.ListInstancesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.ListInstancesResponse(); + } + + public static com.google.cloud.alloydb.v1alpha.ListInstancesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesResponse 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.alloydb.v1alpha.ListInstancesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListInstancesResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListInstancesResponseOrBuilder.java new file mode 100644 index 000000000000..810eb254496a --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListInstancesResponseOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface ListInstancesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.ListInstancesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + java.util.List getInstancesList(); + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + com.google.cloud.alloydb.v1alpha.Instance getInstances(int index); + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + int getInstancesCount(); + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + java.util.List + getInstancesOrBuilderList(); + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder getInstancesOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListSupportedDatabaseFlagsRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListSupportedDatabaseFlagsRequest.java new file mode 100644 index 000000000000..58010b4a4012 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListSupportedDatabaseFlagsRequest.java @@ -0,0 +1,970 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for listing the information about the supported Database flags.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} + */ +public final class ListSupportedDatabaseFlagsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest) + ListSupportedDatabaseFlagsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSupportedDatabaseFlagsRequest.newBuilder() to construct. + private ListSupportedDatabaseFlagsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSupportedDatabaseFlagsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSupportedDatabaseFlagsRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.class, + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   *  * projects/{project}/locations/{location}
+   * Regardless of the parent specified here, as long it is contains a valid
+   * project and location, the service will return a static list of supported
+   * flags resources. Note that we do not yet support region-specific
+   * flags.
+   * 
+ * + * + * 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 parent resource. The required format is:
+   *  * projects/{project}/locations/{location}
+   * Regardless of the parent specified here, as long it is contains a valid
+   * project and location, the service will return a static list of supported
+   * flags resources. Note that we do not yet support region-specific
+   * flags.
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * 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.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest other = + (com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest) 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.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest 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.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest 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.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest 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.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + 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.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest 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.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest 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; + } + /** + * + * + *
+   * Message for listing the information about the supported Database flags.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest) + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.class, + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest build() { + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest result = + new com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest) { + return mergeFrom( + (com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest other) { + if (other + == com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + 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 parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     *  * projects/{project}/locations/{location}
+     * Regardless of the parent specified here, as long it is contains a valid
+     * project and location, the service will return a static list of supported
+     * flags resources. Note that we do not yet support region-specific
+     * flags.
+     * 
+ * + * + * 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 parent resource. The required format is:
+     *  * projects/{project}/locations/{location}
+     * Regardless of the parent specified here, as long it is contains a valid
+     * project and location, the service will return a static list of supported
+     * flags resources. Note that we do not yet support region-specific
+     * flags.
+     * 
+ * + * + * 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 parent resource. The required format is:
+     *  * projects/{project}/locations/{location}
+     * Regardless of the parent specified here, as long it is contains a valid
+     * project and location, the service will return a static list of supported
+     * flags resources. Note that we do not yet support region-specific
+     * flags.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     *  * projects/{project}/locations/{location}
+     * Regardless of the parent specified here, as long it is contains a valid
+     * project and location, the service will return a static list of supported
+     * flags resources. Note that we do not yet support region-specific
+     * flags.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     *  * projects/{project}/locations/{location}
+     * Regardless of the parent specified here, as long it is contains a valid
+     * project and location, the service will return a static list of supported
+     * flags resources. Note that we do not yet support region-specific
+     * flags.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + 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.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest) + private static final com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSupportedDatabaseFlagsRequest 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.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListSupportedDatabaseFlagsRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListSupportedDatabaseFlagsRequestOrBuilder.java new file mode 100644 index 000000000000..6bfe01b35f60 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListSupportedDatabaseFlagsRequestOrBuilder.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/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface ListSupportedDatabaseFlagsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   *  * projects/{project}/locations/{location}
+   * Regardless of the parent specified here, as long it is contains a valid
+   * project and location, the service will return a static list of supported
+   * flags resources. Note that we do not yet support region-specific
+   * flags.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   *  * projects/{project}/locations/{location}
+   * Regardless of the parent specified here, as long it is contains a valid
+   * project and location, the service will return a static list of supported
+   * flags resources. Note that we do not yet support region-specific
+   * flags.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListSupportedDatabaseFlagsResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListSupportedDatabaseFlagsResponse.java new file mode 100644 index 000000000000..32a0b6608cdf --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListSupportedDatabaseFlagsResponse.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/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for response to listing SupportedDatabaseFlags.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} + */ +public final class ListSupportedDatabaseFlagsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) + ListSupportedDatabaseFlagsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSupportedDatabaseFlagsResponse.newBuilder() to construct. + private ListSupportedDatabaseFlagsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSupportedDatabaseFlagsResponse() { + supportedDatabaseFlags_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSupportedDatabaseFlagsResponse(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.class, + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.Builder.class); + } + + public static final int SUPPORTED_DATABASE_FLAGS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + supportedDatabaseFlags_; + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + @java.lang.Override + public java.util.List + getSupportedDatabaseFlagsList() { + return supportedDatabaseFlags_; + } + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + @java.lang.Override + public java.util.List + getSupportedDatabaseFlagsOrBuilderList() { + return supportedDatabaseFlags_; + } + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + @java.lang.Override + public int getSupportedDatabaseFlagsCount() { + return supportedDatabaseFlags_.size(); + } + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag getSupportedDatabaseFlags( + int index) { + return supportedDatabaseFlags_.get(index); + } + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlagOrBuilder + getSupportedDatabaseFlagsOrBuilder(int index) { + return supportedDatabaseFlags_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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 < supportedDatabaseFlags_.size(); i++) { + output.writeMessage(1, supportedDatabaseFlags_.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 < supportedDatabaseFlags_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, supportedDatabaseFlags_.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.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse other = + (com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) obj; + + if (!getSupportedDatabaseFlagsList().equals(other.getSupportedDatabaseFlagsList())) + 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 (getSupportedDatabaseFlagsCount() > 0) { + hash = (37 * hash) + SUPPORTED_DATABASE_FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getSupportedDatabaseFlagsList().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.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse 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.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse 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.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse 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.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + 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.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse 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.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse 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; + } + /** + * + * + *
+   * Message for response to listing SupportedDatabaseFlags.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.class, + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (supportedDatabaseFlagsBuilder_ == null) { + supportedDatabaseFlags_ = java.util.Collections.emptyList(); + } else { + supportedDatabaseFlags_ = null; + supportedDatabaseFlagsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse build() { + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse buildPartial() { + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse result = + new com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse result) { + if (supportedDatabaseFlagsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + supportedDatabaseFlags_ = java.util.Collections.unmodifiableList(supportedDatabaseFlags_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.supportedDatabaseFlags_ = supportedDatabaseFlags_; + } else { + result.supportedDatabaseFlags_ = supportedDatabaseFlagsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) { + return mergeFrom( + (com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse other) { + if (other + == com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + .getDefaultInstance()) return this; + if (supportedDatabaseFlagsBuilder_ == null) { + if (!other.supportedDatabaseFlags_.isEmpty()) { + if (supportedDatabaseFlags_.isEmpty()) { + supportedDatabaseFlags_ = other.supportedDatabaseFlags_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.addAll(other.supportedDatabaseFlags_); + } + onChanged(); + } + } else { + if (!other.supportedDatabaseFlags_.isEmpty()) { + if (supportedDatabaseFlagsBuilder_.isEmpty()) { + supportedDatabaseFlagsBuilder_.dispose(); + supportedDatabaseFlagsBuilder_ = null; + supportedDatabaseFlags_ = other.supportedDatabaseFlags_; + bitField0_ = (bitField0_ & ~0x00000001); + supportedDatabaseFlagsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSupportedDatabaseFlagsFieldBuilder() + : null; + } else { + supportedDatabaseFlagsBuilder_.addAllMessages(other.supportedDatabaseFlags_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + 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.alloydb.v1alpha.SupportedDatabaseFlag m = + input.readMessage( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.parser(), + extensionRegistry); + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.add(m); + } else { + supportedDatabaseFlagsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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 + supportedDatabaseFlags_ = java.util.Collections.emptyList(); + + private void ensureSupportedDatabaseFlagsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + supportedDatabaseFlags_ = + new java.util.ArrayList( + supportedDatabaseFlags_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Builder, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlagOrBuilder> + supportedDatabaseFlagsBuilder_; + + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public java.util.List + getSupportedDatabaseFlagsList() { + if (supportedDatabaseFlagsBuilder_ == null) { + return java.util.Collections.unmodifiableList(supportedDatabaseFlags_); + } else { + return supportedDatabaseFlagsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public int getSupportedDatabaseFlagsCount() { + if (supportedDatabaseFlagsBuilder_ == null) { + return supportedDatabaseFlags_.size(); + } else { + return supportedDatabaseFlagsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag getSupportedDatabaseFlags( + int index) { + if (supportedDatabaseFlagsBuilder_ == null) { + return supportedDatabaseFlags_.get(index); + } else { + return supportedDatabaseFlagsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder setSupportedDatabaseFlags( + int index, com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag value) { + if (supportedDatabaseFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.set(index, value); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder setSupportedDatabaseFlags( + int index, com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Builder builderForValue) { + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.set(index, builderForValue.build()); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder addSupportedDatabaseFlags( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag value) { + if (supportedDatabaseFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.add(value); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder addSupportedDatabaseFlags( + int index, com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag value) { + if (supportedDatabaseFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.add(index, value); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder addSupportedDatabaseFlags( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Builder builderForValue) { + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.add(builderForValue.build()); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder addSupportedDatabaseFlags( + int index, com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Builder builderForValue) { + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.add(index, builderForValue.build()); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder addAllSupportedDatabaseFlags( + java.lang.Iterable + values) { + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, supportedDatabaseFlags_); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder clearSupportedDatabaseFlags() { + if (supportedDatabaseFlagsBuilder_ == null) { + supportedDatabaseFlags_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder removeSupportedDatabaseFlags(int index) { + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.remove(index); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Builder + getSupportedDatabaseFlagsBuilder(int index) { + return getSupportedDatabaseFlagsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlagOrBuilder + getSupportedDatabaseFlagsOrBuilder(int index) { + if (supportedDatabaseFlagsBuilder_ == null) { + return supportedDatabaseFlags_.get(index); + } else { + return supportedDatabaseFlagsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public java.util.List + getSupportedDatabaseFlagsOrBuilderList() { + if (supportedDatabaseFlagsBuilder_ != null) { + return supportedDatabaseFlagsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(supportedDatabaseFlags_); + } + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Builder + addSupportedDatabaseFlagsBuilder() { + return getSupportedDatabaseFlagsFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.getDefaultInstance()); + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Builder + addSupportedDatabaseFlagsBuilder(int index) { + return getSupportedDatabaseFlagsFieldBuilder() + .addBuilder( + index, com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.getDefaultInstance()); + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public java.util.List + getSupportedDatabaseFlagsBuilderList() { + return getSupportedDatabaseFlagsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Builder, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlagOrBuilder> + getSupportedDatabaseFlagsFieldBuilder() { + if (supportedDatabaseFlagsBuilder_ == null) { + supportedDatabaseFlagsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Builder, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlagOrBuilder>( + supportedDatabaseFlags_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + supportedDatabaseFlags_ = null; + } + return supportedDatabaseFlagsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) + private static final com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse(); + } + + public static com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSupportedDatabaseFlagsResponse 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.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListSupportedDatabaseFlagsResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListSupportedDatabaseFlagsResponseOrBuilder.java new file mode 100644 index 000000000000..369b6cc3d0a0 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListSupportedDatabaseFlagsResponseOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface ListSupportedDatabaseFlagsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + java.util.List + getSupportedDatabaseFlagsList(); + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag getSupportedDatabaseFlags(int index); + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + int getSupportedDatabaseFlagsCount(); + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + java.util.List + getSupportedDatabaseFlagsOrBuilderList(); + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlagOrBuilder + getSupportedDatabaseFlagsOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/LocationName.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/LocationName.java new file mode 100644 index 000000000000..74ae1d8222ea --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/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.alloydb.v1alpha; + +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-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/MigrationSource.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/MigrationSource.java new file mode 100644 index 000000000000..1edac58a5a7a --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/MigrationSource.java @@ -0,0 +1,1139 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Subset of the source instance configuration that is available when reading
+ * the cluster resource.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.MigrationSource} + */ +public final class MigrationSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.MigrationSource) + MigrationSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use MigrationSource.newBuilder() to construct. + private MigrationSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MigrationSource() { + hostPort_ = ""; + referenceId_ = ""; + sourceType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MigrationSource(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_MigrationSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_MigrationSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.MigrationSource.class, + com.google.cloud.alloydb.v1alpha.MigrationSource.Builder.class); + } + + /** + * + * + *
+   * Denote the type of migration source that created this cluster.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType} + */ + public enum MigrationSourceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Migration source is unknown.
+     * 
+ * + * MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + */ + MIGRATION_SOURCE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * DMS source means the cluster was created via DMS migration job.
+     * 
+ * + * DMS = 1; + */ + DMS(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Migration source is unknown.
+     * 
+ * + * MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + */ + public static final int MIGRATION_SOURCE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * DMS source means the cluster was created via DMS migration job.
+     * 
+ * + * DMS = 1; + */ + public static final int DMS_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 MigrationSourceType 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 MigrationSourceType forNumber(int value) { + switch (value) { + case 0: + return MIGRATION_SOURCE_TYPE_UNSPECIFIED; + case 1: + return DMS; + 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 MigrationSourceType findValueByNumber(int number) { + return MigrationSourceType.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.alloydb.v1alpha.MigrationSource.getDescriptor().getEnumTypes().get(0); + } + + private static final MigrationSourceType[] VALUES = values(); + + public static MigrationSourceType 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 MigrationSourceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType) + } + + public static final int HOST_PORT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object hostPort_ = ""; + /** + * + * + *
+   * Output only. The host and port of the on-premises instance in host:port
+   * format
+   * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The hostPort. + */ + @java.lang.Override + public java.lang.String getHostPort() { + java.lang.Object ref = hostPort_; + 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(); + hostPort_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The host and port of the on-premises instance in host:port
+   * format
+   * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for hostPort. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostPortBytes() { + java.lang.Object ref = hostPort_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostPort_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REFERENCE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object referenceId_ = ""; + /** + * + * + *
+   * Output only. Place holder for the external source identifier(e.g DMS job
+   * name) that created the cluster.
+   * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. Place holder for the external source identifier(e.g DMS job
+   * name) that created the cluster.
+   * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 SOURCE_TYPE_FIELD_NUMBER = 3; + private int sourceType_ = 0; + /** + * + * + *
+   * Output only. Type of migration source.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for sourceType. + */ + @java.lang.Override + public int getSourceTypeValue() { + return sourceType_; + } + /** + * + * + *
+   * Output only. Type of migration source.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType getSourceType() { + com.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType result = + com.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType.forNumber(sourceType_); + return result == null + ? com.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType.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(hostPort_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, hostPort_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, referenceId_); + } + if (sourceType_ + != com.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType + .MIGRATION_SOURCE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, sourceType_); + } + 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(hostPort_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, hostPort_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, referenceId_); + } + if (sourceType_ + != com.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType + .MIGRATION_SOURCE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, sourceType_); + } + 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.alloydb.v1alpha.MigrationSource)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.MigrationSource other = + (com.google.cloud.alloydb.v1alpha.MigrationSource) obj; + + if (!getHostPort().equals(other.getHostPort())) return false; + if (!getReferenceId().equals(other.getReferenceId())) return false; + if (sourceType_ != other.sourceType_) 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) + HOST_PORT_FIELD_NUMBER; + hash = (53 * hash) + getHostPort().hashCode(); + hash = (37 * hash) + REFERENCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getReferenceId().hashCode(); + hash = (37 * hash) + SOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + sourceType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.MigrationSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.MigrationSource 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.alloydb.v1alpha.MigrationSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.MigrationSource 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.alloydb.v1alpha.MigrationSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.MigrationSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.MigrationSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.MigrationSource 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.alloydb.v1alpha.MigrationSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.MigrationSource 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.alloydb.v1alpha.MigrationSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.MigrationSource 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.alloydb.v1alpha.MigrationSource 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; + } + /** + * + * + *
+   * Subset of the source instance configuration that is available when reading
+   * the cluster resource.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.MigrationSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.MigrationSource) + com.google.cloud.alloydb.v1alpha.MigrationSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_MigrationSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_MigrationSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.MigrationSource.class, + com.google.cloud.alloydb.v1alpha.MigrationSource.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.MigrationSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + hostPort_ = ""; + referenceId_ = ""; + sourceType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_MigrationSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.MigrationSource getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.MigrationSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.MigrationSource build() { + com.google.cloud.alloydb.v1alpha.MigrationSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.MigrationSource buildPartial() { + com.google.cloud.alloydb.v1alpha.MigrationSource result = + new com.google.cloud.alloydb.v1alpha.MigrationSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.MigrationSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.hostPort_ = hostPort_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.referenceId_ = referenceId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sourceType_ = sourceType_; + } + } + + @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.alloydb.v1alpha.MigrationSource) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.MigrationSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.MigrationSource other) { + if (other == com.google.cloud.alloydb.v1alpha.MigrationSource.getDefaultInstance()) + return this; + if (!other.getHostPort().isEmpty()) { + hostPort_ = other.hostPort_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getReferenceId().isEmpty()) { + referenceId_ = other.referenceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.sourceType_ != 0) { + setSourceTypeValue(other.getSourceTypeValue()); + } + 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: + { + hostPort_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + referenceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + sourceType_ = input.readEnum(); + bitField0_ |= 0x00000004; + 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 java.lang.Object hostPort_ = ""; + /** + * + * + *
+     * Output only. The host and port of the on-premises instance in host:port
+     * format
+     * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The hostPort. + */ + public java.lang.String getHostPort() { + java.lang.Object ref = hostPort_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostPort_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The host and port of the on-premises instance in host:port
+     * format
+     * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for hostPort. + */ + public com.google.protobuf.ByteString getHostPortBytes() { + java.lang.Object ref = hostPort_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostPort_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The host and port of the on-premises instance in host:port
+     * format
+     * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The hostPort to set. + * @return This builder for chaining. + */ + public Builder setHostPort(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + hostPort_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The host and port of the on-premises instance in host:port
+     * format
+     * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearHostPort() { + hostPort_ = getDefaultInstance().getHostPort(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The host and port of the on-premises instance in host:port
+     * format
+     * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for hostPort to set. + * @return This builder for chaining. + */ + public Builder setHostPortBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + hostPort_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object referenceId_ = ""; + /** + * + * + *
+     * Output only. Place holder for the external source identifier(e.g DMS job
+     * name) that created the cluster.
+     * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. Place holder for the external source identifier(e.g DMS job
+     * name) that created the cluster.
+     * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. Place holder for the external source identifier(e.g DMS job
+     * name) that created the cluster.
+     * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Place holder for the external source identifier(e.g DMS job
+     * name) that created the cluster.
+     * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReferenceId() { + referenceId_ = getDefaultInstance().getReferenceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Place holder for the external source identifier(e.g DMS job
+     * name) that created the cluster.
+     * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int sourceType_ = 0; + /** + * + * + *
+     * Output only. Type of migration source.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for sourceType. + */ + @java.lang.Override + public int getSourceTypeValue() { + return sourceType_; + } + /** + * + * + *
+     * Output only. Type of migration source.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for sourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceTypeValue(int value) { + sourceType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of migration source.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType getSourceType() { + com.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType result = + com.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType.forNumber( + sourceType_); + return result == null + ? com.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Type of migration source.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The sourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceType( + com.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + sourceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of migration source.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSourceType() { + bitField0_ = (bitField0_ & ~0x00000004); + sourceType_ = 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.alloydb.v1alpha.MigrationSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.MigrationSource) + private static final com.google.cloud.alloydb.v1alpha.MigrationSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.MigrationSource(); + } + + public static com.google.cloud.alloydb.v1alpha.MigrationSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MigrationSource 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.alloydb.v1alpha.MigrationSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/MigrationSourceOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/MigrationSourceOrBuilder.java new file mode 100644 index 000000000000..ec41ba121a0a --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/MigrationSourceOrBuilder.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/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface MigrationSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.MigrationSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The host and port of the on-premises instance in host:port
+   * format
+   * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The hostPort. + */ + java.lang.String getHostPort(); + /** + * + * + *
+   * Output only. The host and port of the on-premises instance in host:port
+   * format
+   * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for hostPort. + */ + com.google.protobuf.ByteString getHostPortBytes(); + + /** + * + * + *
+   * Output only. Place holder for the external source identifier(e.g DMS job
+   * name) that created the cluster.
+   * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The referenceId. + */ + java.lang.String getReferenceId(); + /** + * + * + *
+   * Output only. Place holder for the external source identifier(e.g DMS job
+   * name) that created the cluster.
+   * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for referenceId. + */ + com.google.protobuf.ByteString getReferenceIdBytes(); + + /** + * + * + *
+   * Output only. Type of migration source.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for sourceType. + */ + int getSourceTypeValue(); + /** + * + * + *
+   * Output only. Type of migration source.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceType. + */ + com.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType getSourceType(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/OperationMetadata.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/OperationMetadata.java new file mode 100644 index 000000000000..3a3cfa11a479 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/OperationMetadata.java @@ -0,0 +1,2244 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.OperationMetadata.class, + com.google.cloud.alloydb.v1alpha.OperationMetadata.Builder.class); + } + + private int requestSpecificCase_ = 0; + private java.lang.Object requestSpecific_; + + public enum RequestSpecificCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BATCH_CREATE_INSTANCES_METADATA(8), + REQUESTSPECIFIC_NOT_SET(0); + private final int value; + + private RequestSpecificCase(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 RequestSpecificCase valueOf(int value) { + return forNumber(value); + } + + public static RequestSpecificCase forNumber(int value) { + switch (value) { + case 8: + return BATCH_CREATE_INSTANCES_METADATA; + case 0: + return REQUESTSPECIFIC_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RequestSpecificCase getRequestSpecificCase() { + return RequestSpecificCase.forNumber(requestSpecificCase_); + } + + public static final int BATCH_CREATE_INSTANCES_METADATA_FIELD_NUMBER = 8; + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the batchCreateInstancesMetadata field is set. + */ + @java.lang.Override + public boolean hasBatchCreateInstancesMetadata() { + return requestSpecificCase_ == 8; + } + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The batchCreateInstancesMetadata. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + getBatchCreateInstancesMetadata() { + if (requestSpecificCase_ == 8) { + return (com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) requestSpecific_; + } + return com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadataOrBuilder + getBatchCreateInstancesMetadataOrBuilder() { + if (requestSpecificCase_ == 8) { + return (com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) requestSpecific_; + } + return com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.getDefaultInstance(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int TARGET_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object verb_ = ""; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object statusMessage_ = ""; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + 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(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_ = false; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiVersion_ = ""; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + if (requestSpecificCase_ == 8) { + output.writeMessage( + 8, (com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) requestSpecific_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + if (requestSpecificCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) requestSpecific_); + } + 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.alloydb.v1alpha.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.OperationMetadata other = + (com.google.cloud.alloydb.v1alpha.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (!getRequestSpecificCase().equals(other.getRequestSpecificCase())) return false; + switch (requestSpecificCase_) { + case 8: + if (!getBatchCreateInstancesMetadata().equals(other.getBatchCreateInstancesMetadata())) + 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(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + switch (requestSpecificCase_) { + case 8: + hash = (37 * hash) + BATCH_CREATE_INSTANCES_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getBatchCreateInstancesMetadata().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.OperationMetadata 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.alloydb.v1alpha.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.OperationMetadata 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.alloydb.v1alpha.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.OperationMetadata 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.alloydb.v1alpha.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.OperationMetadata 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.alloydb.v1alpha.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.OperationMetadata 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.alloydb.v1alpha.OperationMetadata 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 metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.OperationMetadata) + com.google.cloud.alloydb.v1alpha.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.OperationMetadata.class, + com.google.cloud.alloydb.v1alpha.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.OperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (batchCreateInstancesMetadataBuilder_ != null) { + batchCreateInstancesMetadataBuilder_.clear(); + } + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + requestedCancellation_ = false; + apiVersion_ = ""; + requestSpecificCase_ = 0; + requestSpecific_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.OperationMetadata build() { + com.google.cloud.alloydb.v1alpha.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.OperationMetadata buildPartial() { + com.google.cloud.alloydb.v1alpha.OperationMetadata result = + new com.google.cloud.alloydb.v1alpha.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.OperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.verb_ = verb_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.statusMessage_ = statusMessage_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.apiVersion_ = apiVersion_; + } + } + + private void buildPartialOneofs(com.google.cloud.alloydb.v1alpha.OperationMetadata result) { + result.requestSpecificCase_ = requestSpecificCase_; + result.requestSpecific_ = this.requestSpecific_; + if (requestSpecificCase_ == 8 && batchCreateInstancesMetadataBuilder_ != null) { + result.requestSpecific_ = batchCreateInstancesMetadataBuilder_.build(); + } + } + + @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.alloydb.v1alpha.OperationMetadata) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.OperationMetadata other) { + if (other == com.google.cloud.alloydb.v1alpha.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + bitField0_ |= 0x00000080; + onChanged(); + } + switch (other.getRequestSpecificCase()) { + case BATCH_CREATE_INSTANCES_METADATA: + { + mergeBatchCreateInstancesMetadata(other.getBatchCreateInstancesMetadata()); + break; + } + case REQUESTSPECIFIC_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(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 26: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + verb_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + statusMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 48: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 48 + case 58: + { + apiVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + input.readMessage( + getBatchCreateInstancesMetadataFieldBuilder().getBuilder(), extensionRegistry); + requestSpecificCase_ = 8; + break; + } // case 66 + 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 requestSpecificCase_ = 0; + private java.lang.Object requestSpecific_; + + public RequestSpecificCase getRequestSpecificCase() { + return RequestSpecificCase.forNumber(requestSpecificCase_); + } + + public Builder clearRequestSpecific() { + requestSpecificCase_ = 0; + requestSpecific_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata, + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.Builder, + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadataOrBuilder> + batchCreateInstancesMetadataBuilder_; + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the batchCreateInstancesMetadata field is set. + */ + @java.lang.Override + public boolean hasBatchCreateInstancesMetadata() { + return requestSpecificCase_ == 8; + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The batchCreateInstancesMetadata. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + getBatchCreateInstancesMetadata() { + if (batchCreateInstancesMetadataBuilder_ == null) { + if (requestSpecificCase_ == 8) { + return (com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) requestSpecific_; + } + return com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.getDefaultInstance(); + } else { + if (requestSpecificCase_ == 8) { + return batchCreateInstancesMetadataBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBatchCreateInstancesMetadata( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata value) { + if (batchCreateInstancesMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestSpecific_ = value; + onChanged(); + } else { + batchCreateInstancesMetadataBuilder_.setMessage(value); + } + requestSpecificCase_ = 8; + return this; + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBatchCreateInstancesMetadata( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.Builder builderForValue) { + if (batchCreateInstancesMetadataBuilder_ == null) { + requestSpecific_ = builderForValue.build(); + onChanged(); + } else { + batchCreateInstancesMetadataBuilder_.setMessage(builderForValue.build()); + } + requestSpecificCase_ = 8; + return this; + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeBatchCreateInstancesMetadata( + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata value) { + if (batchCreateInstancesMetadataBuilder_ == null) { + if (requestSpecificCase_ == 8 + && requestSpecific_ + != com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + .getDefaultInstance()) { + requestSpecific_ = + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.newBuilder( + (com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) + requestSpecific_) + .mergeFrom(value) + .buildPartial(); + } else { + requestSpecific_ = value; + } + onChanged(); + } else { + if (requestSpecificCase_ == 8) { + batchCreateInstancesMetadataBuilder_.mergeFrom(value); + } else { + batchCreateInstancesMetadataBuilder_.setMessage(value); + } + } + requestSpecificCase_ = 8; + return this; + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearBatchCreateInstancesMetadata() { + if (batchCreateInstancesMetadataBuilder_ == null) { + if (requestSpecificCase_ == 8) { + requestSpecificCase_ = 0; + requestSpecific_ = null; + onChanged(); + } + } else { + if (requestSpecificCase_ == 8) { + requestSpecificCase_ = 0; + requestSpecific_ = null; + } + batchCreateInstancesMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.Builder + getBatchCreateInstancesMetadataBuilder() { + return getBatchCreateInstancesMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadataOrBuilder + getBatchCreateInstancesMetadataOrBuilder() { + if ((requestSpecificCase_ == 8) && (batchCreateInstancesMetadataBuilder_ != null)) { + return batchCreateInstancesMetadataBuilder_.getMessageOrBuilder(); + } else { + if (requestSpecificCase_ == 8) { + return (com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) requestSpecific_; + } + return com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata, + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.Builder, + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadataOrBuilder> + getBatchCreateInstancesMetadataFieldBuilder() { + if (batchCreateInstancesMetadataBuilder_ == null) { + if (!(requestSpecificCase_ == 8)) { + requestSpecific_ = + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.getDefaultInstance(); + } + batchCreateInstancesMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata, + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.Builder, + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadataOrBuilder>( + (com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) requestSpecific_, + getParentForChildren(), + isClean()); + requestSpecific_ = null; + } + requestSpecificCase_ = 8; + onChanged(); + return batchCreateInstancesMetadataBuilder_; + } + + 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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000002); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + target_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + verb_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + verb_ = getDefaultInstance().getVerb(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + verb_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + statusMessage_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + statusMessage_ = getDefaultInstance().getStatusMessage(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + statusMessage_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + bitField0_ = (bitField0_ & ~0x00000040); + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiVersion_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + apiVersion_ = getDefaultInstance().getApiVersion(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiVersion_ = value; + bitField0_ |= 0x00000080; + 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.alloydb.v1alpha.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.OperationMetadata) + private static final com.google.cloud.alloydb.v1alpha.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.OperationMetadata(); + } + + public static com.google.cloud.alloydb.v1alpha.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata 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.alloydb.v1alpha.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/OperationMetadataOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..42363b1248df --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/OperationMetadataOrBuilder.java @@ -0,0 +1,263 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the batchCreateInstancesMetadata field is set. + */ + boolean hasBatchCreateInstancesMetadata(); + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The batchCreateInstancesMetadata. + */ + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata getBatchCreateInstancesMetadata(); + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadataOrBuilder + getBatchCreateInstancesMetadataOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); + + public com.google.cloud.alloydb.v1alpha.OperationMetadata.RequestSpecificCase + getRequestSpecificCase(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/PromoteClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/PromoteClusterRequest.java new file mode 100644 index 000000000000..ec4254510a45 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/PromoteClusterRequest.java @@ -0,0 +1,1196 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for promoting a Cluster
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.PromoteClusterRequest} + */ +public final class PromoteClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.PromoteClusterRequest) + PromoteClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PromoteClusterRequest.newBuilder() to construct. + private PromoteClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PromoteClusterRequest() { + name_ = ""; + requestId_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PromoteClusterRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_PromoteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_PromoteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.PromoteClusterRequest.class, + com.google.cloud.alloydb.v1alpha.PromoteClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Cluster.name field
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + 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.alloydb.v1alpha.PromoteClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.PromoteClusterRequest other = + (com.google.cloud.alloydb.v1alpha.PromoteClusterRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.PromoteClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.PromoteClusterRequest 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.alloydb.v1alpha.PromoteClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.PromoteClusterRequest 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.alloydb.v1alpha.PromoteClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.PromoteClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.PromoteClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.PromoteClusterRequest 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.alloydb.v1alpha.PromoteClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.PromoteClusterRequest 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.alloydb.v1alpha.PromoteClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.PromoteClusterRequest 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.alloydb.v1alpha.PromoteClusterRequest 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; + } + /** + * + * + *
+   * Message for promoting a Cluster
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.PromoteClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.PromoteClusterRequest) + com.google.cloud.alloydb.v1alpha.PromoteClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_PromoteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_PromoteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.PromoteClusterRequest.class, + com.google.cloud.alloydb.v1alpha.PromoteClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.PromoteClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + etag_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_PromoteClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.PromoteClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.PromoteClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.PromoteClusterRequest build() { + com.google.cloud.alloydb.v1alpha.PromoteClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.PromoteClusterRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.PromoteClusterRequest result = + new com.google.cloud.alloydb.v1alpha.PromoteClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.PromoteClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1alpha.PromoteClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.PromoteClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.PromoteClusterRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.PromoteClusterRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = 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.alloydb.v1alpha.PromoteClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.PromoteClusterRequest) + private static final com.google.cloud.alloydb.v1alpha.PromoteClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.PromoteClusterRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.PromoteClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PromoteClusterRequest 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.alloydb.v1alpha.PromoteClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/PromoteClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/PromoteClusterRequestOrBuilder.java new file mode 100644 index 000000000000..2625bb08cec2 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/PromoteClusterRequestOrBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface PromoteClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.PromoteClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ResourcesProto.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ResourcesProto.java new file mode 100644 index 000000000000..b9fa586a3fe0 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ResourcesProto.java @@ -0,0 +1,827 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public final class ResourcesProto { + private ResourcesProto() {} + + 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_alloydb_v1alpha_UserPassword_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_UserPassword_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_MigrationSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_MigrationSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_EncryptionConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_EncryptionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_EncryptionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_EncryptionInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_SslConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_SslConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_WeeklySchedule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_WeeklySchedule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_TimeBasedRetention_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_TimeBasedRetention_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_QuantityBasedRetention_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_QuantityBasedRetention_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_BackupSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_BackupSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Cluster_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Cluster_SecondaryConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Cluster_SecondaryConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Cluster_PrimaryConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Cluster_PrimaryConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Cluster_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Cluster_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Cluster_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Cluster_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Instance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Instance_MachineConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Instance_MachineConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Instance_Node_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Instance_Node_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Instance_QueryInsightsInstanceConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Instance_QueryInsightsInstanceConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Instance_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Instance_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Instance_DatabaseFlagsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Instance_DatabaseFlagsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Instance_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Instance_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_ConnectionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_ConnectionInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Backup_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Backup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Backup_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Backup_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Backup_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Backup_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_StringRestrictions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_StringRestrictions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_IntegerRestrictions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_IntegerRestrictions_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/alloydb/v1alpha/resources" + + ".proto\022\034google.cloud.alloydb.v1alpha\032\037go" + + "ogle/api/field_behavior.proto\032\031google/ap" + + "i/resource.proto\032\036google/protobuf/durati" + + "on.proto\032\037google/protobuf/timestamp.prot" + + "o\032\036google/protobuf/wrappers.proto\032\033googl" + + "e/type/dayofweek.proto\032\033google/type/time" + + "ofday.proto\".\n\014UserPassword\022\014\n\004user\030\001 \001(" + + "\t\022\020\n\010password\030\002 \001(\t\"\350\001\n\017MigrationSource\022" + + "\026\n\thost_port\030\001 \001(\tB\003\340A\003\022\031\n\014reference_id\030" + + "\002 \001(\tB\003\340A\003\022[\n\013source_type\030\003 \001(\0162A.google" + + ".cloud.alloydb.v1alpha.MigrationSource.M" + + "igrationSourceTypeB\003\340A\003\"E\n\023MigrationSour" + + "ceType\022%\n!MIGRATION_SOURCE_TYPE_UNSPECIF" + + "IED\020\000\022\007\n\003DMS\020\001\"(\n\020EncryptionConfig\022\024\n\014km" + + "s_key_name\030\001 \001(\t\"\213\002\n\016EncryptionInfo\022O\n\017e" + + "ncryption_type\030\001 \001(\01621.google.cloud.allo" + + "ydb.v1alpha.EncryptionInfo.TypeB\003\340A\003\022J\n\020" + + "kms_key_versions\030\002 \003(\tB0\340A\003\372A*\n(cloudkms" + + ".googleapis.com/CryptoKeyVersion\"\\\n\004Type" + + "\022\024\n\020TYPE_UNSPECIFIED\020\000\022\035\n\031GOOGLE_DEFAULT" + + "_ENCRYPTION\020\001\022\037\n\033CUSTOMER_MANAGED_ENCRYP" + + "TION\020\002\"\302\002\n\tSslConfig\022F\n\010ssl_mode\030\001 \001(\0162/" + + ".google.cloud.alloydb.v1alpha.SslConfig." + + "SslModeB\003\340A\001\022H\n\tca_source\030\002 \001(\01620.google" + + ".cloud.alloydb.v1alpha.SslConfig.CaSourc" + + "eB\003\340A\001\"e\n\007SslMode\022\030\n\024SSL_MODE_UNSPECIFIE" + + "D\020\000\022\022\n\016SSL_MODE_ALLOW\020\001\022\024\n\020SSL_MODE_REQU" + + "IRE\020\002\022\026\n\022SSL_MODE_VERIFY_CA\020\003\"<\n\010CaSourc" + + "e\022\031\n\025CA_SOURCE_UNSPECIFIED\020\000\022\025\n\021CA_SOURC" + + "E_MANAGED\020\001\"\376\006\n\025AutomatedBackupPolicy\022]\n" + + "\017weekly_schedule\030\002 \001(\0132B.google.cloud.al" + + "loydb.v1alpha.AutomatedBackupPolicy.Week" + + "lyScheduleH\000\022f\n\024time_based_retention\030\004 \001" + + "(\0132F.google.cloud.alloydb.v1alpha.Automa" + + "tedBackupPolicy.TimeBasedRetentionH\001\022n\n\030" + + "quantity_based_retention\030\005 \001(\0132J.google." + + "cloud.alloydb.v1alpha.AutomatedBackupPol" + + "icy.QuantityBasedRetentionH\001\022\024\n\007enabled\030" + + "\001 \001(\010H\002\210\001\001\0220\n\rbackup_window\030\003 \001(\0132\031.goog" + + "le.protobuf.Duration\022N\n\021encryption_confi" + + "g\030\010 \001(\0132..google.cloud.alloydb.v1alpha.E" + + "ncryptionConfigB\003\340A\001\022\020\n\010location\030\006 \001(\t\022O" + + "\n\006labels\030\007 \003(\0132?.google.cloud.alloydb.v1" + + "alpha.AutomatedBackupPolicy.LabelsEntry\032" + + "k\n\016WeeklySchedule\022+\n\013start_times\030\001 \003(\0132\026" + + ".google.type.TimeOfDay\022,\n\014days_of_week\030\002" + + " \003(\0162\026.google.type.DayOfWeek\032I\n\022TimeBase" + + "dRetention\0223\n\020retention_period\030\001 \001(\0132\031.g" + + "oogle.protobuf.Duration\032\'\n\026QuantityBased" + + "Retention\022\r\n\005count\030\001 \001(\005\032-\n\013LabelsEntry\022" + + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\n\n\010sched" + + "uleB\013\n\tretentionB\n\n\010_enabled\"\243\001\n\026Continu" + + "ousBackupConfig\022\024\n\007enabled\030\001 \001(\010H\000\210\001\001\022\034\n" + + "\024recovery_window_days\030\004 \001(\005\022I\n\021encryptio" + + "n_config\030\003 \001(\0132..google.cloud.alloydb.v1" + + "alpha.EncryptionConfigB\n\n\010_enabled\"\310\001\n\024C" + + "ontinuousBackupInfo\022J\n\017encryption_info\030\001" + + " \001(\0132,.google.cloud.alloydb.v1alpha.Encr" + + "yptionInfoB\003\340A\003\0225\n\014enabled_time\030\002 \001(\0132\032." + + "google.protobuf.TimestampB\003\340A\003\022-\n\010schedu" + + "le\030\003 \003(\0162\026.google.type.DayOfWeekB\003\340A\003\"c\n" + + "\014BackupSource\022\027\n\nbackup_uid\030\002 \001(\tB\003\340A\003\022:" + + "\n\013backup_name\030\001 \001(\tB%\340A\002\372A\037\n\035alloydb.goo" + + "gleapis.com/Backup\"f\n\026ContinuousBackupSo" + + "urce\022\024\n\007cluster\030\001 \001(\tB\003\340A\002\0226\n\rpoint_in_t" + + "ime\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340" + + "A\002\"\276\020\n\007Cluster\022H\n\rbackup_source\030\017 \001(\0132*." + + "google.cloud.alloydb.v1alpha.BackupSourc" + + "eB\003\340A\003H\000\022N\n\020migration_source\030\020 \001(\0132-.goo" + + "gle.cloud.alloydb.v1alpha.MigrationSourc" + + "eB\003\340A\003H\000\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\024\n\014display_n" + + "ame\030\002 \001(\t\022\020\n\003uid\030\003 \001(\tB\003\340A\003\0224\n\013create_ti" + + "me\030\004 \001(\0132\032.google.protobuf.TimestampB\003\340A" + + "\003\0224\n\013update_time\030\005 \001(\0132\032.google.protobuf" + + ".TimestampB\003\340A\003\0224\n\013delete_time\030\006 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\003\340A\003\022A\n\006labels\030" + + "\007 \003(\01321.google.cloud.alloydb.v1alpha.Clu" + + "ster.LabelsEntry\022?\n\005state\030\010 \001(\0162+.google" + + ".cloud.alloydb.v1alpha.Cluster.StateB\003\340A" + + "\003\022L\n\014cluster_type\030\030 \001(\01621.google.cloud.a" + + "lloydb.v1alpha.Cluster.ClusterTypeB\003\340A\003\022" + + "L\n\020database_version\030\t \001(\0162-.google.cloud" + + ".alloydb.v1alpha.DatabaseVersionB\003\340A\003\0227\n" + + "\007network\030\n \001(\tB&\340A\002\372A \n\036compute.googleap" + + "is.com/Network\022\014\n\004etag\030\013 \001(\t\022K\n\013annotati" + + "ons\030\014 \003(\01326.google.cloud.alloydb.v1alpha" + + ".Cluster.AnnotationsEntry\022\030\n\013reconciling" + + "\030\r \001(\010B\003\340A\003\022E\n\014initial_user\030\016 \001(\0132*.goog" + + "le.cloud.alloydb.v1alpha.UserPasswordB\003\340" + + "A\004\022T\n\027automated_backup_policy\030\021 \001(\01323.go" + + "ogle.cloud.alloydb.v1alpha.AutomatedBack" + + "upPolicy\022;\n\nssl_config\030\022 \001(\0132\'.google.cl" + + "oud.alloydb.v1alpha.SslConfig\022N\n\021encrypt" + + "ion_config\030\023 \001(\0132..google.cloud.alloydb." + + "v1alpha.EncryptionConfigB\003\340A\001\022J\n\017encrypt" + + "ion_info\030\024 \001(\0132,.google.cloud.alloydb.v1" + + "alpha.EncryptionInfoB\003\340A\003\022[\n\030continuous_" + + "backup_config\030\033 \001(\01324.google.cloud.alloy" + + "db.v1alpha.ContinuousBackupConfigB\003\340A\001\022W" + + "\n\026continuous_backup_info\030\034 \001(\01322.google." + + "cloud.alloydb.v1alpha.ContinuousBackupIn" + + "foB\003\340A\003\022O\n\020secondary_config\030\026 \001(\01325.goog" + + "le.cloud.alloydb.v1alpha.Cluster.Seconda" + + "ryConfig\022P\n\016primary_config\030\027 \001(\01323.googl" + + "e.cloud.alloydb.v1alpha.Cluster.PrimaryC" + + "onfigB\003\340A\003\032/\n\017SecondaryConfig\022\034\n\024primary" + + "_cluster_name\030\001 \001(\t\0325\n\rPrimaryConfig\022$\n\027" + + "secondary_cluster_names\030\001 \003(\tB\003\340A\003\032-\n\013La" + + "belsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028" + + "\001\0322\n\020AnnotationsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" + + "lue\030\002 \001(\t:\0028\001\"\234\001\n\005State\022\025\n\021STATE_UNSPECI" + + "FIED\020\000\022\t\n\005READY\020\001\022\013\n\007STOPPED\020\002\022\t\n\005EMPTY\020" + + "\003\022\014\n\010CREATING\020\004\022\014\n\010DELETING\020\005\022\n\n\006FAILED\020" + + "\006\022\021\n\rBOOTSTRAPPING\020\007\022\017\n\013MAINTENANCE\020\010\022\r\n" + + "\tPROMOTING\020\t\"G\n\013ClusterType\022\034\n\030CLUSTER_T" + + "YPE_UNSPECIFIED\020\000\022\013\n\007PRIMARY\020\001\022\r\n\tSECOND" + + "ARY\020\002:b\352A_\n\036alloydb.googleapis.com/Clust" + + "er\022:projects/{project}/locations/{locati" + + "on}/clusters/{cluster}R\001\001B\010\n\006source\"\352\020\n\010" + + "Instance\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\024\n\014display_n" + + "ame\030\002 \001(\t\022\020\n\003uid\030\003 \001(\tB\003\340A\003\0224\n\013create_ti" + + "me\030\004 \001(\0132\032.google.protobuf.TimestampB\003\340A" + + "\003\0224\n\013update_time\030\005 \001(\0132\032.google.protobuf" + + ".TimestampB\003\340A\003\0224\n\013delete_time\030\006 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\003\340A\003\022B\n\006labels\030" + + "\007 \003(\01322.google.cloud.alloydb.v1alpha.Ins" + + "tance.LabelsEntry\022@\n\005state\030\010 \001(\0162,.googl" + + "e.cloud.alloydb.v1alpha.Instance.StateB\003" + + "\340A\003\022O\n\rinstance_type\030\t \001(\01623.google.clou" + + "d.alloydb.v1alpha.Instance.InstanceTypeB" + + "\003\340A\002\022L\n\016machine_config\030\n \001(\01324.google.cl" + + "oud.alloydb.v1alpha.Instance.MachineConf" + + "ig\022R\n\021availability_type\030\013 \001(\01627.google.c" + + "loud.alloydb.v1alpha.Instance.Availabili" + + "tyType\022\020\n\010gce_zone\030\014 \001(\t\022Q\n\016database_fla" + + "gs\030\r \003(\01329.google.cloud.alloydb.v1alpha." + + "Instance.DatabaseFlagsEntry\022G\n\rwritable_" + + "node\030\023 \001(\0132+.google.cloud.alloydb.v1alph" + + "a.Instance.NodeB\003\340A\003\022?\n\005nodes\030\024 \003(\0132+.go" + + "ogle.cloud.alloydb.v1alpha.Instance.Node" + + "B\003\340A\003\022a\n\025query_insights_config\030\025 \001(\0132B.g" + + "oogle.cloud.alloydb.v1alpha.Instance.Que" + + "ryInsightsInstanceConfig\022O\n\020read_pool_co" + + "nfig\030\016 \001(\01325.google.cloud.alloydb.v1alph" + + "a.Instance.ReadPoolConfig\022\027\n\nip_address\030" + + "\017 \001(\tB\003\340A\003\022\030\n\013reconciling\030\020 \001(\010B\003\340A\003\022\014\n\004" + + "etag\030\021 \001(\t\022L\n\013annotations\030\022 \003(\01327.google" + + ".cloud.alloydb.v1alpha.Instance.Annotati" + + "onsEntry\032\"\n\rMachineConfig\022\021\n\tcpu_count\030\001" + + " \001(\005\032>\n\004Node\022\017\n\007zone_id\030\001 \001(\t\022\n\n\002id\030\002 \001(" + + "\t\022\n\n\002ip\030\003 \001(\t\022\r\n\005state\030\004 \001(\t\032\372\001\n\033QueryIn" + + "sightsInstanceConfig\022$\n\027record_applicati" + + "on_tags\030\002 \001(\010H\000\210\001\001\022\"\n\025record_client_addr" + + "ess\030\003 \001(\010H\001\210\001\001\022\033\n\023query_string_length\030\004 " + + "\001(\r\022#\n\026query_plans_per_minute\030\005 \001(\rH\002\210\001\001" + + "B\032\n\030_record_application_tagsB\030\n\026_record_" + + "client_addressB\031\n\027_query_plans_per_minut" + + "e\032$\n\016ReadPoolConfig\022\022\n\nnode_count\030\001 \001(\005\032" + + "-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" + + "(\t:\0028\001\0324\n\022DatabaseFlagsEntry\022\013\n\003key\030\001 \001(" + + "\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020AnnotationsEntry" + + "\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\221\001\n\005Sta" + + "te\022\025\n\021STATE_UNSPECIFIED\020\000\022\t\n\005READY\020\001\022\013\n\007" + + "STOPPED\020\002\022\014\n\010CREATING\020\003\022\014\n\010DELETING\020\004\022\017\n" + + "\013MAINTENANCE\020\005\022\n\n\006FAILED\020\006\022\021\n\rBOOTSTRAPP" + + "ING\020\010\022\r\n\tPROMOTING\020\t\"X\n\014InstanceType\022\035\n\031" + + "INSTANCE_TYPE_UNSPECIFIED\020\000\022\013\n\007PRIMARY\020\001" + + "\022\r\n\tREAD_POOL\020\002\022\r\n\tSECONDARY\020\003\"N\n\020Availa" + + "bilityType\022!\n\035AVAILABILITY_TYPE_UNSPECIF" + + "IED\020\000\022\t\n\005ZONAL\020\001\022\014\n\010REGIONAL\020\002:x\352Au\n\037all" + + "oydb.googleapis.com/Instance\022Oprojects/{" + + "project}/locations/{location}/clusters/{" + + "cluster}/instances/{instance}R\001\001\"\204\002\n\016Con" + + "nectionInfo\022\014\n\004name\030\001 \001(\t\022\027\n\nip_address\030" + + "\002 \001(\tB\003\340A\003\022\"\n\025pem_certificate_chain\030\003 \003(" + + "\tB\003\340A\003\022\031\n\014instance_uid\030\004 \001(\tB\003\340A\003:\213\001\352A\207\001" + + "\n%alloydb.googleapis.com/ConnectionInfo\022" + + "^projects/{project}/locations/{location}" + + "/clusters/{cluster}/instances/{instance}" + + "/connectionInfo\"\317\t\n\006Backup\022\021\n\004name\030\001 \001(\t" + + "B\003\340A\003\022\024\n\014display_name\030\002 \001(\t\022\020\n\003uid\030\003 \001(\t" + + "B\003\340A\003\0224\n\013create_time\030\004 \001(\0132\032.google.prot" + + "obuf.TimestampB\003\340A\003\0224\n\013update_time\030\005 \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\0224\n\013del" + + "ete_time\030\017 \001(\0132\032.google.protobuf.Timesta" + + "mpB\003\340A\003\022@\n\006labels\030\006 \003(\01320.google.cloud.a" + + "lloydb.v1alpha.Backup.LabelsEntry\022>\n\005sta" + + "te\030\007 \001(\0162*.google.cloud.alloydb.v1alpha." + + "Backup.StateB\003\340A\003\0227\n\004type\030\010 \001(\0162).google" + + ".cloud.alloydb.v1alpha.Backup.Type\022\023\n\013de" + + "scription\030\t \001(\t\022\030\n\013cluster_uid\030\022 \001(\tB\003\340A" + + "\003\022<\n\014cluster_name\030\n \001(\tB&\340A\002\372A \n\036alloydb" + + ".googleapis.com/Cluster\022\030\n\013reconciling\030\013" + + " \001(\010B\003\340A\003\022N\n\021encryption_config\030\014 \001(\0132..g" + + "oogle.cloud.alloydb.v1alpha.EncryptionCo" + + "nfigB\003\340A\001\022J\n\017encryption_info\030\r \001(\0132,.goo" + + "gle.cloud.alloydb.v1alpha.EncryptionInfo" + + "B\003\340A\003\022\014\n\004etag\030\016 \001(\t\022J\n\013annotations\030\020 \003(\013" + + "25.google.cloud.alloydb.v1alpha.Backup.A" + + "nnotationsEntry\022\027\n\nsize_bytes\030\021 \001(\003B\003\340A\003" + + "\0224\n\013expiry_time\030\023 \001(\0132\032.google.protobuf." + + "TimestampB\003\340A\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001" + + "(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020AnnotationsEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"Q\n\005Sta" + + "te\022\025\n\021STATE_UNSPECIFIED\020\000\022\t\n\005READY\020\001\022\014\n\010" + + "CREATING\020\002\022\n\n\006FAILED\020\003\022\014\n\010DELETING\020\004\"J\n\004" + + "Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\r\n\tON_DEMAND\020" + + "\001\022\r\n\tAUTOMATED\020\002\022\016\n\nCONTINUOUS\020\003:_\352A\\\n\035a" + + "lloydb.googleapis.com/Backup\0228projects/{" + + "project}/locations/{location}/backups/{b" + + "ackup}R\001\001\"\334\006\n\025SupportedDatabaseFlag\022e\n\023s" + + "tring_restrictions\030\007 \001(\0132F.google.cloud." + + "alloydb.v1alpha.SupportedDatabaseFlag.St" + + "ringRestrictionsH\000\022g\n\024integer_restrictio" + + "ns\030\010 \001(\0132G.google.cloud.alloydb.v1alpha." + + "SupportedDatabaseFlag.IntegerRestriction" + + "sH\000\022\014\n\004name\030\001 \001(\t\022\021\n\tflag_name\030\002 \001(\t\022Q\n\n" + + "value_type\030\003 \001(\0162=.google.cloud.alloydb." + + "v1alpha.SupportedDatabaseFlag.ValueType\022" + + "\037\n\027accepts_multiple_values\030\004 \001(\010\022L\n\025supp" + + "orted_db_versions\030\005 \003(\0162-.google.cloud.a" + + "lloydb.v1alpha.DatabaseVersion\022\033\n\023requir" + + "es_db_restart\030\006 \001(\010\032,\n\022StringRestriction" + + "s\022\026\n\016allowed_values\030\001 \003(\t\032u\n\023IntegerRest" + + "rictions\022.\n\tmin_value\030\001 \001(\0132\033.google.pro" + + "tobuf.Int64Value\022.\n\tmax_value\030\002 \001(\0132\033.go" + + "ogle.protobuf.Int64Value\"U\n\tValueType\022\032\n" + + "\026VALUE_TYPE_UNSPECIFIED\020\000\022\n\n\006STRING\020\001\022\013\n" + + "\007INTEGER\020\002\022\t\n\005FLOAT\020\003\022\010\n\004NONE\020\004:g\352Ad\n,al" + + "loydb.googleapis.com/SupportedDatabaseFl" + + "ag\0224projects/{project}/locations/{locati" + + "on}/flags/{flag}B\016\n\014restrictions*Y\n\017Data" + + "baseVersion\022 \n\034DATABASE_VERSION_UNSPECIF" + + "IED\020\000\022\023\n\013POSTGRES_13\020\001\032\002\010\001\022\017\n\013POSTGRES_1" + + "4\020\002*^\n\014InstanceView\022\035\n\031INSTANCE_VIEW_UNS" + + "PECIFIED\020\000\022\027\n\023INSTANCE_VIEW_BASIC\020\001\022\026\n\022I" + + "NSTANCE_VIEW_FULL\020\002B\313\003\n com.google.cloud" + + ".alloydb.v1alphaB\016ResourcesProtoP\001Z:clou" + + "d.google.com/go/alloydb/apiv1alpha/alloy" + + "dbpb;alloydbpb\252\002\034Google.Cloud.AlloyDb.V1" + + "Alpha\312\002\034Google\\Cloud\\AlloyDb\\V1alpha\352\002\037G" + + "oogle::Cloud::AlloyDb::V1alpha\352A\246\001\n(clou" + + "dkms.googleapis.com/CryptoKeyVersion\022zpr" + + "ojects/{project}/locations/{location}/ke" + + "yRings/{key_ring}/cryptoKeys/{crypto_key" + + "}/cryptoKeyVersions/{crypto_key_version}" + + "\352AN\n\036compute.googleapis.com/Network\022,pro" + + "jects/{project}/global/networks/{network" + + "}b\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.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + com.google.type.DayOfWeekProto.getDescriptor(), + com.google.type.TimeOfDayProto.getDescriptor(), + }); + internal_static_google_cloud_alloydb_v1alpha_UserPassword_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_alloydb_v1alpha_UserPassword_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_UserPassword_descriptor, + new java.lang.String[] { + "User", "Password", + }); + internal_static_google_cloud_alloydb_v1alpha_MigrationSource_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_alloydb_v1alpha_MigrationSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_MigrationSource_descriptor, + new java.lang.String[] { + "HostPort", "ReferenceId", "SourceType", + }); + internal_static_google_cloud_alloydb_v1alpha_EncryptionConfig_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_alloydb_v1alpha_EncryptionConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_EncryptionConfig_descriptor, + new java.lang.String[] { + "KmsKeyName", + }); + internal_static_google_cloud_alloydb_v1alpha_EncryptionInfo_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_alloydb_v1alpha_EncryptionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_EncryptionInfo_descriptor, + new java.lang.String[] { + "EncryptionType", "KmsKeyVersions", + }); + internal_static_google_cloud_alloydb_v1alpha_SslConfig_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_alloydb_v1alpha_SslConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_SslConfig_descriptor, + new java.lang.String[] { + "SslMode", "CaSource", + }); + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_descriptor, + new java.lang.String[] { + "WeeklySchedule", + "TimeBasedRetention", + "QuantityBasedRetention", + "Enabled", + "BackupWindow", + "EncryptionConfig", + "Location", + "Labels", + "Schedule", + "Retention", + "Enabled", + }); + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_WeeklySchedule_descriptor = + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_WeeklySchedule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_WeeklySchedule_descriptor, + new java.lang.String[] { + "StartTimes", "DaysOfWeek", + }); + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_TimeBasedRetention_descriptor = + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_TimeBasedRetention_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_TimeBasedRetention_descriptor, + new java.lang.String[] { + "RetentionPeriod", + }); + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_QuantityBasedRetention_descriptor = + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_QuantityBasedRetention_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_QuantityBasedRetention_descriptor, + new java.lang.String[] { + "Count", + }); + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_descriptor + .getNestedTypes() + .get(3); + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_AutomatedBackupPolicy_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupConfig_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupConfig_descriptor, + new java.lang.String[] { + "Enabled", "RecoveryWindowDays", "EncryptionConfig", "Enabled", + }); + internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupInfo_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupInfo_descriptor, + new java.lang.String[] { + "EncryptionInfo", "EnabledTime", "Schedule", + }); + internal_static_google_cloud_alloydb_v1alpha_BackupSource_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_alloydb_v1alpha_BackupSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_BackupSource_descriptor, + new java.lang.String[] { + "BackupUid", "BackupName", + }); + internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupSource_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupSource_descriptor, + new java.lang.String[] { + "Cluster", "PointInTime", + }); + internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_alloydb_v1alpha_Cluster_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor, + new java.lang.String[] { + "BackupSource", + "MigrationSource", + "Name", + "DisplayName", + "Uid", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Labels", + "State", + "ClusterType", + "DatabaseVersion", + "Network", + "Etag", + "Annotations", + "Reconciling", + "InitialUser", + "AutomatedBackupPolicy", + "SslConfig", + "EncryptionConfig", + "EncryptionInfo", + "ContinuousBackupConfig", + "ContinuousBackupInfo", + "SecondaryConfig", + "PrimaryConfig", + "Source", + }); + internal_static_google_cloud_alloydb_v1alpha_Cluster_SecondaryConfig_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_alloydb_v1alpha_Cluster_SecondaryConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Cluster_SecondaryConfig_descriptor, + new java.lang.String[] { + "PrimaryClusterName", + }); + internal_static_google_cloud_alloydb_v1alpha_Cluster_PrimaryConfig_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_alloydb_v1alpha_Cluster_PrimaryConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Cluster_PrimaryConfig_descriptor, + new java.lang.String[] { + "SecondaryClusterNames", + }); + internal_static_google_cloud_alloydb_v1alpha_Cluster_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_alloydb_v1alpha_Cluster_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Cluster_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1alpha_Cluster_AnnotationsEntry_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor.getNestedTypes().get(3); + internal_static_google_cloud_alloydb_v1alpha_Cluster_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Cluster_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_alloydb_v1alpha_Instance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Uid", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Labels", + "State", + "InstanceType", + "MachineConfig", + "AvailabilityType", + "GceZone", + "DatabaseFlags", + "WritableNode", + "Nodes", + "QueryInsightsConfig", + "ReadPoolConfig", + "IpAddress", + "Reconciling", + "Etag", + "Annotations", + }); + internal_static_google_cloud_alloydb_v1alpha_Instance_MachineConfig_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_alloydb_v1alpha_Instance_MachineConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Instance_MachineConfig_descriptor, + new java.lang.String[] { + "CpuCount", + }); + internal_static_google_cloud_alloydb_v1alpha_Instance_Node_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_alloydb_v1alpha_Instance_Node_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Instance_Node_descriptor, + new java.lang.String[] { + "ZoneId", "Id", "Ip", "State", + }); + internal_static_google_cloud_alloydb_v1alpha_Instance_QueryInsightsInstanceConfig_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_alloydb_v1alpha_Instance_QueryInsightsInstanceConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Instance_QueryInsightsInstanceConfig_descriptor, + new java.lang.String[] { + "RecordApplicationTags", + "RecordClientAddress", + "QueryStringLength", + "QueryPlansPerMinute", + "RecordApplicationTags", + "RecordClientAddress", + "QueryPlansPerMinute", + }); + internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor.getNestedTypes().get(3); + internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_descriptor, + new java.lang.String[] { + "NodeCount", + }); + internal_static_google_cloud_alloydb_v1alpha_Instance_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor.getNestedTypes().get(4); + internal_static_google_cloud_alloydb_v1alpha_Instance_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Instance_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1alpha_Instance_DatabaseFlagsEntry_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor.getNestedTypes().get(5); + internal_static_google_cloud_alloydb_v1alpha_Instance_DatabaseFlagsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Instance_DatabaseFlagsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1alpha_Instance_AnnotationsEntry_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor.getNestedTypes().get(6); + internal_static_google_cloud_alloydb_v1alpha_Instance_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Instance_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1alpha_ConnectionInfo_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_alloydb_v1alpha_ConnectionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_ConnectionInfo_descriptor, + new java.lang.String[] { + "Name", "IpAddress", "PemCertificateChain", "InstanceUid", + }); + internal_static_google_cloud_alloydb_v1alpha_Backup_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_alloydb_v1alpha_Backup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Backup_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Uid", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Labels", + "State", + "Type", + "Description", + "ClusterUid", + "ClusterName", + "Reconciling", + "EncryptionConfig", + "EncryptionInfo", + "Etag", + "Annotations", + "SizeBytes", + "ExpiryTime", + }); + internal_static_google_cloud_alloydb_v1alpha_Backup_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Backup_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_alloydb_v1alpha_Backup_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Backup_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1alpha_Backup_AnnotationsEntry_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Backup_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_alloydb_v1alpha_Backup_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Backup_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_descriptor, + new java.lang.String[] { + "StringRestrictions", + "IntegerRestrictions", + "Name", + "FlagName", + "ValueType", + "AcceptsMultipleValues", + "SupportedDbVersions", + "RequiresDbRestart", + "Restrictions", + }); + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_StringRestrictions_descriptor = + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_StringRestrictions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_StringRestrictions_descriptor, + new java.lang.String[] { + "AllowedValues", + }); + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_IntegerRestrictions_descriptor = + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_IntegerRestrictions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_IntegerRestrictions_descriptor, + new java.lang.String[] { + "MinValue", "MaxValue", + }); + 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.resourceDefinition); + 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.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + com.google.type.DayOfWeekProto.getDescriptor(); + com.google.type.TimeOfDayProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/RestartInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/RestartInstanceRequest.java new file mode 100644 index 000000000000..4f80e9b817ee --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/RestartInstanceRequest.java @@ -0,0 +1,984 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** Protobuf type {@code google.cloud.alloydb.v1alpha.RestartInstanceRequest} */ +public final class RestartInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.RestartInstanceRequest) + RestartInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RestartInstanceRequest.newBuilder() to construct. + private RestartInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestartInstanceRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestartInstanceRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_RestartInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_RestartInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.RestartInstanceRequest.class, + com.google.cloud.alloydb.v1alpha.RestartInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the restart.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + 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.alloydb.v1alpha.RestartInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.RestartInstanceRequest other = + (com.google.cloud.alloydb.v1alpha.RestartInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.RestartInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.RestartInstanceRequest 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.alloydb.v1alpha.RestartInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.RestartInstanceRequest 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.alloydb.v1alpha.RestartInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.RestartInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.RestartInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.RestartInstanceRequest 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.alloydb.v1alpha.RestartInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.RestartInstanceRequest 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.alloydb.v1alpha.RestartInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.RestartInstanceRequest 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.alloydb.v1alpha.RestartInstanceRequest 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.alloydb.v1alpha.RestartInstanceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.RestartInstanceRequest) + com.google.cloud.alloydb.v1alpha.RestartInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_RestartInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_RestartInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.RestartInstanceRequest.class, + com.google.cloud.alloydb.v1alpha.RestartInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.RestartInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_RestartInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.RestartInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.RestartInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.RestartInstanceRequest build() { + com.google.cloud.alloydb.v1alpha.RestartInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.RestartInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.RestartInstanceRequest result = + new com.google.cloud.alloydb.v1alpha.RestartInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.RestartInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1alpha.RestartInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.RestartInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.RestartInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.RestartInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + 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 java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the restart.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the restart.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the restart.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = 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.alloydb.v1alpha.RestartInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.RestartInstanceRequest) + private static final com.google.cloud.alloydb.v1alpha.RestartInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.RestartInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.RestartInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestartInstanceRequest 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.alloydb.v1alpha.RestartInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/RestartInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/RestartInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..2d209e339023 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/RestartInstanceRequestOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface RestartInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.RestartInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the restart.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/RestoreClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/RestoreClusterRequest.java new file mode 100644 index 000000000000..bf1b865adb47 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/RestoreClusterRequest.java @@ -0,0 +1,2172 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for restoring a Cluster from a backup or another cluster at a given
+ * point in time.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.RestoreClusterRequest} + */ +public final class RestoreClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.RestoreClusterRequest) + RestoreClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RestoreClusterRequest.newBuilder() to construct. + private RestoreClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestoreClusterRequest() { + parent_ = ""; + clusterId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestoreClusterRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_RestoreClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_RestoreClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.RestoreClusterRequest.class, + com.google.cloud.alloydb.v1alpha.RestoreClusterRequest.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BACKUP_SOURCE(4), + CONTINUOUS_BACKUP_SOURCE(8), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 4: + return BACKUP_SOURCE; + case 8: + return CONTINUOUS_BACKUP_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int BACKUP_SOURCE_FIELD_NUMBER = 4; + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + * + * @return Whether the backupSource field is set. + */ + @java.lang.Override + public boolean hasBackupSource() { + return sourceCase_ == 4; + } + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + * + * @return The backupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BackupSource getBackupSource() { + if (sourceCase_ == 4) { + return (com.google.cloud.alloydb.v1alpha.BackupSource) source_; + } + return com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance(); + } + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BackupSourceOrBuilder getBackupSourceOrBuilder() { + if (sourceCase_ == 4) { + return (com.google.cloud.alloydb.v1alpha.BackupSource) source_; + } + return com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance(); + } + + public static final int CONTINUOUS_BACKUP_SOURCE_FIELD_NUMBER = 8; + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + * + * @return Whether the continuousBackupSource field is set. + */ + @java.lang.Override + public boolean hasContinuousBackupSource() { + return sourceCase_ == 8; + } + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + * + * @return The continuousBackupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupSource getContinuousBackupSource() { + if (sourceCase_ == 8) { + return (com.google.cloud.alloydb.v1alpha.ContinuousBackupSource) source_; + } + return com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.getDefaultInstance(); + } + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupSourceOrBuilder + getContinuousBackupSourceOrBuilder() { + if (sourceCase_ == 8) { + return (com.google.cloud.alloydb.v1alpha.ContinuousBackupSource) source_; + } + return com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.getDefaultInstance(); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 CLUSTER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + @java.lang.Override + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + 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(); + clusterId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1alpha.Cluster cluster_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + @java.lang.Override + public boolean hasCluster() { + return cluster_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster getCluster() { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 6; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the import
+   * request.
+   * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clusterId_); + } + if (cluster_ != null) { + output.writeMessage(3, getCluster()); + } + if (sourceCase_ == 4) { + output.writeMessage(4, (com.google.cloud.alloydb.v1alpha.BackupSource) source_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(6, validateOnly_); + } + if (sourceCase_ == 8) { + output.writeMessage(8, (com.google.cloud.alloydb.v1alpha.ContinuousBackupSource) source_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clusterId_); + } + if (cluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCluster()); + } + if (sourceCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.alloydb.v1alpha.BackupSource) source_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, validateOnly_); + } + if (sourceCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.alloydb.v1alpha.ContinuousBackupSource) source_); + } + 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.alloydb.v1alpha.RestoreClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.RestoreClusterRequest other = + (com.google.cloud.alloydb.v1alpha.RestoreClusterRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getClusterId().equals(other.getClusterId())) return false; + if (hasCluster() != other.hasCluster()) return false; + if (hasCluster()) { + if (!getCluster().equals(other.getCluster())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 4: + if (!getBackupSource().equals(other.getBackupSource())) return false; + break; + case 8: + if (!getContinuousBackupSource().equals(other.getContinuousBackupSource())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getClusterId().hashCode(); + if (hasCluster()) { + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + switch (sourceCase_) { + case 4: + hash = (37 * hash) + BACKUP_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getBackupSource().hashCode(); + break; + case 8: + hash = (37 * hash) + CONTINUOUS_BACKUP_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getContinuousBackupSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.RestoreClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.RestoreClusterRequest 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.alloydb.v1alpha.RestoreClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.RestoreClusterRequest 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.alloydb.v1alpha.RestoreClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.RestoreClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.RestoreClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.RestoreClusterRequest 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.alloydb.v1alpha.RestoreClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.RestoreClusterRequest 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.alloydb.v1alpha.RestoreClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.RestoreClusterRequest 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.alloydb.v1alpha.RestoreClusterRequest 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; + } + /** + * + * + *
+   * Message for restoring a Cluster from a backup or another cluster at a given
+   * point in time.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.RestoreClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.RestoreClusterRequest) + com.google.cloud.alloydb.v1alpha.RestoreClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_RestoreClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_RestoreClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.RestoreClusterRequest.class, + com.google.cloud.alloydb.v1alpha.RestoreClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.RestoreClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (backupSourceBuilder_ != null) { + backupSourceBuilder_.clear(); + } + if (continuousBackupSourceBuilder_ != null) { + continuousBackupSourceBuilder_.clear(); + } + parent_ = ""; + clusterId_ = ""; + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_RestoreClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.RestoreClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.RestoreClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.RestoreClusterRequest build() { + com.google.cloud.alloydb.v1alpha.RestoreClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.RestoreClusterRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.RestoreClusterRequest result = + new com.google.cloud.alloydb.v1alpha.RestoreClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.RestoreClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.clusterId_ = clusterId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + private void buildPartialOneofs(com.google.cloud.alloydb.v1alpha.RestoreClusterRequest result) { + result.sourceCase_ = sourceCase_; + result.source_ = this.source_; + if (sourceCase_ == 4 && backupSourceBuilder_ != null) { + result.source_ = backupSourceBuilder_.build(); + } + if (sourceCase_ == 8 && continuousBackupSourceBuilder_ != null) { + result.source_ = continuousBackupSourceBuilder_.build(); + } + } + + @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.alloydb.v1alpha.RestoreClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.RestoreClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.RestoreClusterRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.RestoreClusterRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getClusterId().isEmpty()) { + clusterId_ = other.clusterId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasCluster()) { + mergeCluster(other.getCluster()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + switch (other.getSourceCase()) { + case BACKUP_SOURCE: + { + mergeBackupSource(other.getBackupSource()); + break; + } + case CONTINUOUS_BACKUP_SOURCE: + { + mergeContinuousBackupSource(other.getContinuousBackupSource()); + break; + } + case SOURCE_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: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 18: + { + clusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 26: + { + input.readMessage(getClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 26 + case 34: + { + input.readMessage(getBackupSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 4; + break; + } // case 34 + case 42: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 48: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 48 + case 66: + { + input.readMessage( + getContinuousBackupSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 8; + break; + } // case 66 + 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 sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.BackupSource, + com.google.cloud.alloydb.v1alpha.BackupSource.Builder, + com.google.cloud.alloydb.v1alpha.BackupSourceOrBuilder> + backupSourceBuilder_; + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + * + * @return Whether the backupSource field is set. + */ + @java.lang.Override + public boolean hasBackupSource() { + return sourceCase_ == 4; + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + * + * @return The backupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BackupSource getBackupSource() { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 4) { + return (com.google.cloud.alloydb.v1alpha.BackupSource) source_; + } + return com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance(); + } else { + if (sourceCase_ == 4) { + return backupSourceBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + */ + public Builder setBackupSource(com.google.cloud.alloydb.v1alpha.BackupSource value) { + if (backupSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + backupSourceBuilder_.setMessage(value); + } + sourceCase_ = 4; + return this; + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + */ + public Builder setBackupSource( + com.google.cloud.alloydb.v1alpha.BackupSource.Builder builderForValue) { + if (backupSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + backupSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 4; + return this; + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + */ + public Builder mergeBackupSource(com.google.cloud.alloydb.v1alpha.BackupSource value) { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 4 + && source_ != com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance()) { + source_ = + com.google.cloud.alloydb.v1alpha.BackupSource.newBuilder( + (com.google.cloud.alloydb.v1alpha.BackupSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 4) { + backupSourceBuilder_.mergeFrom(value); + } else { + backupSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 4; + return this; + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + */ + public Builder clearBackupSource() { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 4) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 4) { + sourceCase_ = 0; + source_ = null; + } + backupSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + */ + public com.google.cloud.alloydb.v1alpha.BackupSource.Builder getBackupSourceBuilder() { + return getBackupSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BackupSourceOrBuilder getBackupSourceOrBuilder() { + if ((sourceCase_ == 4) && (backupSourceBuilder_ != null)) { + return backupSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 4) { + return (com.google.cloud.alloydb.v1alpha.BackupSource) source_; + } + return com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.BackupSource, + com.google.cloud.alloydb.v1alpha.BackupSource.Builder, + com.google.cloud.alloydb.v1alpha.BackupSourceOrBuilder> + getBackupSourceFieldBuilder() { + if (backupSourceBuilder_ == null) { + if (!(sourceCase_ == 4)) { + source_ = com.google.cloud.alloydb.v1alpha.BackupSource.getDefaultInstance(); + } + backupSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.BackupSource, + com.google.cloud.alloydb.v1alpha.BackupSource.Builder, + com.google.cloud.alloydb.v1alpha.BackupSourceOrBuilder>( + (com.google.cloud.alloydb.v1alpha.BackupSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 4; + onChanged(); + return backupSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource, + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.Builder, + com.google.cloud.alloydb.v1alpha.ContinuousBackupSourceOrBuilder> + continuousBackupSourceBuilder_; + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + * + * + * @return Whether the continuousBackupSource field is set. + */ + @java.lang.Override + public boolean hasContinuousBackupSource() { + return sourceCase_ == 8; + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + * + * + * @return The continuousBackupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupSource getContinuousBackupSource() { + if (continuousBackupSourceBuilder_ == null) { + if (sourceCase_ == 8) { + return (com.google.cloud.alloydb.v1alpha.ContinuousBackupSource) source_; + } + return com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.getDefaultInstance(); + } else { + if (sourceCase_ == 8) { + return continuousBackupSourceBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + * + */ + public Builder setContinuousBackupSource( + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource value) { + if (continuousBackupSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + continuousBackupSourceBuilder_.setMessage(value); + } + sourceCase_ = 8; + return this; + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + * + */ + public Builder setContinuousBackupSource( + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.Builder builderForValue) { + if (continuousBackupSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + continuousBackupSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 8; + return this; + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + * + */ + public Builder mergeContinuousBackupSource( + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource value) { + if (continuousBackupSourceBuilder_ == null) { + if (sourceCase_ == 8 + && source_ + != com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.getDefaultInstance()) { + source_ = + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.newBuilder( + (com.google.cloud.alloydb.v1alpha.ContinuousBackupSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 8) { + continuousBackupSourceBuilder_.mergeFrom(value); + } else { + continuousBackupSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 8; + return this; + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + * + */ + public Builder clearContinuousBackupSource() { + if (continuousBackupSourceBuilder_ == null) { + if (sourceCase_ == 8) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 8) { + sourceCase_ = 0; + source_ = null; + } + continuousBackupSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + * + */ + public com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.Builder + getContinuousBackupSourceBuilder() { + return getContinuousBackupSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ContinuousBackupSourceOrBuilder + getContinuousBackupSourceOrBuilder() { + if ((sourceCase_ == 8) && (continuousBackupSourceBuilder_ != null)) { + return continuousBackupSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 8) { + return (com.google.cloud.alloydb.v1alpha.ContinuousBackupSource) source_; + } + return com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource, + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.Builder, + com.google.cloud.alloydb.v1alpha.ContinuousBackupSourceOrBuilder> + getContinuousBackupSourceFieldBuilder() { + if (continuousBackupSourceBuilder_ == null) { + if (!(sourceCase_ == 8)) { + source_ = com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.getDefaultInstance(); + } + continuousBackupSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource, + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource.Builder, + com.google.cloud.alloydb.v1alpha.ContinuousBackupSourceOrBuilder>( + (com.google.cloud.alloydb.v1alpha.ContinuousBackupSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 8; + onChanged(); + return continuousBackupSourceBuilder_; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object clusterId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearClusterId() { + clusterId_ = getDefaultInstance().getClusterId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1alpha.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster, + com.google.cloud.alloydb.v1alpha.Cluster.Builder, + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.alloydb.v1alpha.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1alpha.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1alpha.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.alloydb.v1alpha.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCluster() { + bitField0_ = (bitField0_ & ~0x00000010); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster, + com.google.cloud.alloydb.v1alpha.Cluster.Builder, + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster, + com.google.cloud.alloydb.v1alpha.Cluster.Builder, + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the import
+     * request.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the import
+     * request.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the import
+     * request.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000040); + validateOnly_ = 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.alloydb.v1alpha.RestoreClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.RestoreClusterRequest) + private static final com.google.cloud.alloydb.v1alpha.RestoreClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.RestoreClusterRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.RestoreClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestoreClusterRequest 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.alloydb.v1alpha.RestoreClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/RestoreClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/RestoreClusterRequestOrBuilder.java new file mode 100644 index 000000000000..5c00889f5887 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/RestoreClusterRequestOrBuilder.java @@ -0,0 +1,258 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface RestoreClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.RestoreClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + * + * @return Whether the backupSource field is set. + */ + boolean hasBackupSource(); + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + * + * @return The backupSource. + */ + com.google.cloud.alloydb.v1alpha.BackupSource getBackupSource(); + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + */ + com.google.cloud.alloydb.v1alpha.BackupSourceOrBuilder getBackupSourceOrBuilder(); + + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + * + * @return Whether the continuousBackupSource field is set. + */ + boolean hasContinuousBackupSource(); + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + * + * @return The continuousBackupSource. + */ + com.google.cloud.alloydb.v1alpha.ContinuousBackupSource getContinuousBackupSource(); + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + */ + com.google.cloud.alloydb.v1alpha.ContinuousBackupSourceOrBuilder + getContinuousBackupSourceOrBuilder(); + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.alloydb.v1alpha.Cluster getCluster(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the import
+   * request.
+   * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + public com.google.cloud.alloydb.v1alpha.RestoreClusterRequest.SourceCase getSourceCase(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ServiceProto.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ServiceProto.java new file mode 100644 index 000000000000..3a0e1a14e41a --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ServiceProto.java @@ -0,0 +1,846 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public final class ServiceProto { + private ServiceProto() {} + + 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_alloydb_v1alpha_ListClustersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_ListClustersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_ListClustersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_ListClustersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_GetClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_GetClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_CreateClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_CreateClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_UpdateClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_UpdateClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_DeleteClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_DeleteClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_PromoteClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_PromoteClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_RestoreClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_RestoreClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_ListInstancesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_ListInstancesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_ListInstancesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_ListInstancesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_GetInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_GetInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequests_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequests_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_InstanceStatusesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_InstanceStatusesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstanceStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstanceStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_UpdateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_UpdateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_DeleteInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_DeleteInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_FailoverInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_FailoverInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_RestartInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_RestartInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_ListBackupsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_ListBackupsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_ListBackupsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_ListBackupsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_GetBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_GetBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_CreateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_CreateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_UpdateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_UpdateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_DeleteBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_DeleteBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_GetConnectionInfoRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_GetConnectionInfoRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_OperationMetadata_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/alloydb/v1alpha/service.p" + + "roto\022\034google.cloud.alloydb.v1alpha\032\034goog" + + "le/api/annotations.proto\032\027google/api/cli" + + "ent.proto\032\037google/api/field_behavior.pro" + + "to\032\031google/api/resource.proto\032,google/cl" + + "oud/alloydb/v1alpha/resources.proto\032#goo" + + "gle/longrunning/operations.proto\032\036google" + + "/protobuf/duration.proto\032\033google/protobu" + + "f/empty.proto\032 google/protobuf/field_mas" + + "k.proto\032\037google/protobuf/timestamp.proto" + + "\032\027google/rpc/status.proto\"\245\001\n\023ListCluste" + + "rsRequest\0226\n\006parent\030\001 \001(\tB&\340A\002\372A \022\036alloy" + + "db.googleapis.com/Cluster\022\026\n\tpage_size\030\002" + + " \001(\005B\003\340A\001\022\022\n\npage_token\030\003 \001(\t\022\023\n\006filter\030" + + "\004 \001(\tB\003\340A\001\022\025\n\010order_by\030\005 \001(\tB\003\340A\001\"}\n\024Lis" + + "tClustersResponse\0227\n\010clusters\030\001 \003(\0132%.go" + + "ogle.cloud.alloydb.v1alpha.Cluster\022\027\n\017ne" + + "xt_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t" + + "\"I\n\021GetClusterRequest\0224\n\004name\030\001 \001(\tB&\340A\002" + + "\372A \n\036alloydb.googleapis.com/Cluster\"\342\001\n\035" + + "CreateSecondaryClusterRequest\0226\n\006parent\030" + + "\001 \001(\tB&\340A\002\372A \022\036alloydb.googleapis.com/Cl" + + "uster\022\027\n\ncluster_id\030\002 \001(\tB\003\340A\002\022;\n\007cluste" + + "r\030\003 \001(\0132%.google.cloud.alloydb.v1alpha.C" + + "lusterB\003\340A\002\022\027\n\nrequest_id\030\005 \001(\tB\003\340A\001\022\032\n\r" + + "validate_only\030\006 \001(\010B\003\340A\001\"\331\001\n\024CreateClust" + + "erRequest\0226\n\006parent\030\001 \001(\tB&\340A\002\372A \022\036alloy" + + "db.googleapis.com/Cluster\022\027\n\ncluster_id\030" + + "\002 \001(\tB\003\340A\002\022;\n\007cluster\030\003 \001(\0132%.google.clo" + + "ud.alloydb.v1alpha.ClusterB\003\340A\002\022\027\n\nreque" + + "st_id\030\004 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\005 \001(\010B" + + "\003\340A\001\"\332\001\n\024UpdateClusterRequest\0224\n\013update_" + + "mask\030\001 \001(\0132\032.google.protobuf.FieldMaskB\003" + + "\340A\001\022;\n\007cluster\030\002 \001(\0132%.google.cloud.allo" + + "ydb.v1alpha.ClusterB\003\340A\002\022\027\n\nrequest_id\030\003" + + " \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\001\022\032\n" + + "\rallow_missing\030\005 \001(\010B\003\340A\001\"\250\001\n\024DeleteClus" + + "terRequest\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n\036alloyd" + + "b.googleapis.com/Cluster\022\027\n\nrequest_id\030\002" + + " \001(\tB\003\340A\001\022\021\n\004etag\030\003 \001(\tB\003\340A\001\022\032\n\rvalidate" + + "_only\030\004 \001(\010B\003\340A\001\022\022\n\005force\030\005 \001(\010B\003\340A\001\"\225\001\n" + + "\025PromoteClusterRequest\0224\n\004name\030\001 \001(\tB&\340A" + + "\002\372A \n\036alloydb.googleapis.com/Cluster\022\027\n\n" + + "request_id\030\002 \001(\tB\003\340A\001\022\021\n\004etag\030\003 \001(\tB\003\340A\001" + + "\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\001\"\203\003\n\025Restore" + + "ClusterRequest\022C\n\rbackup_source\030\004 \001(\0132*." + + "google.cloud.alloydb.v1alpha.BackupSourc" + + "eH\000\022X\n\030continuous_backup_source\030\010 \001(\01324." + + "google.cloud.alloydb.v1alpha.ContinuousB" + + "ackupSourceH\000\0226\n\006parent\030\001 \001(\tB&\340A\002\372A \022\036a" + + "lloydb.googleapis.com/Cluster\022\027\n\ncluster" + + "_id\030\002 \001(\tB\003\340A\002\022;\n\007cluster\030\003 \001(\0132%.google" + + ".cloud.alloydb.v1alpha.ClusterB\003\340A\002\022\027\n\nr" + + "equest_id\030\005 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\006 " + + "\001(\010B\003\340A\001B\010\n\006source\"\247\001\n\024ListInstancesRequ" + + "est\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037alloydb.goo" + + "gleapis.com/Instance\022\026\n\tpage_size\030\002 \001(\005B" + + "\003\340A\001\022\022\n\npage_token\030\003 \001(\t\022\023\n\006filter\030\004 \001(\t" + + "B\003\340A\001\022\025\n\010order_by\030\005 \001(\tB\003\340A\001\"\200\001\n\025ListIns" + + "tancesResponse\0229\n\tinstances\030\001 \003(\0132&.goog" + + "le.cloud.alloydb.v1alpha.Instance\022\027\n\017nex" + + "t_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"" + + "\205\001\n\022GetInstanceRequest\0225\n\004name\030\001 \001(\tB\'\340A" + + "\002\372A!\n\037alloydb.googleapis.com/Instance\0228\n" + + "\004view\030\002 \001(\0162*.google.cloud.alloydb.v1alp" + + "ha.InstanceView\"\336\001\n\025CreateInstanceReques" + + "t\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037alloydb.googl" + + "eapis.com/Instance\022\030\n\013instance_id\030\002 \001(\tB" + + "\003\340A\002\022=\n\010instance\030\003 \001(\0132&.google.cloud.al" + + "loydb.v1alpha.InstanceB\003\340A\002\022\027\n\nrequest_i" + + "d\030\004 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\005 \001(\010B\003\340A\001" + + "\"\347\001\n\036CreateSecondaryInstanceRequest\0227\n\006p" + + "arent\030\001 \001(\tB\'\340A\002\372A!\022\037alloydb.googleapis." + + "com/Instance\022\030\n\013instance_id\030\002 \001(\tB\003\340A\002\022=" + + "\n\010instance\030\003 \001(\0132&.google.cloud.alloydb." + + "v1alpha.InstanceB\003\340A\002\022\027\n\nrequest_id\030\004 \001(" + + "\tB\003\340A\001\022\032\n\rvalidate_only\030\005 \001(\010B\003\340A\001\"t\n\026Cr" + + "eateInstanceRequests\022Z\n\030create_instance_" + + "requests\030\001 \003(\01323.google.cloud.alloydb.v1" + + "alpha.CreateInstanceRequestB\003\340A\002\"\274\001\n\033Bat" + + "chCreateInstancesRequest\0227\n\006parent\030\001 \001(\t" + + "B\'\340A\002\372A!\022\037alloydb.googleapis.com/Instanc" + + "e\022K\n\010requests\030\002 \001(\01324.google.cloud.alloy" + + "db.v1alpha.CreateInstanceRequestsB\003\340A\002\022\027" + + "\n\nrequest_id\030\003 \001(\tB\003\340A\001\"Y\n\034BatchCreateIn" + + "stancesResponse\0229\n\tinstances\030\001 \003(\0132&.goo" + + "gle.cloud.alloydb.v1alpha.Instance\"\227\002\n\034B" + + "atchCreateInstancesMetadata\022\030\n\020instance_" + + "targets\030\001 \003(\t\022k\n\021instance_statuses\030\002 \003(\013" + + "2P.google.cloud.alloydb.v1alpha.BatchCre" + + "ateInstancesMetadata.InstanceStatusesEnt" + + "ry\032p\n\025InstanceStatusesEntry\022\013\n\003key\030\001 \001(\t" + + "\022F\n\005value\030\002 \001(\01327.google.cloud.alloydb.v" + + "1alpha.BatchCreateInstanceStatus:\0028\001\"\332\002\n" + + "\031BatchCreateInstanceStatus\022L\n\005state\030\001 \001(" + + "\0162=.google.cloud.alloydb.v1alpha.BatchCr" + + "eateInstanceStatus.State\022\021\n\terror_msg\030\002 " + + "\001(\t\022!\n\005error\030\004 \001(\0132\022.google.rpc.Status\022A" + + "\n\004type\030\003 \001(\01623.google.cloud.alloydb.v1al" + + "pha.Instance.InstanceType\"v\n\005State\022\025\n\021ST" + + "ATE_UNSPECIFIED\020\000\022\022\n\016PENDING_CREATE\020\001\022\t\n" + + "\005READY\020\002\022\014\n\010CREATING\020\003\022\014\n\010DELETING\020\004\022\n\n\006" + + "FAILED\020\005\022\017\n\013ROLLED_BACK\020\006\"\335\001\n\025UpdateInst" + + "anceRequest\0224\n\013update_mask\030\001 \001(\0132\032.googl" + + "e.protobuf.FieldMaskB\003\340A\001\022=\n\010instance\030\002 " + + "\001(\0132&.google.cloud.alloydb.v1alpha.Insta" + + "nceB\003\340A\002\022\027\n\nrequest_id\030\003 \001(\tB\003\340A\001\022\032\n\rval" + + "idate_only\030\004 \001(\010B\003\340A\001\022\032\n\rallow_missing\030\005" + + " \001(\010B\003\340A\001\"\226\001\n\025DeleteInstanceRequest\0225\n\004n" + + "ame\030\001 \001(\tB\'\340A\002\372A!\n\037alloydb.googleapis.co" + + "m/Instance\022\027\n\nrequest_id\030\002 \001(\tB\003\340A\001\022\021\n\004e" + + "tag\030\003 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\004 \001(\010B\003\340" + + "A\001\"\205\001\n\027FailoverInstanceRequest\0225\n\004name\030\001" + + " \001(\tB\'\340A\002\372A!\n\037alloydb.googleapis.com/Ins" + + "tance\022\027\n\nrequest_id\030\002 \001(\tB\003\340A\001\022\032\n\rvalida" + + "te_only\030\003 \001(\010B\003\340A\001\"\204\001\n\026RestartInstanceRe" + + "quest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037alloydb.goo" + + "gleapis.com/Instance\022\027\n\nrequest_id\030\002 \001(\t" + + "B\003\340A\001\022\032\n\rvalidate_only\030\003 \001(\010B\003\340A\001\"\224\001\n\022Li" + + "stBackupsRequest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037" + + "\022\035alloydb.googleapis.com/Backup\022\021\n\tpage_" + + "size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filter" + + "\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"z\n\023ListBackupsR" + + "esponse\0225\n\007backups\030\001 \003(\0132$.google.cloud." + + "alloydb.v1alpha.Backup\022\027\n\017next_page_toke" + + "n\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"G\n\020GetBacku" + + "pRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035alloydb." + + "googleapis.com/Backup\"\324\001\n\023CreateBackupRe" + + "quest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\022\035alloydb.g" + + "oogleapis.com/Backup\022\026\n\tbackup_id\030\002 \001(\tB" + + "\003\340A\002\0229\n\006backup\030\003 \001(\0132$.google.cloud.allo" + + "ydb.v1alpha.BackupB\003\340A\002\022\027\n\nrequest_id\030\004 " + + "\001(\tB\003\340A\001\022\032\n\rvalidate_only\030\005 \001(\010B\003\340A\001\"\327\001\n" + + "\023UpdateBackupRequest\0224\n\013update_mask\030\001 \001(" + + "\0132\032.google.protobuf.FieldMaskB\003\340A\001\0229\n\006ba" + + "ckup\030\002 \001(\0132$.google.cloud.alloydb.v1alph" + + "a.BackupB\003\340A\002\022\027\n\nrequest_id\030\003 \001(\tB\003\340A\001\022\032" + + "\n\rvalidate_only\030\004 \001(\010B\003\340A\001\022\032\n\rallow_miss" + + "ing\030\005 \001(\010B\003\340A\001\"\222\001\n\023DeleteBackupRequest\0223" + + "\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035alloydb.googleapis" + + ".com/Backup\022\027\n\nrequest_id\030\002 \001(\tB\003\340A\001\022\032\n\r" + + "validate_only\030\003 \001(\010B\003\340A\001\022\021\n\004etag\030\004 \001(\tB\003" + + "\340A\001\"\220\001\n!ListSupportedDatabaseFlagsReques" + + "t\022D\n\006parent\030\001 \001(\tB4\340A\002\372A.\022,alloydb.googl" + + "eapis.com/SupportedDatabaseFlag\022\021\n\tpage_" + + "size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\224\001\n\"ListS" + + "upportedDatabaseFlagsResponse\022U\n\030support" + + "ed_database_flags\030\001 \003(\01323.google.cloud.a" + + "lloydb.v1alpha.SupportedDatabaseFlag\022\027\n\017" + + "next_page_token\030\002 \001(\t\"\300\001\n GenerateClient" + + "CertificateRequest\0226\n\006parent\030\001 \001(\tB&\340A\002\372" + + "A \n\036alloydb.googleapis.com/Cluster\022\027\n\nre" + + "quest_id\030\002 \001(\tB\003\340A\001\022\024\n\007pem_csr\030\003 \001(\tB\003\340A" + + "\001\0225\n\rcert_duration\030\004 \001(\0132\031.google.protob" + + "uf.DurationB\003\340A\001\"e\n!GenerateClientCertif" + + "icateResponse\022\034\n\017pem_certificate\030\001 \001(\tB\003" + + "\340A\003\022\"\n\025pem_certificate_chain\030\002 \003(\tB\003\340A\003\"" + + "l\n\030GetConnectionInfoRequest\0227\n\006parent\030\001 " + + "\001(\tB\'\340A\002\372A!\n\037alloydb.googleapis.com/Inst" + + "ance\022\027\n\nrequest_id\030\002 \001(\tB\003\340A\001\"\200\003\n\021Operat" + + "ionMetadata\022j\n\037batch_create_instances_me" + + "tadata\030\010 \001(\0132:.google.cloud.alloydb.v1al" + + "pha.BatchCreateInstancesMetadataB\003\340A\003H\000\022" + + "4\n\013create_time\030\001 \001(\0132\032.google.protobuf.T" + + "imestampB\003\340A\003\0221\n\010end_time\030\002 \001(\0132\032.google" + + ".protobuf.TimestampB\003\340A\003\022\023\n\006target\030\003 \001(\t" + + "B\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\033\n\016status_messa" + + "ge\030\005 \001(\tB\003\340A\003\022#\n\026requested_cancellation\030" + + "\006 \001(\010B\003\340A\003\022\030\n\013api_version\030\007 \001(\tB\003\340A\003B\022\n\020" + + "request_specific2\372+\n\014AlloyDBAdmin\022\271\001\n\014Li" + + "stClusters\0221.google.cloud.alloydb.v1alph" + + "a.ListClustersRequest\0322.google.cloud.all" + + "oydb.v1alpha.ListClustersResponse\"B\202\323\344\223\002" + + "3\0221/v1alpha/{parent=projects/*/locations" + + "/*}/clusters\332A\006parent\022\246\001\n\nGetCluster\022/.g" + + "oogle.cloud.alloydb.v1alpha.GetClusterRe" + + "quest\032%.google.cloud.alloydb.v1alpha.Clu" + + "ster\"@\202\323\344\223\0023\0221/v1alpha/{name=projects/*/" + + "locations/*/clusters/*}\332A\004name\022\341\001\n\rCreat" + + "eCluster\0222.google.cloud.alloydb.v1alpha." + + "CreateClusterRequest\032\035.google.longrunnin" + + "g.Operation\"}\202\323\344\223\002<\"1/v1alpha/{parent=pr" + + "ojects/*/locations/*}/clusters:\007cluster\332" + + "A\031parent,cluster,cluster_id\312A\034\n\007Cluster\022" + + "\021OperationMetadata\022\343\001\n\rUpdateCluster\0222.g" + + "oogle.cloud.alloydb.v1alpha.UpdateCluste" + + "rRequest\032\035.google.longrunning.Operation\"" + + "\177\202\323\344\223\002D29/v1alpha/{cluster.name=projects" + + "/*/locations/*/clusters/*}:\007cluster\332A\023cl" + + "uster,update_mask\312A\034\n\007Cluster\022\021Operation" + + "Metadata\022\321\001\n\rDeleteCluster\0222.google.clou" + + "d.alloydb.v1alpha.DeleteClusterRequest\032\035" + + ".google.longrunning.Operation\"m\202\323\344\223\0023*1/" + + "v1alpha/{name=projects/*/locations/*/clu" + + "sters/*}\332A\004name\312A*\n\025google.protobuf.Empt" + + "y\022\021OperationMetadata\022\320\001\n\016PromoteCluster\022" + + "3.google.cloud.alloydb.v1alpha.PromoteCl" + + "usterRequest\032\035.google.longrunning.Operat" + + "ion\"j\202\323\344\223\002>\"9/v1alpha/{name=projects/*/l" + + "ocations/*/clusters/*}:promote:\001*\332A\004name" + + "\312A\034\n\007Cluster\022\021OperationMetadata\022\311\001\n\016Rest" + + "oreCluster\0223.google.cloud.alloydb.v1alph" + + "a.RestoreClusterRequest\032\035.google.longrun" + + "ning.Operation\"c\202\323\344\223\002>\"9/v1alpha/{parent" + + "=projects/*/locations/*}/clusters:restor" + + "e:\001*\312A\034\n\007Cluster\022\021OperationMetadata\022\204\002\n\026" + + "CreateSecondaryCluster\022;.google.cloud.al" + + "loydb.v1alpha.CreateSecondaryClusterRequ" + + "est\032\035.google.longrunning.Operation\"\215\001\202\323\344" + + "\223\002L\"A/v1alpha/{parent=projects/*/locatio" + + "ns/*}/clusters:createsecondary:\007cluster\332" + + "A\031parent,cluster,cluster_id\312A\034\n\007Cluster\022" + + "\021OperationMetadata\022\310\001\n\rListInstances\0222.g" + + "oogle.cloud.alloydb.v1alpha.ListInstance" + + "sRequest\0323.google.cloud.alloydb.v1alpha." + + "ListInstancesResponse\"N\202\323\344\223\002?\022=/v1alpha/" + + "{parent=projects/*/locations/*/clusters/" + + "*}/instances\332A\006parent\022\265\001\n\013GetInstance\0220." + + "google.cloud.alloydb.v1alpha.GetInstance" + + "Request\032&.google.cloud.alloydb.v1alpha.I" + + "nstance\"L\202\323\344\223\002?\022=/v1alpha/{name=projects" + + "/*/locations/*/clusters/*/instances/*}\332A" + + "\004name\022\364\001\n\016CreateInstance\0223.google.cloud." + + "alloydb.v1alpha.CreateInstanceRequest\032\035." + + "google.longrunning.Operation\"\215\001\202\323\344\223\002I\"=/" + + "v1alpha/{parent=projects/*/locations/*/c" + + "lusters/*}/instances:\010instance\332A\033parent," + + "instance,instance_id\312A\035\n\010Instance\022\021Opera" + + "tionMetadata\022\226\002\n\027CreateSecondaryInstance" + + "\022<.google.cloud.alloydb.v1alpha.CreateSe" + + "condaryInstanceRequest\032\035.google.longrunn" + + "ing.Operation\"\235\001\202\323\344\223\002Y\"M/v1alpha/{parent" + + "=projects/*/locations/*/clusters/*}/inst" + + "ances:createsecondary:\010instance\332A\033parent" + + ",instance,instance_id\312A\035\n\010Instance\022\021Oper" + + "ationMetadata\022\202\002\n\024BatchCreateInstances\0229" + + ".google.cloud.alloydb.v1alpha.BatchCreat" + + "eInstancesRequest\032\035.google.longrunning.O" + + "peration\"\217\001\202\323\344\223\002U\"I/v1alpha/{parent=proj" + + "ects/*/locations/*/clusters/*}/instances" + + ":batchCreate:\010requests\312A1\n\034BatchCreateIn" + + "stancesResponse\022\021OperationMetadata\022\366\001\n\016U" + + "pdateInstance\0223.google.cloud.alloydb.v1a" + + "lpha.UpdateInstanceRequest\032\035.google.long" + + "running.Operation\"\217\001\202\323\344\223\002R2F/v1alpha/{in" + + "stance.name=projects/*/locations/*/clust" + + "ers/*/instances/*}:\010instance\332A\024instance," + + "update_mask\312A\035\n\010Instance\022\021OperationMetad" + + "ata\022\337\001\n\016DeleteInstance\0223.google.cloud.al" + + "loydb.v1alpha.DeleteInstanceRequest\032\035.go" + + "ogle.longrunning.Operation\"y\202\323\344\223\002?*=/v1a" + + "lpha/{name=projects/*/locations/*/cluste" + + "rs/*/instances/*}\332A\004name\312A*\n\025google.prot" + + "obuf.Empty\022\021OperationMetadata\022\342\001\n\020Failov" + + "erInstance\0225.google.cloud.alloydb.v1alph" + + "a.FailoverInstanceRequest\032\035.google.longr" + + "unning.Operation\"x\202\323\344\223\002K\"F/v1alpha/{name" + + "=projects/*/locations/*/clusters/*/insta" + + "nces/*}:failover:\001*\332A\004name\312A\035\n\010Instance\022" + + "\021OperationMetadata\022\337\001\n\017RestartInstance\0224" + + ".google.cloud.alloydb.v1alpha.RestartIns" + + "tanceRequest\032\035.google.longrunning.Operat" + + "ion\"w\202\323\344\223\002J\"E/v1alpha/{name=projects/*/l" + + "ocations/*/clusters/*/instances/*}:resta" + + "rt:\001*\332A\004name\312A\035\n\010Instance\022\021OperationMeta" + + "data\022\265\001\n\013ListBackups\0220.google.cloud.allo" + + "ydb.v1alpha.ListBackupsRequest\0321.google." + + "cloud.alloydb.v1alpha.ListBackupsRespons" + + "e\"A\202\323\344\223\0022\0220/v1alpha/{parent=projects/*/l" + + "ocations/*}/backups\332A\006parent\022\242\001\n\tGetBack" + + "up\022..google.cloud.alloydb.v1alpha.GetBac" + + "kupRequest\032$.google.cloud.alloydb.v1alph" + + "a.Backup\"?\202\323\344\223\0022\0220/v1alpha/{name=project" + + "s/*/locations/*/backups/*}\332A\004name\022\332\001\n\014Cr" + + "eateBackup\0221.google.cloud.alloydb.v1alph" + + "a.CreateBackupRequest\032\035.google.longrunni" + + "ng.Operation\"x\202\323\344\223\002:\"0/v1alpha/{parent=p" + + "rojects/*/locations/*}/backups:\006backup\332A" + + "\027parent,backup,backup_id\312A\033\n\006Backup\022\021Ope" + + "rationMetadata\022\334\001\n\014UpdateBackup\0221.google" + + ".cloud.alloydb.v1alpha.UpdateBackupReque" + + "st\032\035.google.longrunning.Operation\"z\202\323\344\223\002" + + "A27/v1alpha/{backup.name=projects/*/loca" + + "tions/*/backups/*}:\006backup\332A\022backup,upda" + + "te_mask\312A\033\n\006Backup\022\021OperationMetadata\022\316\001" + + "\n\014DeleteBackup\0221.google.cloud.alloydb.v1" + + "alpha.DeleteBackupRequest\032\035.google.longr" + + "unning.Operation\"l\202\323\344\223\0022*0/v1alpha/{name" + + "=projects/*/locations/*/backups/*}\332A\004nam" + + "e\312A*\n\025google.protobuf.Empty\022\021OperationMe" + + "tadata\022\361\001\n\032ListSupportedDatabaseFlags\022?." + + "google.cloud.alloydb.v1alpha.ListSupport" + + "edDatabaseFlagsRequest\032@.google.cloud.al" + + "loydb.v1alpha.ListSupportedDatabaseFlags" + + "Response\"P\202\323\344\223\002A\022?/v1alpha/{parent=proje" + + "cts/*/locations/*}/supportedDatabaseFlag" + + "s\332A\006parent\022\377\001\n\031GenerateClientCertificate" + + "\022>.google.cloud.alloydb.v1alpha.Generate" + + "ClientCertificateRequest\032?.google.cloud." + + "alloydb.v1alpha.GenerateClientCertificat" + + "eResponse\"a\202\323\344\223\002R\"M/v1alpha/{parent=proj" + + "ects/*/locations/*/clusters/*}:generateC" + + "lientCertificate:\001*\332A\006parent\022\332\001\n\021GetConn" + + "ectionInfo\0226.google.cloud.alloydb.v1alph" + + "a.GetConnectionInfoRequest\032,.google.clou" + + "d.alloydb.v1alpha.ConnectionInfo\"_\202\323\344\223\002P" + + "\022N/v1alpha/{parent=projects/*/locations/" + + "*/clusters/*/instances/*}/connectionInfo" + + "\332A\006parent\032J\312A\026alloydb.googleapis.com\322A.h" + + "ttps://www.googleapis.com/auth/cloud-pla" + + "tformB\316\001\n com.google.cloud.alloydb.v1alp" + + "haB\014ServiceProtoP\001Z:cloud.google.com/go/" + + "alloydb/apiv1alpha/alloydbpb;alloydbpb\252\002" + + "\034Google.Cloud.AlloyDb.V1Alpha\312\002\034Google\\C" + + "loud\\AlloyDb\\V1alpha\352\002\037Google::Cloud::Al" + + "loyDb::V1alphab\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.alloydb.v1alpha.ResourcesProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_cloud_alloydb_v1alpha_ListClustersRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_alloydb_v1alpha_ListClustersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_ListClustersRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_alloydb_v1alpha_ListClustersResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_alloydb_v1alpha_ListClustersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_ListClustersResponse_descriptor, + new java.lang.String[] { + "Clusters", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_alloydb_v1alpha_GetClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_alloydb_v1alpha_GetClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_GetClusterRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryClusterRequest_descriptor, + new java.lang.String[] { + "Parent", "ClusterId", "Cluster", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1alpha_CreateClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_alloydb_v1alpha_CreateClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_CreateClusterRequest_descriptor, + new java.lang.String[] { + "Parent", "ClusterId", "Cluster", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1alpha_UpdateClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_alloydb_v1alpha_UpdateClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_UpdateClusterRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Cluster", "RequestId", "ValidateOnly", "AllowMissing", + }); + internal_static_google_cloud_alloydb_v1alpha_DeleteClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_alloydb_v1alpha_DeleteClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_DeleteClusterRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "Etag", "ValidateOnly", "Force", + }); + internal_static_google_cloud_alloydb_v1alpha_PromoteClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_alloydb_v1alpha_PromoteClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_PromoteClusterRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "Etag", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1alpha_RestoreClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_alloydb_v1alpha_RestoreClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_RestoreClusterRequest_descriptor, + new java.lang.String[] { + "BackupSource", + "ContinuousBackupSource", + "Parent", + "ClusterId", + "Cluster", + "RequestId", + "ValidateOnly", + "Source", + }); + internal_static_google_cloud_alloydb_v1alpha_ListInstancesRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_alloydb_v1alpha_ListInstancesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_ListInstancesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_alloydb_v1alpha_ListInstancesResponse_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_alloydb_v1alpha_ListInstancesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_ListInstancesResponse_descriptor, + new java.lang.String[] { + "Instances", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_alloydb_v1alpha_GetInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_alloydb_v1alpha_GetInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_GetInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "View", + }); + internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequest_descriptor, + new java.lang.String[] { + "Parent", "InstanceId", "Instance", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryInstanceRequest_descriptor, + new java.lang.String[] { + "Parent", "InstanceId", "Instance", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequests_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequests_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_CreateInstanceRequests_descriptor, + new java.lang.String[] { + "CreateInstanceRequests", + }); + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesRequest_descriptor, + new java.lang.String[] { + "Parent", "Requests", "RequestId", + }); + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesResponse_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesResponse_descriptor, + new java.lang.String[] { + "Instances", + }); + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_descriptor, + new java.lang.String[] { + "InstanceTargets", "InstanceStatuses", + }); + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_InstanceStatusesEntry_descriptor = + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_InstanceStatusesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstancesMetadata_InstanceStatusesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstanceStatus_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstanceStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_BatchCreateInstanceStatus_descriptor, + new java.lang.String[] { + "State", "ErrorMsg", "Error", "Type", + }); + internal_static_google_cloud_alloydb_v1alpha_UpdateInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_alloydb_v1alpha_UpdateInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_UpdateInstanceRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Instance", "RequestId", "ValidateOnly", "AllowMissing", + }); + internal_static_google_cloud_alloydb_v1alpha_DeleteInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_alloydb_v1alpha_DeleteInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_DeleteInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "Etag", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1alpha_FailoverInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_alloydb_v1alpha_FailoverInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_FailoverInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1alpha_RestartInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_alloydb_v1alpha_RestartInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_RestartInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1alpha_ListBackupsRequest_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_alloydb_v1alpha_ListBackupsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_ListBackupsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_alloydb_v1alpha_ListBackupsResponse_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_alloydb_v1alpha_ListBackupsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_ListBackupsResponse_descriptor, + new java.lang.String[] { + "Backups", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_alloydb_v1alpha_GetBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_alloydb_v1alpha_GetBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_GetBackupRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_alloydb_v1alpha_CreateBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_alloydb_v1alpha_CreateBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_CreateBackupRequest_descriptor, + new java.lang.String[] { + "Parent", "BackupId", "Backup", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1alpha_UpdateBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_google_cloud_alloydb_v1alpha_UpdateBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_UpdateBackupRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Backup", "RequestId", "ValidateOnly", "AllowMissing", + }); + internal_static_google_cloud_alloydb_v1alpha_DeleteBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_google_cloud_alloydb_v1alpha_DeleteBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_DeleteBackupRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "ValidateOnly", "Etag", + }); + internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsRequest_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsResponse_descriptor = + getDescriptor().getMessageTypes().get(30); + internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsResponse_descriptor, + new java.lang.String[] { + "SupportedDatabaseFlags", "NextPageToken", + }); + internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateRequest_descriptor = + getDescriptor().getMessageTypes().get(31); + internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateRequest_descriptor, + new java.lang.String[] { + "Parent", "RequestId", "PemCsr", "CertDuration", + }); + internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateResponse_descriptor = + getDescriptor().getMessageTypes().get(32); + internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateResponse_descriptor, + new java.lang.String[] { + "PemCertificate", "PemCertificateChain", + }); + internal_static_google_cloud_alloydb_v1alpha_GetConnectionInfoRequest_descriptor = + getDescriptor().getMessageTypes().get(33); + internal_static_google_cloud_alloydb_v1alpha_GetConnectionInfoRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_GetConnectionInfoRequest_descriptor, + new java.lang.String[] { + "Parent", "RequestId", + }); + internal_static_google_cloud_alloydb_v1alpha_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(34); + internal_static_google_cloud_alloydb_v1alpha_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_OperationMetadata_descriptor, + new java.lang.String[] { + "BatchCreateInstancesMetadata", + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + "RequestSpecific", + }); + 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); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + 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.alloydb.v1alpha.ResourcesProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SslConfig.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SslConfig.java new file mode 100644 index 000000000000..c4a260c118b3 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SslConfig.java @@ -0,0 +1,1113 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * SSL configuration for an AlloyDB Cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.SslConfig} + */ +public final class SslConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.SslConfig) + SslConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use SslConfig.newBuilder() to construct. + private SslConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SslConfig() { + sslMode_ = 0; + caSource_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SslConfig(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SslConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SslConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.SslConfig.class, + com.google.cloud.alloydb.v1alpha.SslConfig.Builder.class); + } + + /** + * + * + *
+   * SSL mode options.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.SslConfig.SslMode} + */ + public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * SSL mode not specified. Defaults to SSL_MODE_ALLOW.
+     * 
+ * + * SSL_MODE_UNSPECIFIED = 0; + */ + SSL_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * SSL connections are optional. CA verification not enforced.
+     * 
+ * + * SSL_MODE_ALLOW = 1; + */ + SSL_MODE_ALLOW(1), + /** + * + * + *
+     * SSL connections are required. CA verification not enforced.
+     * Clients may use locally self-signed certificates (default psql client
+     * behavior).
+     * 
+ * + * SSL_MODE_REQUIRE = 2; + */ + SSL_MODE_REQUIRE(2), + /** + * + * + *
+     * SSL connections are required. CA verification enforced.
+     * Clients must have certificates signed by a Cluster CA, e.g. via
+     * GenerateClientCertificate.
+     * 
+ * + * SSL_MODE_VERIFY_CA = 3; + */ + SSL_MODE_VERIFY_CA(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * SSL mode not specified. Defaults to SSL_MODE_ALLOW.
+     * 
+ * + * SSL_MODE_UNSPECIFIED = 0; + */ + public static final int SSL_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * SSL connections are optional. CA verification not enforced.
+     * 
+ * + * SSL_MODE_ALLOW = 1; + */ + public static final int SSL_MODE_ALLOW_VALUE = 1; + /** + * + * + *
+     * SSL connections are required. CA verification not enforced.
+     * Clients may use locally self-signed certificates (default psql client
+     * behavior).
+     * 
+ * + * SSL_MODE_REQUIRE = 2; + */ + public static final int SSL_MODE_REQUIRE_VALUE = 2; + /** + * + * + *
+     * SSL connections are required. CA verification enforced.
+     * Clients must have certificates signed by a Cluster CA, e.g. via
+     * GenerateClientCertificate.
+     * 
+ * + * SSL_MODE_VERIFY_CA = 3; + */ + public static final int SSL_MODE_VERIFY_CA_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 SslMode 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 SslMode forNumber(int value) { + switch (value) { + case 0: + return SSL_MODE_UNSPECIFIED; + case 1: + return SSL_MODE_ALLOW; + case 2: + return SSL_MODE_REQUIRE; + case 3: + return SSL_MODE_VERIFY_CA; + 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 SslMode findValueByNumber(int number) { + return SslMode.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.alloydb.v1alpha.SslConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final SslMode[] VALUES = values(); + + public static SslMode 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 SslMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.SslConfig.SslMode) + } + + /** + * + * + *
+   * Certificate Authority (CA) source for SSL/TLS certificates.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.SslConfig.CaSource} + */ + public enum CaSource implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Certificate Authority (CA) source not specified. Defaults to
+     * CA_SOURCE_MANAGED.
+     * 
+ * + * CA_SOURCE_UNSPECIFIED = 0; + */ + CA_SOURCE_UNSPECIFIED(0), + /** + * + * + *
+     * Certificate Authority (CA) managed by the AlloyDB Cluster.
+     * 
+ * + * CA_SOURCE_MANAGED = 1; + */ + CA_SOURCE_MANAGED(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Certificate Authority (CA) source not specified. Defaults to
+     * CA_SOURCE_MANAGED.
+     * 
+ * + * CA_SOURCE_UNSPECIFIED = 0; + */ + public static final int CA_SOURCE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Certificate Authority (CA) managed by the AlloyDB Cluster.
+     * 
+ * + * CA_SOURCE_MANAGED = 1; + */ + public static final int CA_SOURCE_MANAGED_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 CaSource 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 CaSource forNumber(int value) { + switch (value) { + case 0: + return CA_SOURCE_UNSPECIFIED; + case 1: + return CA_SOURCE_MANAGED; + 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 CaSource findValueByNumber(int number) { + return CaSource.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.alloydb.v1alpha.SslConfig.getDescriptor().getEnumTypes().get(1); + } + + private static final CaSource[] VALUES = values(); + + public static CaSource 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 CaSource(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.SslConfig.CaSource) + } + + public static final int SSL_MODE_FIELD_NUMBER = 1; + private int sslMode_ = 0; + /** + * + * + *
+   * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for sslMode. + */ + @java.lang.Override + public int getSslModeValue() { + return sslMode_; + } + /** + * + * + *
+   * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sslMode. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SslConfig.SslMode getSslMode() { + com.google.cloud.alloydb.v1alpha.SslConfig.SslMode result = + com.google.cloud.alloydb.v1alpha.SslConfig.SslMode.forNumber(sslMode_); + return result == null + ? com.google.cloud.alloydb.v1alpha.SslConfig.SslMode.UNRECOGNIZED + : result; + } + + public static final int CA_SOURCE_FIELD_NUMBER = 2; + private int caSource_ = 0; + /** + * + * + *
+   * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+   * supported currently, and is the default value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for caSource. + */ + @java.lang.Override + public int getCaSourceValue() { + return caSource_; + } + /** + * + * + *
+   * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+   * supported currently, and is the default value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The caSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SslConfig.CaSource getCaSource() { + com.google.cloud.alloydb.v1alpha.SslConfig.CaSource result = + com.google.cloud.alloydb.v1alpha.SslConfig.CaSource.forNumber(caSource_); + return result == null + ? com.google.cloud.alloydb.v1alpha.SslConfig.CaSource.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 (sslMode_ + != com.google.cloud.alloydb.v1alpha.SslConfig.SslMode.SSL_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, sslMode_); + } + if (caSource_ + != com.google.cloud.alloydb.v1alpha.SslConfig.CaSource.CA_SOURCE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, caSource_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sslMode_ + != com.google.cloud.alloydb.v1alpha.SslConfig.SslMode.SSL_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, sslMode_); + } + if (caSource_ + != com.google.cloud.alloydb.v1alpha.SslConfig.CaSource.CA_SOURCE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, caSource_); + } + 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.alloydb.v1alpha.SslConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.SslConfig other = + (com.google.cloud.alloydb.v1alpha.SslConfig) obj; + + if (sslMode_ != other.sslMode_) return false; + if (caSource_ != other.caSource_) 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) + SSL_MODE_FIELD_NUMBER; + hash = (53 * hash) + sslMode_; + hash = (37 * hash) + CA_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + caSource_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.SslConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.SslConfig 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.alloydb.v1alpha.SslConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.SslConfig 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.alloydb.v1alpha.SslConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.SslConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.SslConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.SslConfig 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.alloydb.v1alpha.SslConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.SslConfig 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.alloydb.v1alpha.SslConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.SslConfig 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.alloydb.v1alpha.SslConfig 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; + } + /** + * + * + *
+   * SSL configuration for an AlloyDB Cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.SslConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.SslConfig) + com.google.cloud.alloydb.v1alpha.SslConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SslConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SslConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.SslConfig.class, + com.google.cloud.alloydb.v1alpha.SslConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.SslConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sslMode_ = 0; + caSource_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SslConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SslConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.SslConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SslConfig build() { + com.google.cloud.alloydb.v1alpha.SslConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SslConfig buildPartial() { + com.google.cloud.alloydb.v1alpha.SslConfig result = + new com.google.cloud.alloydb.v1alpha.SslConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.SslConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sslMode_ = sslMode_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.caSource_ = caSource_; + } + } + + @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.alloydb.v1alpha.SslConfig) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.SslConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.SslConfig other) { + if (other == com.google.cloud.alloydb.v1alpha.SslConfig.getDefaultInstance()) return this; + if (other.sslMode_ != 0) { + setSslModeValue(other.getSslModeValue()); + } + if (other.caSource_ != 0) { + setCaSourceValue(other.getCaSourceValue()); + } + 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: + { + sslMode_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + caSource_ = input.readEnum(); + 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 int sslMode_ = 0; + /** + * + * + *
+     * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for sslMode. + */ + @java.lang.Override + public int getSslModeValue() { + return sslMode_; + } + /** + * + * + *
+     * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for sslMode to set. + * @return This builder for chaining. + */ + public Builder setSslModeValue(int value) { + sslMode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sslMode. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SslConfig.SslMode getSslMode() { + com.google.cloud.alloydb.v1alpha.SslConfig.SslMode result = + com.google.cloud.alloydb.v1alpha.SslConfig.SslMode.forNumber(sslMode_); + return result == null + ? com.google.cloud.alloydb.v1alpha.SslConfig.SslMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The sslMode to set. + * @return This builder for chaining. + */ + public Builder setSslMode(com.google.cloud.alloydb.v1alpha.SslConfig.SslMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + sslMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSslMode() { + bitField0_ = (bitField0_ & ~0x00000001); + sslMode_ = 0; + onChanged(); + return this; + } + + private int caSource_ = 0; + /** + * + * + *
+     * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+     * supported currently, and is the default value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for caSource. + */ + @java.lang.Override + public int getCaSourceValue() { + return caSource_; + } + /** + * + * + *
+     * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+     * supported currently, and is the default value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for caSource to set. + * @return This builder for chaining. + */ + public Builder setCaSourceValue(int value) { + caSource_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+     * supported currently, and is the default value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The caSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SslConfig.CaSource getCaSource() { + com.google.cloud.alloydb.v1alpha.SslConfig.CaSource result = + com.google.cloud.alloydb.v1alpha.SslConfig.CaSource.forNumber(caSource_); + return result == null + ? com.google.cloud.alloydb.v1alpha.SslConfig.CaSource.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+     * supported currently, and is the default value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The caSource to set. + * @return This builder for chaining. + */ + public Builder setCaSource(com.google.cloud.alloydb.v1alpha.SslConfig.CaSource value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + caSource_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+     * supported currently, and is the default value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearCaSource() { + bitField0_ = (bitField0_ & ~0x00000002); + caSource_ = 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.alloydb.v1alpha.SslConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.SslConfig) + private static final com.google.cloud.alloydb.v1alpha.SslConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.SslConfig(); + } + + public static com.google.cloud.alloydb.v1alpha.SslConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SslConfig 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.alloydb.v1alpha.SslConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SslConfigOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SslConfigOrBuilder.java new file mode 100644 index 000000000000..d3cfd29d5b84 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SslConfigOrBuilder.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/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface SslConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.SslConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for sslMode. + */ + int getSslModeValue(); + /** + * + * + *
+   * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sslMode. + */ + com.google.cloud.alloydb.v1alpha.SslConfig.SslMode getSslMode(); + + /** + * + * + *
+   * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+   * supported currently, and is the default value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for caSource. + */ + int getCaSourceValue(); + /** + * + * + *
+   * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+   * supported currently, and is the default value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The caSource. + */ + com.google.cloud.alloydb.v1alpha.SslConfig.CaSource getCaSource(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SupportedDatabaseFlag.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SupportedDatabaseFlag.java new file mode 100644 index 000000000000..cc2187e7dee4 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SupportedDatabaseFlag.java @@ -0,0 +1,4404 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * SupportedDatabaseFlag gives general information about a database flag,
+ * like type and allowed values. This is a static value that is defined
+ * on the server side, and it cannot be modified by callers.
+ * To set the Database flags on a particular Instance, a caller should modify
+ * the Instance.database_flags field.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} + */ +public final class SupportedDatabaseFlag extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.SupportedDatabaseFlag) + SupportedDatabaseFlagOrBuilder { + private static final long serialVersionUID = 0L; + // Use SupportedDatabaseFlag.newBuilder() to construct. + private SupportedDatabaseFlag(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SupportedDatabaseFlag() { + name_ = ""; + flagName_ = ""; + valueType_ = 0; + supportedDbVersions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SupportedDatabaseFlag(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.class, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Builder.class); + } + + /** + * + * + *
+   * ValueType describes the semantic type of the value that the flag accepts.
+   * Regardless of the ValueType, the Instance.database_flags field accepts the
+   * stringified version of the value, i.e. "20" or "3.14".
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType} + */ + public enum ValueType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * This is an unknown flag type.
+     * 
+ * + * VALUE_TYPE_UNSPECIFIED = 0; + */ + VALUE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * String type flag.
+     * 
+ * + * STRING = 1; + */ + STRING(1), + /** + * + * + *
+     * Integer type flag.
+     * 
+ * + * INTEGER = 2; + */ + INTEGER(2), + /** + * + * + *
+     * Float type flag.
+     * 
+ * + * FLOAT = 3; + */ + FLOAT(3), + /** + * + * + *
+     * Denotes that the flag does not accept any values.
+     * 
+ * + * NONE = 4; + */ + NONE(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * This is an unknown flag type.
+     * 
+ * + * VALUE_TYPE_UNSPECIFIED = 0; + */ + public static final int VALUE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * String type flag.
+     * 
+ * + * STRING = 1; + */ + public static final int STRING_VALUE = 1; + /** + * + * + *
+     * Integer type flag.
+     * 
+ * + * INTEGER = 2; + */ + public static final int INTEGER_VALUE = 2; + /** + * + * + *
+     * Float type flag.
+     * 
+ * + * FLOAT = 3; + */ + public static final int FLOAT_VALUE = 3; + /** + * + * + *
+     * Denotes that the flag does not accept any values.
+     * 
+ * + * NONE = 4; + */ + public static final int NONE_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 ValueType 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 ValueType forNumber(int value) { + switch (value) { + case 0: + return VALUE_TYPE_UNSPECIFIED; + case 1: + return STRING; + case 2: + return INTEGER; + case 3: + return FLOAT; + case 4: + return NONE; + 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 ValueType findValueByNumber(int number) { + return ValueType.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.alloydb.v1alpha.SupportedDatabaseFlag.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ValueType[] VALUES = values(); + + public static ValueType 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 ValueType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType) + } + + public interface StringRestrictionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return A list containing the allowedValues. + */ + java.util.List getAllowedValuesList(); + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return The count of allowedValues. + */ + int getAllowedValuesCount(); + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the element to return. + * @return The allowedValues at the given index. + */ + java.lang.String getAllowedValues(int index); + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the allowedValues at the given index. + */ + com.google.protobuf.ByteString getAllowedValuesBytes(int index); + } + /** + * + * + *
+   * Restrictions on STRING type values
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} + */ + public static final class StringRestrictions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) + StringRestrictionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use StringRestrictions.newBuilder() to construct. + private StringRestrictions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StringRestrictions() { + allowedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StringRestrictions(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_StringRestrictions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_StringRestrictions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.class, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.Builder + .class); + } + + public static final int ALLOWED_VALUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList allowedValues_; + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return A list containing the allowedValues. + */ + public com.google.protobuf.ProtocolStringList getAllowedValuesList() { + return allowedValues_; + } + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return The count of allowedValues. + */ + public int getAllowedValuesCount() { + return allowedValues_.size(); + } + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the element to return. + * @return The allowedValues at the given index. + */ + public java.lang.String getAllowedValues(int index) { + return allowedValues_.get(index); + } + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the allowedValues at the given index. + */ + public com.google.protobuf.ByteString getAllowedValuesBytes(int index) { + return allowedValues_.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 < allowedValues_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allowedValues_.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 < allowedValues_.size(); i++) { + dataSize += computeStringSizeNoTag(allowedValues_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowedValuesList().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.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions other = + (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) obj; + + if (!getAllowedValuesList().equals(other.getAllowedValuesList())) 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 (getAllowedValuesCount() > 0) { + hash = (37 * hash) + ALLOWED_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + 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.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + 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.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + 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.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + 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.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + 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.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions 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; + } + /** + * + * + *
+     * Restrictions on STRING type values
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_StringRestrictions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_StringRestrictions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.class, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.Builder + .class); + } + + // Construct using + // com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + allowedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_StringRestrictions_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions build() { + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + buildPartial() { + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions result = + new com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions result) { + if (((bitField0_ & 0x00000001) != 0)) { + allowedValues_ = allowedValues_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.allowedValues_ = allowedValues_; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions result) { + int from_bitField0_ = bitField0_; + } + + @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.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) { + return mergeFrom( + (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions other) { + if (other + == com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance()) return this; + if (!other.allowedValues_.isEmpty()) { + if (allowedValues_.isEmpty()) { + allowedValues_ = other.allowedValues_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAllowedValuesIsMutable(); + allowedValues_.addAll(other.allowedValues_); + } + 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(); + ensureAllowedValuesIsMutable(); + allowedValues_.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 allowedValues_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAllowedValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + allowedValues_ = new com.google.protobuf.LazyStringArrayList(allowedValues_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @return A list containing the allowedValues. + */ + public com.google.protobuf.ProtocolStringList getAllowedValuesList() { + return allowedValues_.getUnmodifiableView(); + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @return The count of allowedValues. + */ + public int getAllowedValuesCount() { + return allowedValues_.size(); + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the element to return. + * @return The allowedValues at the given index. + */ + public java.lang.String getAllowedValues(int index) { + return allowedValues_.get(index); + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the allowedValues at the given index. + */ + public com.google.protobuf.ByteString getAllowedValuesBytes(int index) { + return allowedValues_.getByteString(index); + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index to set the value at. + * @param value The allowedValues to set. + * @return This builder for chaining. + */ + public Builder setAllowedValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedValuesIsMutable(); + allowedValues_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param value The allowedValues to add. + * @return This builder for chaining. + */ + public Builder addAllowedValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedValuesIsMutable(); + allowedValues_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param values The allowedValues to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedValues(java.lang.Iterable values) { + ensureAllowedValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedValues_); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @return This builder for chaining. + */ + public Builder clearAllowedValues() { + allowedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param value The bytes of the allowedValues to add. + * @return This builder for chaining. + */ + public Builder addAllowedValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowedValuesIsMutable(); + allowedValues_.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.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) + private static final com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions(); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringRestrictions 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.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface IntegerRestrictionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return Whether the minValue field is set. + */ + boolean hasMinValue(); + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return The minValue. + */ + com.google.protobuf.Int64Value getMinValue(); + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + com.google.protobuf.Int64ValueOrBuilder getMinValueOrBuilder(); + + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return Whether the maxValue field is set. + */ + boolean hasMaxValue(); + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return The maxValue. + */ + com.google.protobuf.Int64Value getMaxValue(); + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + com.google.protobuf.Int64ValueOrBuilder getMaxValueOrBuilder(); + } + /** + * + * + *
+   * Restrictions on INTEGER type values.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} + */ + public static final class IntegerRestrictions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) + IntegerRestrictionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use IntegerRestrictions.newBuilder() to construct. + private IntegerRestrictions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IntegerRestrictions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IntegerRestrictions(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_IntegerRestrictions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_IntegerRestrictions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.class, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.Builder + .class); + } + + public static final int MIN_VALUE_FIELD_NUMBER = 1; + private com.google.protobuf.Int64Value minValue_; + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return Whether the minValue field is set. + */ + @java.lang.Override + public boolean hasMinValue() { + return minValue_ != null; + } + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return The minValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getMinValue() { + return minValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : minValue_; + } + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getMinValueOrBuilder() { + return minValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : minValue_; + } + + public static final int MAX_VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.Int64Value maxValue_; + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return Whether the maxValue field is set. + */ + @java.lang.Override + public boolean hasMaxValue() { + return maxValue_ != null; + } + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return The maxValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getMaxValue() { + return maxValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : maxValue_; + } + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getMaxValueOrBuilder() { + return maxValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : maxValue_; + } + + 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 (minValue_ != null) { + output.writeMessage(1, getMinValue()); + } + if (maxValue_ != null) { + output.writeMessage(2, getMaxValue()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minValue_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMinValue()); + } + if (maxValue_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMaxValue()); + } + 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.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions other = + (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) obj; + + if (hasMinValue() != other.hasMinValue()) return false; + if (hasMinValue()) { + if (!getMinValue().equals(other.getMinValue())) return false; + } + if (hasMaxValue() != other.hasMaxValue()) return false; + if (hasMaxValue()) { + if (!getMaxValue().equals(other.getMaxValue())) 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 (hasMinValue()) { + hash = (37 * hash) + MIN_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getMinValue().hashCode(); + } + if (hasMaxValue()) { + hash = (37 * hash) + MAX_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getMaxValue().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + 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.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + 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.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + 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.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + 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.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + 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.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions 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; + } + /** + * + * + *
+     * Restrictions on INTEGER type values.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_IntegerRestrictions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_IntegerRestrictions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.class, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.Builder + .class); + } + + // Construct using + // com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minValue_ = null; + if (minValueBuilder_ != null) { + minValueBuilder_.dispose(); + minValueBuilder_ = null; + } + maxValue_ = null; + if (maxValueBuilder_ != null) { + maxValueBuilder_.dispose(); + maxValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_IntegerRestrictions_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions build() { + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + buildPartial() { + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions result = + new com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.minValue_ = minValueBuilder_ == null ? minValue_ : minValueBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxValue_ = maxValueBuilder_ == null ? maxValue_ : maxValueBuilder_.build(); + } + } + + @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.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) { + return mergeFrom( + (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions other) { + if (other + == com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance()) return this; + if (other.hasMinValue()) { + mergeMinValue(other.getMinValue()); + } + if (other.hasMaxValue()) { + mergeMaxValue(other.getMaxValue()); + } + 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(getMinValueFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getMaxValueFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + 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.protobuf.Int64Value minValue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + minValueBuilder_; + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return Whether the minValue field is set. + */ + public boolean hasMinValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return The minValue. + */ + public com.google.protobuf.Int64Value getMinValue() { + if (minValueBuilder_ == null) { + return minValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : minValue_; + } else { + return minValueBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public Builder setMinValue(com.google.protobuf.Int64Value value) { + if (minValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minValue_ = value; + } else { + minValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public Builder setMinValue(com.google.protobuf.Int64Value.Builder builderForValue) { + if (minValueBuilder_ == null) { + minValue_ = builderForValue.build(); + } else { + minValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public Builder mergeMinValue(com.google.protobuf.Int64Value value) { + if (minValueBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && minValue_ != null + && minValue_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getMinValueBuilder().mergeFrom(value); + } else { + minValue_ = value; + } + } else { + minValueBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public Builder clearMinValue() { + bitField0_ = (bitField0_ & ~0x00000001); + minValue_ = null; + if (minValueBuilder_ != null) { + minValueBuilder_.dispose(); + minValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public com.google.protobuf.Int64Value.Builder getMinValueBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMinValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public com.google.protobuf.Int64ValueOrBuilder getMinValueOrBuilder() { + if (minValueBuilder_ != null) { + return minValueBuilder_.getMessageOrBuilder(); + } else { + return minValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : minValue_; + } + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + getMinValueFieldBuilder() { + if (minValueBuilder_ == null) { + minValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getMinValue(), getParentForChildren(), isClean()); + minValue_ = null; + } + return minValueBuilder_; + } + + private com.google.protobuf.Int64Value maxValue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + maxValueBuilder_; + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return Whether the maxValue field is set. + */ + public boolean hasMaxValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return The maxValue. + */ + public com.google.protobuf.Int64Value getMaxValue() { + if (maxValueBuilder_ == null) { + return maxValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : maxValue_; + } else { + return maxValueBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public Builder setMaxValue(com.google.protobuf.Int64Value value) { + if (maxValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maxValue_ = value; + } else { + maxValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public Builder setMaxValue(com.google.protobuf.Int64Value.Builder builderForValue) { + if (maxValueBuilder_ == null) { + maxValue_ = builderForValue.build(); + } else { + maxValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public Builder mergeMaxValue(com.google.protobuf.Int64Value value) { + if (maxValueBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && maxValue_ != null + && maxValue_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getMaxValueBuilder().mergeFrom(value); + } else { + maxValue_ = value; + } + } else { + maxValueBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public Builder clearMaxValue() { + bitField0_ = (bitField0_ & ~0x00000002); + maxValue_ = null; + if (maxValueBuilder_ != null) { + maxValueBuilder_.dispose(); + maxValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public com.google.protobuf.Int64Value.Builder getMaxValueBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getMaxValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public com.google.protobuf.Int64ValueOrBuilder getMaxValueOrBuilder() { + if (maxValueBuilder_ != null) { + return maxValueBuilder_.getMessageOrBuilder(); + } else { + return maxValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : maxValue_; + } + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + getMaxValueFieldBuilder() { + if (maxValueBuilder_ == null) { + maxValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getMaxValue(), getParentForChildren(), isClean()); + maxValue_ = null; + } + return maxValueBuilder_; + } + + @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.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) + private static final com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions(); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IntegerRestrictions 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.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int restrictionsCase_ = 0; + private java.lang.Object restrictions_; + + public enum RestrictionsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STRING_RESTRICTIONS(7), + INTEGER_RESTRICTIONS(8), + RESTRICTIONS_NOT_SET(0); + private final int value; + + private RestrictionsCase(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 RestrictionsCase valueOf(int value) { + return forNumber(value); + } + + public static RestrictionsCase forNumber(int value) { + switch (value) { + case 7: + return STRING_RESTRICTIONS; + case 8: + return INTEGER_RESTRICTIONS; + case 0: + return RESTRICTIONS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RestrictionsCase getRestrictionsCase() { + return RestrictionsCase.forNumber(restrictionsCase_); + } + + public static final int STRING_RESTRICTIONS_FIELD_NUMBER = 7; + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return Whether the stringRestrictions field is set. + */ + @java.lang.Override + public boolean hasStringRestrictions() { + return restrictionsCase_ == 7; + } + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return The stringRestrictions. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + getStringRestrictions() { + if (restrictionsCase_ == 7) { + return (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictionsOrBuilder + getStringRestrictionsOrBuilder() { + if (restrictionsCase_ == 7) { + return (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + + public static final int INTEGER_RESTRICTIONS_FIELD_NUMBER = 8; + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return Whether the integerRestrictions field is set. + */ + @java.lang.Override + public boolean hasIntegerRestrictions() { + return restrictionsCase_ == 8; + } + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return The integerRestrictions. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + getIntegerRestrictions() { + if (restrictionsCase_ == 8) { + return (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder + getIntegerRestrictionsOrBuilder() { + if (restrictionsCase_ == 8) { + return (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * The name of the flag resource, following Google Cloud conventions, e.g.:
+   *  * projects/{project}/locations/{location}/flags/{flag}
+   * This field currently has no semantic meaning.
+   * 
+ * + * 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 name of the flag resource, following Google Cloud conventions, e.g.:
+   *  * projects/{project}/locations/{location}/flags/{flag}
+   * This field currently has no semantic meaning.
+   * 
+ * + * 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 FLAG_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object flagName_ = ""; + /** + * + * + *
+   * The name of the database flag, e.g. "max_allowed_packets".
+   * The is a possibly key for the Instance.database_flags map field.
+   * 
+ * + * string flag_name = 2; + * + * @return The flagName. + */ + @java.lang.Override + public java.lang.String getFlagName() { + java.lang.Object ref = flagName_; + 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(); + flagName_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the database flag, e.g. "max_allowed_packets".
+   * The is a possibly key for the Instance.database_flags map field.
+   * 
+ * + * string flag_name = 2; + * + * @return The bytes for flagName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFlagNameBytes() { + java.lang.Object ref = flagName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + flagName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_TYPE_FIELD_NUMBER = 3; + private int valueType_ = 0; + /** + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The enum numeric value on the wire for valueType. + */ + @java.lang.Override + public int getValueTypeValue() { + return valueType_; + } + /** + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The valueType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType getValueType() { + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType result = + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType.forNumber(valueType_); + return result == null + ? com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType.UNRECOGNIZED + : result; + } + + public static final int ACCEPTS_MULTIPLE_VALUES_FIELD_NUMBER = 4; + private boolean acceptsMultipleValues_ = false; + /** + * + * + *
+   * Whether the database flag accepts multiple values. If true,
+   * a comma-separated list of stringified values may be specified.
+   * 
+ * + * bool accepts_multiple_values = 4; + * + * @return The acceptsMultipleValues. + */ + @java.lang.Override + public boolean getAcceptsMultipleValues() { + return acceptsMultipleValues_; + } + + public static final int SUPPORTED_DB_VERSIONS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List supportedDbVersions_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.alloydb.v1alpha.DatabaseVersion> + supportedDbVersions_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.alloydb.v1alpha.DatabaseVersion>() { + public com.google.cloud.alloydb.v1alpha.DatabaseVersion convert( + java.lang.Integer from) { + com.google.cloud.alloydb.v1alpha.DatabaseVersion result = + com.google.cloud.alloydb.v1alpha.DatabaseVersion.forNumber(from); + return result == null + ? com.google.cloud.alloydb.v1alpha.DatabaseVersion.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the supportedDbVersions. + */ + @java.lang.Override + public java.util.List + getSupportedDbVersionsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.alloydb.v1alpha.DatabaseVersion>( + supportedDbVersions_, supportedDbVersions_converter_); + } + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * @return The count of supportedDbVersions. + */ + @java.lang.Override + public int getSupportedDbVersionsCount() { + return supportedDbVersions_.size(); + } + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the element to return. + * @return The supportedDbVersions at the given index. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DatabaseVersion getSupportedDbVersions(int index) { + return supportedDbVersions_converter_.convert(supportedDbVersions_.get(index)); + } + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the enum numeric values on the wire for supportedDbVersions. + */ + @java.lang.Override + public java.util.List getSupportedDbVersionsValueList() { + return supportedDbVersions_; + } + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of supportedDbVersions at the given index. + */ + @java.lang.Override + public int getSupportedDbVersionsValue(int index) { + return supportedDbVersions_.get(index); + } + + private int supportedDbVersionsMemoizedSerializedSize; + + public static final int REQUIRES_DB_RESTART_FIELD_NUMBER = 6; + private boolean requiresDbRestart_ = false; + /** + * + * + *
+   * Whether setting or updating this flag on an Instance requires a database
+   * restart. If a flag that requires database restart is set, the backend
+   * will automatically restart the database (making sure to satisfy any
+   * availability SLO's).
+   * 
+ * + * bool requires_db_restart = 6; + * + * @return The requiresDbRestart. + */ + @java.lang.Override + public boolean getRequiresDbRestart() { + return requiresDbRestart_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(flagName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, flagName_); + } + if (valueType_ + != com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType.VALUE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, valueType_); + } + if (acceptsMultipleValues_ != false) { + output.writeBool(4, acceptsMultipleValues_); + } + if (getSupportedDbVersionsList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(supportedDbVersionsMemoizedSerializedSize); + } + for (int i = 0; i < supportedDbVersions_.size(); i++) { + output.writeEnumNoTag(supportedDbVersions_.get(i)); + } + if (requiresDbRestart_ != false) { + output.writeBool(6, requiresDbRestart_); + } + if (restrictionsCase_ == 7) { + output.writeMessage( + 7, + (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) + restrictions_); + } + if (restrictionsCase_ == 8) { + output.writeMessage( + 8, + (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_); + } + 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(flagName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, flagName_); + } + if (valueType_ + != com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType.VALUE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, valueType_); + } + if (acceptsMultipleValues_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, acceptsMultipleValues_); + } + { + int dataSize = 0; + for (int i = 0; i < supportedDbVersions_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(supportedDbVersions_.get(i)); + } + size += dataSize; + if (!getSupportedDbVersionsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + supportedDbVersionsMemoizedSerializedSize = dataSize; + } + if (requiresDbRestart_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requiresDbRestart_); + } + if (restrictionsCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, + (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) + restrictions_); + } + if (restrictionsCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, + (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_); + } + 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.alloydb.v1alpha.SupportedDatabaseFlag)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag other = + (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag) obj; + + if (!getName().equals(other.getName())) return false; + if (!getFlagName().equals(other.getFlagName())) return false; + if (valueType_ != other.valueType_) return false; + if (getAcceptsMultipleValues() != other.getAcceptsMultipleValues()) return false; + if (!supportedDbVersions_.equals(other.supportedDbVersions_)) return false; + if (getRequiresDbRestart() != other.getRequiresDbRestart()) return false; + if (!getRestrictionsCase().equals(other.getRestrictionsCase())) return false; + switch (restrictionsCase_) { + case 7: + if (!getStringRestrictions().equals(other.getStringRestrictions())) return false; + break; + case 8: + if (!getIntegerRestrictions().equals(other.getIntegerRestrictions())) 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) + FLAG_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFlagName().hashCode(); + hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + valueType_; + hash = (37 * hash) + ACCEPTS_MULTIPLE_VALUES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAcceptsMultipleValues()); + if (getSupportedDbVersionsCount() > 0) { + hash = (37 * hash) + SUPPORTED_DB_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + supportedDbVersions_.hashCode(); + } + hash = (37 * hash) + REQUIRES_DB_RESTART_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequiresDbRestart()); + switch (restrictionsCase_) { + case 7: + hash = (37 * hash) + STRING_RESTRICTIONS_FIELD_NUMBER; + hash = (53 * hash) + getStringRestrictions().hashCode(); + break; + case 8: + hash = (37 * hash) + INTEGER_RESTRICTIONS_FIELD_NUMBER; + hash = (53 * hash) + getIntegerRestrictions().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag 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.alloydb.v1alpha.SupportedDatabaseFlag parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag 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.alloydb.v1alpha.SupportedDatabaseFlag parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag 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.alloydb.v1alpha.SupportedDatabaseFlag parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag 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.alloydb.v1alpha.SupportedDatabaseFlag parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag 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.alloydb.v1alpha.SupportedDatabaseFlag 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; + } + /** + * + * + *
+   * SupportedDatabaseFlag gives general information about a database flag,
+   * like type and allowed values. This is a static value that is defined
+   * on the server side, and it cannot be modified by callers.
+   * To set the Database flags on a particular Instance, a caller should modify
+   * the Instance.database_flags field.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.SupportedDatabaseFlag) + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlagOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.class, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (stringRestrictionsBuilder_ != null) { + stringRestrictionsBuilder_.clear(); + } + if (integerRestrictionsBuilder_ != null) { + integerRestrictionsBuilder_.clear(); + } + name_ = ""; + flagName_ = ""; + valueType_ = 0; + acceptsMultipleValues_ = false; + supportedDbVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + requiresDbRestart_ = false; + restrictionsCase_ = 0; + restrictions_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag build() { + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag buildPartial() { + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag result = + new com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag result) { + if (((bitField0_ & 0x00000040) != 0)) { + supportedDbVersions_ = java.util.Collections.unmodifiableList(supportedDbVersions_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.supportedDbVersions_ = supportedDbVersions_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.flagName_ = flagName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.valueType_ = valueType_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.acceptsMultipleValues_ = acceptsMultipleValues_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.requiresDbRestart_ = requiresDbRestart_; + } + } + + private void buildPartialOneofs(com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag result) { + result.restrictionsCase_ = restrictionsCase_; + result.restrictions_ = this.restrictions_; + if (restrictionsCase_ == 7 && stringRestrictionsBuilder_ != null) { + result.restrictions_ = stringRestrictionsBuilder_.build(); + } + if (restrictionsCase_ == 8 && integerRestrictionsBuilder_ != null) { + result.restrictions_ = integerRestrictionsBuilder_.build(); + } + } + + @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.alloydb.v1alpha.SupportedDatabaseFlag) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag other) { + if (other == com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFlagName().isEmpty()) { + flagName_ = other.flagName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.valueType_ != 0) { + setValueTypeValue(other.getValueTypeValue()); + } + if (other.getAcceptsMultipleValues() != false) { + setAcceptsMultipleValues(other.getAcceptsMultipleValues()); + } + if (!other.supportedDbVersions_.isEmpty()) { + if (supportedDbVersions_.isEmpty()) { + supportedDbVersions_ = other.supportedDbVersions_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.addAll(other.supportedDbVersions_); + } + onChanged(); + } + if (other.getRequiresDbRestart() != false) { + setRequiresDbRestart(other.getRequiresDbRestart()); + } + switch (other.getRestrictionsCase()) { + case STRING_RESTRICTIONS: + { + mergeStringRestrictions(other.getStringRestrictions()); + break; + } + case INTEGER_RESTRICTIONS: + { + mergeIntegerRestrictions(other.getIntegerRestrictions()); + break; + } + case RESTRICTIONS_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(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 18: + { + flagName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 24: + { + valueType_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 24 + case 32: + { + acceptsMultipleValues_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 32 + case 40: + { + int tmpRaw = input.readEnum(); + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.add(tmpRaw); + break; + } // case 40 + case 42: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 42 + case 48: + { + requiresDbRestart_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 48 + case 58: + { + input.readMessage( + getStringRestrictionsFieldBuilder().getBuilder(), extensionRegistry); + restrictionsCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage( + getIntegerRestrictionsFieldBuilder().getBuilder(), extensionRegistry); + restrictionsCase_ = 8; + break; + } // case 66 + 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 restrictionsCase_ = 0; + private java.lang.Object restrictions_; + + public RestrictionsCase getRestrictionsCase() { + return RestrictionsCase.forNumber(restrictionsCase_); + } + + public Builder clearRestrictions() { + restrictionsCase_ = 0; + restrictions_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.Builder, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictionsOrBuilder> + stringRestrictionsBuilder_; + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return Whether the stringRestrictions field is set. + */ + @java.lang.Override + public boolean hasStringRestrictions() { + return restrictionsCase_ == 7; + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return The stringRestrictions. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + getStringRestrictions() { + if (stringRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 7) { + return (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } else { + if (restrictionsCase_ == 7) { + return stringRestrictionsBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + public Builder setStringRestrictions( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions value) { + if (stringRestrictionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + restrictions_ = value; + onChanged(); + } else { + stringRestrictionsBuilder_.setMessage(value); + } + restrictionsCase_ = 7; + return this; + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + public Builder setStringRestrictions( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.Builder + builderForValue) { + if (stringRestrictionsBuilder_ == null) { + restrictions_ = builderForValue.build(); + onChanged(); + } else { + stringRestrictionsBuilder_.setMessage(builderForValue.build()); + } + restrictionsCase_ = 7; + return this; + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + public Builder mergeStringRestrictions( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions value) { + if (stringRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 7 + && restrictions_ + != com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance()) { + restrictions_ = + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.newBuilder( + (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) + restrictions_) + .mergeFrom(value) + .buildPartial(); + } else { + restrictions_ = value; + } + onChanged(); + } else { + if (restrictionsCase_ == 7) { + stringRestrictionsBuilder_.mergeFrom(value); + } else { + stringRestrictionsBuilder_.setMessage(value); + } + } + restrictionsCase_ = 7; + return this; + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + public Builder clearStringRestrictions() { + if (stringRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 7) { + restrictionsCase_ = 0; + restrictions_ = null; + onChanged(); + } + } else { + if (restrictionsCase_ == 7) { + restrictionsCase_ = 0; + restrictions_ = null; + } + stringRestrictionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.Builder + getStringRestrictionsBuilder() { + return getStringRestrictionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictionsOrBuilder + getStringRestrictionsOrBuilder() { + if ((restrictionsCase_ == 7) && (stringRestrictionsBuilder_ != null)) { + return stringRestrictionsBuilder_.getMessageOrBuilder(); + } else { + if (restrictionsCase_ == 7) { + return (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.Builder, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictionsOrBuilder> + getStringRestrictionsFieldBuilder() { + if (stringRestrictionsBuilder_ == null) { + if (!(restrictionsCase_ == 7)) { + restrictions_ = + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + stringRestrictionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.Builder, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictionsOrBuilder>( + (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) + restrictions_, + getParentForChildren(), + isClean()); + restrictions_ = null; + } + restrictionsCase_ = 7; + onChanged(); + return stringRestrictionsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.Builder, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder> + integerRestrictionsBuilder_; + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return Whether the integerRestrictions field is set. + */ + @java.lang.Override + public boolean hasIntegerRestrictions() { + return restrictionsCase_ == 8; + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return The integerRestrictions. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + getIntegerRestrictions() { + if (integerRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 8) { + return (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } else { + if (restrictionsCase_ == 8) { + return integerRestrictionsBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + public Builder setIntegerRestrictions( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions value) { + if (integerRestrictionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + restrictions_ = value; + onChanged(); + } else { + integerRestrictionsBuilder_.setMessage(value); + } + restrictionsCase_ = 8; + return this; + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + public Builder setIntegerRestrictions( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.Builder + builderForValue) { + if (integerRestrictionsBuilder_ == null) { + restrictions_ = builderForValue.build(); + onChanged(); + } else { + integerRestrictionsBuilder_.setMessage(builderForValue.build()); + } + restrictionsCase_ = 8; + return this; + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + public Builder mergeIntegerRestrictions( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions value) { + if (integerRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 8 + && restrictions_ + != com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance()) { + restrictions_ = + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.newBuilder( + (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_) + .mergeFrom(value) + .buildPartial(); + } else { + restrictions_ = value; + } + onChanged(); + } else { + if (restrictionsCase_ == 8) { + integerRestrictionsBuilder_.mergeFrom(value); + } else { + integerRestrictionsBuilder_.setMessage(value); + } + } + restrictionsCase_ = 8; + return this; + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + public Builder clearIntegerRestrictions() { + if (integerRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 8) { + restrictionsCase_ = 0; + restrictions_ = null; + onChanged(); + } + } else { + if (restrictionsCase_ == 8) { + restrictionsCase_ = 0; + restrictions_ = null; + } + integerRestrictionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.Builder + getIntegerRestrictionsBuilder() { + return getIntegerRestrictionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder + getIntegerRestrictionsOrBuilder() { + if ((restrictionsCase_ == 8) && (integerRestrictionsBuilder_ != null)) { + return integerRestrictionsBuilder_.getMessageOrBuilder(); + } else { + if (restrictionsCase_ == 8) { + return (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.Builder, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder> + getIntegerRestrictionsFieldBuilder() { + if (integerRestrictionsBuilder_ == null) { + if (!(restrictionsCase_ == 8)) { + restrictions_ = + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + integerRestrictionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.Builder, + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + .IntegerRestrictionsOrBuilder>( + (com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_, + getParentForChildren(), + isClean()); + restrictions_ = null; + } + restrictionsCase_ = 8; + onChanged(); + return integerRestrictionsBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the flag resource, following Google Cloud conventions, e.g.:
+     *  * projects/{project}/locations/{location}/flags/{flag}
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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 name of the flag resource, following Google Cloud conventions, e.g.:
+     *  * projects/{project}/locations/{location}/flags/{flag}
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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 name of the flag resource, following Google Cloud conventions, e.g.:
+     *  * projects/{project}/locations/{location}/flags/{flag}
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the flag resource, following Google Cloud conventions, e.g.:
+     *  * projects/{project}/locations/{location}/flags/{flag}
+     * This field currently has no semantic meaning.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the flag resource, following Google Cloud conventions, e.g.:
+     *  * projects/{project}/locations/{location}/flags/{flag}
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object flagName_ = ""; + /** + * + * + *
+     * The name of the database flag, e.g. "max_allowed_packets".
+     * The is a possibly key for the Instance.database_flags map field.
+     * 
+ * + * string flag_name = 2; + * + * @return The flagName. + */ + public java.lang.String getFlagName() { + java.lang.Object ref = flagName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + flagName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the database flag, e.g. "max_allowed_packets".
+     * The is a possibly key for the Instance.database_flags map field.
+     * 
+ * + * string flag_name = 2; + * + * @return The bytes for flagName. + */ + public com.google.protobuf.ByteString getFlagNameBytes() { + java.lang.Object ref = flagName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + flagName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the database flag, e.g. "max_allowed_packets".
+     * The is a possibly key for the Instance.database_flags map field.
+     * 
+ * + * string flag_name = 2; + * + * @param value The flagName to set. + * @return This builder for chaining. + */ + public Builder setFlagName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + flagName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the database flag, e.g. "max_allowed_packets".
+     * The is a possibly key for the Instance.database_flags map field.
+     * 
+ * + * string flag_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearFlagName() { + flagName_ = getDefaultInstance().getFlagName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the database flag, e.g. "max_allowed_packets".
+     * The is a possibly key for the Instance.database_flags map field.
+     * 
+ * + * string flag_name = 2; + * + * @param value The bytes for flagName to set. + * @return This builder for chaining. + */ + public Builder setFlagNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + flagName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private int valueType_ = 0; + /** + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The enum numeric value on the wire for valueType. + */ + @java.lang.Override + public int getValueTypeValue() { + return valueType_; + } + /** + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @param value The enum numeric value on the wire for valueType to set. + * @return This builder for chaining. + */ + public Builder setValueTypeValue(int value) { + valueType_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The valueType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType getValueType() { + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType result = + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType.forNumber(valueType_); + return result == null + ? com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType.UNRECOGNIZED + : result; + } + /** + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @param value The valueType to set. + * @return This builder for chaining. + */ + public Builder setValueType( + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + valueType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return This builder for chaining. + */ + public Builder clearValueType() { + bitField0_ = (bitField0_ & ~0x00000010); + valueType_ = 0; + onChanged(); + return this; + } + + private boolean acceptsMultipleValues_; + /** + * + * + *
+     * Whether the database flag accepts multiple values. If true,
+     * a comma-separated list of stringified values may be specified.
+     * 
+ * + * bool accepts_multiple_values = 4; + * + * @return The acceptsMultipleValues. + */ + @java.lang.Override + public boolean getAcceptsMultipleValues() { + return acceptsMultipleValues_; + } + /** + * + * + *
+     * Whether the database flag accepts multiple values. If true,
+     * a comma-separated list of stringified values may be specified.
+     * 
+ * + * bool accepts_multiple_values = 4; + * + * @param value The acceptsMultipleValues to set. + * @return This builder for chaining. + */ + public Builder setAcceptsMultipleValues(boolean value) { + + acceptsMultipleValues_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the database flag accepts multiple values. If true,
+     * a comma-separated list of stringified values may be specified.
+     * 
+ * + * bool accepts_multiple_values = 4; + * + * @return This builder for chaining. + */ + public Builder clearAcceptsMultipleValues() { + bitField0_ = (bitField0_ & ~0x00000020); + acceptsMultipleValues_ = false; + onChanged(); + return this; + } + + private java.util.List supportedDbVersions_ = + java.util.Collections.emptyList(); + + private void ensureSupportedDbVersionsIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + supportedDbVersions_ = new java.util.ArrayList(supportedDbVersions_); + bitField0_ |= 0x00000040; + } + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * + * @return A list containing the supportedDbVersions. + */ + public java.util.List + getSupportedDbVersionsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.alloydb.v1alpha.DatabaseVersion>( + supportedDbVersions_, supportedDbVersions_converter_); + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * + * @return The count of supportedDbVersions. + */ + public int getSupportedDbVersionsCount() { + return supportedDbVersions_.size(); + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * + * @param index The index of the element to return. + * @return The supportedDbVersions at the given index. + */ + public com.google.cloud.alloydb.v1alpha.DatabaseVersion getSupportedDbVersions(int index) { + return supportedDbVersions_converter_.convert(supportedDbVersions_.get(index)); + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * + * @param index The index to set the value at. + * @param value The supportedDbVersions to set. + * @return This builder for chaining. + */ + public Builder setSupportedDbVersions( + int index, com.google.cloud.alloydb.v1alpha.DatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * + * @param value The supportedDbVersions to add. + * @return This builder for chaining. + */ + public Builder addSupportedDbVersions(com.google.cloud.alloydb.v1alpha.DatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * + * @param values The supportedDbVersions to add. + * @return This builder for chaining. + */ + public Builder addAllSupportedDbVersions( + java.lang.Iterable values) { + ensureSupportedDbVersionsIsMutable(); + for (com.google.cloud.alloydb.v1alpha.DatabaseVersion value : values) { + supportedDbVersions_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * + * @return This builder for chaining. + */ + public Builder clearSupportedDbVersions() { + supportedDbVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * + * @return A list containing the enum numeric values on the wire for supportedDbVersions. + */ + public java.util.List getSupportedDbVersionsValueList() { + return java.util.Collections.unmodifiableList(supportedDbVersions_); + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of supportedDbVersions at the given index. + */ + public int getSupportedDbVersionsValue(int index) { + return supportedDbVersions_.get(index); + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for supportedDbVersions to set. + * @return This builder for chaining. + */ + public Builder setSupportedDbVersionsValue(int index, int value) { + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * + * @param value The enum numeric value on the wire for supportedDbVersions to add. + * @return This builder for chaining. + */ + public Builder addSupportedDbVersionsValue(int value) { + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * + * @param values The enum numeric values on the wire for supportedDbVersions to add. + * @return This builder for chaining. + */ + public Builder addAllSupportedDbVersionsValue(java.lang.Iterable values) { + ensureSupportedDbVersionsIsMutable(); + for (int value : values) { + supportedDbVersions_.add(value); + } + onChanged(); + return this; + } + + private boolean requiresDbRestart_; + /** + * + * + *
+     * Whether setting or updating this flag on an Instance requires a database
+     * restart. If a flag that requires database restart is set, the backend
+     * will automatically restart the database (making sure to satisfy any
+     * availability SLO's).
+     * 
+ * + * bool requires_db_restart = 6; + * + * @return The requiresDbRestart. + */ + @java.lang.Override + public boolean getRequiresDbRestart() { + return requiresDbRestart_; + } + /** + * + * + *
+     * Whether setting or updating this flag on an Instance requires a database
+     * restart. If a flag that requires database restart is set, the backend
+     * will automatically restart the database (making sure to satisfy any
+     * availability SLO's).
+     * 
+ * + * bool requires_db_restart = 6; + * + * @param value The requiresDbRestart to set. + * @return This builder for chaining. + */ + public Builder setRequiresDbRestart(boolean value) { + + requiresDbRestart_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether setting or updating this flag on an Instance requires a database
+     * restart. If a flag that requires database restart is set, the backend
+     * will automatically restart the database (making sure to satisfy any
+     * availability SLO's).
+     * 
+ * + * bool requires_db_restart = 6; + * + * @return This builder for chaining. + */ + public Builder clearRequiresDbRestart() { + bitField0_ = (bitField0_ & ~0x00000080); + requiresDbRestart_ = 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.alloydb.v1alpha.SupportedDatabaseFlag) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.SupportedDatabaseFlag) + private static final com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag(); + } + + public static com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SupportedDatabaseFlag 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.alloydb.v1alpha.SupportedDatabaseFlag getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SupportedDatabaseFlagName.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SupportedDatabaseFlagName.java new file mode 100644 index 000000000000..cc5af6714abd --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SupportedDatabaseFlagName.java @@ -0,0 +1,218 @@ +/* + * 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.alloydb.v1alpha; + +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 SupportedDatabaseFlagName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_FLAG = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/flags/{flag}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String flag; + + @Deprecated + protected SupportedDatabaseFlagName() { + project = null; + location = null; + flag = null; + } + + private SupportedDatabaseFlagName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + flag = Preconditions.checkNotNull(builder.getFlag()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFlag() { + return flag; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SupportedDatabaseFlagName of(String project, String location, String flag) { + return newBuilder().setProject(project).setLocation(location).setFlag(flag).build(); + } + + public static String format(String project, String location, String flag) { + return newBuilder().setProject(project).setLocation(location).setFlag(flag).build().toString(); + } + + public static SupportedDatabaseFlagName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_FLAG.validatedMatch( + formattedString, + "SupportedDatabaseFlagName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("flag")); + } + + 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 (SupportedDatabaseFlagName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_FLAG.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 (flag != null) { + fieldMapBuilder.put("flag", flag); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_FLAG.instantiate( + "project", project, "location", location, "flag", flag); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SupportedDatabaseFlagName that = ((SupportedDatabaseFlagName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.flag, that.flag); + } + 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(flag); + return h; + } + + /** Builder for projects/{project}/locations/{location}/flags/{flag}. */ + public static class Builder { + private String project; + private String location; + private String flag; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFlag() { + return flag; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setFlag(String flag) { + this.flag = flag; + return this; + } + + private Builder(SupportedDatabaseFlagName supportedDatabaseFlagName) { + this.project = supportedDatabaseFlagName.project; + this.location = supportedDatabaseFlagName.location; + this.flag = supportedDatabaseFlagName.flag; + } + + public SupportedDatabaseFlagName build() { + return new SupportedDatabaseFlagName(this); + } + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SupportedDatabaseFlagOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SupportedDatabaseFlagOrBuilder.java new file mode 100644 index 000000000000..9aa3e4d66d45 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SupportedDatabaseFlagOrBuilder.java @@ -0,0 +1,275 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface SupportedDatabaseFlagOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.SupportedDatabaseFlag) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return Whether the stringRestrictions field is set. + */ + boolean hasStringRestrictions(); + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return The stringRestrictions. + */ + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions getStringRestrictions(); + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictionsOrBuilder + getStringRestrictionsOrBuilder(); + + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return Whether the integerRestrictions field is set. + */ + boolean hasIntegerRestrictions(); + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return The integerRestrictions. + */ + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + getIntegerRestrictions(); + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder + getIntegerRestrictionsOrBuilder(); + + /** + * + * + *
+   * The name of the flag resource, following Google Cloud conventions, e.g.:
+   *  * projects/{project}/locations/{location}/flags/{flag}
+   * This field currently has no semantic meaning.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the flag resource, following Google Cloud conventions, e.g.:
+   *  * projects/{project}/locations/{location}/flags/{flag}
+   * This field currently has no semantic meaning.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The name of the database flag, e.g. "max_allowed_packets".
+   * The is a possibly key for the Instance.database_flags map field.
+   * 
+ * + * string flag_name = 2; + * + * @return The flagName. + */ + java.lang.String getFlagName(); + /** + * + * + *
+   * The name of the database flag, e.g. "max_allowed_packets".
+   * The is a possibly key for the Instance.database_flags map field.
+   * 
+ * + * string flag_name = 2; + * + * @return The bytes for flagName. + */ + com.google.protobuf.ByteString getFlagNameBytes(); + + /** + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The enum numeric value on the wire for valueType. + */ + int getValueTypeValue(); + /** + * .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The valueType. + */ + com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType getValueType(); + + /** + * + * + *
+   * Whether the database flag accepts multiple values. If true,
+   * a comma-separated list of stringified values may be specified.
+   * 
+ * + * bool accepts_multiple_values = 4; + * + * @return The acceptsMultipleValues. + */ + boolean getAcceptsMultipleValues(); + + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the supportedDbVersions. + */ + java.util.List getSupportedDbVersionsList(); + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * @return The count of supportedDbVersions. + */ + int getSupportedDbVersionsCount(); + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the element to return. + * @return The supportedDbVersions at the given index. + */ + com.google.cloud.alloydb.v1alpha.DatabaseVersion getSupportedDbVersions(int index); + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the enum numeric values on the wire for supportedDbVersions. + */ + java.util.List getSupportedDbVersionsValueList(); + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of supportedDbVersions at the given index. + */ + int getSupportedDbVersionsValue(int index); + + /** + * + * + *
+   * Whether setting or updating this flag on an Instance requires a database
+   * restart. If a flag that requires database restart is set, the backend
+   * will automatically restart the database (making sure to satisfy any
+   * availability SLO's).
+   * 
+ * + * bool requires_db_restart = 6; + * + * @return The requiresDbRestart. + */ + boolean getRequiresDbRestart(); + + public com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.RestrictionsCase + getRestrictionsCase(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateBackupRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateBackupRequest.java new file mode 100644 index 000000000000..94d930853425 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateBackupRequest.java @@ -0,0 +1,1497 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for updating a Backup
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.UpdateBackupRequest} + */ +public final class UpdateBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.UpdateBackupRequest) + UpdateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateBackupRequest.newBuilder() to construct. + private UpdateBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateBackupRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateBackupRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.UpdateBackupRequest.class, + com.google.cloud.alloydb.v1alpha.UpdateBackupRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int BACKUP_FIELD_NUMBER = 2; + private com.google.cloud.alloydb.v1alpha.Backup backup_; + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return backup_ != null; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Backup getBackup() { + return backup_ == null ? com.google.cloud.alloydb.v1alpha.Backup.getDefaultInstance() : backup_; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.BackupOrBuilder getBackupOrBuilder() { + return backup_ == null ? com.google.cloud.alloydb.v1alpha.Backup.getDefaultInstance() : backup_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_ = false; + /** + * + * + *
+   * Optional. If set to true, update succeeds even if instance is not found. In
+   * that case, a new backup is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (backup_ != null) { + output.writeMessage(2, getBackup()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (backup_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBackup()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + 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.alloydb.v1alpha.UpdateBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.UpdateBackupRequest other = + (com.google.cloud.alloydb.v1alpha.UpdateBackupRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) 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 (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.UpdateBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateBackupRequest 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.alloydb.v1alpha.UpdateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateBackupRequest 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.alloydb.v1alpha.UpdateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateBackupRequest 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.alloydb.v1alpha.UpdateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateBackupRequest 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.alloydb.v1alpha.UpdateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateBackupRequest 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.alloydb.v1alpha.UpdateBackupRequest 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; + } + /** + * + * + *
+   * Message for updating a Backup
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.UpdateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.UpdateBackupRequest) + com.google.cloud.alloydb.v1alpha.UpdateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.UpdateBackupRequest.class, + com.google.cloud.alloydb.v1alpha.UpdateBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.UpdateBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UpdateBackupRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.UpdateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UpdateBackupRequest build() { + com.google.cloud.alloydb.v1alpha.UpdateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UpdateBackupRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.UpdateBackupRequest result = + new com.google.cloud.alloydb.v1alpha.UpdateBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.UpdateBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backup_ = backupBuilder_ == null ? backup_ : backupBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @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.alloydb.v1alpha.UpdateBackupRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.UpdateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.UpdateBackupRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.UpdateBackupRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getBackupFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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.alloydb.v1alpha.Backup backup_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Backup, + com.google.cloud.alloydb.v1alpha.Backup.Builder, + com.google.cloud.alloydb.v1alpha.BackupOrBuilder> + backupBuilder_; + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.cloud.alloydb.v1alpha.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null + ? com.google.cloud.alloydb.v1alpha.Backup.getDefaultInstance() + : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.alloydb.v1alpha.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + } else { + backupBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.alloydb.v1alpha.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.cloud.alloydb.v1alpha.Backup value) { + if (backupBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && backup_ != null + && backup_ != com.google.cloud.alloydb.v1alpha.Backup.getDefaultInstance()) { + getBackupBuilder().mergeFrom(value); + } else { + backup_ = value; + } + } else { + backupBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + bitField0_ = (bitField0_ & ~0x00000002); + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.Backup.Builder getBackupBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getBackupFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null + ? com.google.cloud.alloydb.v1alpha.Backup.getDefaultInstance() + : backup_; + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Backup, + com.google.cloud.alloydb.v1alpha.Backup.Builder, + com.google.cloud.alloydb.v1alpha.BackupOrBuilder> + getBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Backup, + com.google.cloud.alloydb.v1alpha.Backup.Builder, + com.google.cloud.alloydb.v1alpha.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new backup is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new backup is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new backup is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000010); + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1alpha.UpdateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.UpdateBackupRequest) + private static final com.google.cloud.alloydb.v1alpha.UpdateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.UpdateBackupRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBackupRequest 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.alloydb.v1alpha.UpdateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateBackupRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateBackupRequestOrBuilder.java new file mode 100644 index 000000000000..a5d21c11da2b --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateBackupRequestOrBuilder.java @@ -0,0 +1,189 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface UpdateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.UpdateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.cloud.alloydb.v1alpha.Backup getBackup(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1alpha.BackupOrBuilder getBackupOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. If set to true, update succeeds even if instance is not found. In
+   * that case, a new backup is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateClusterRequest.java new file mode 100644 index 000000000000..a85bdf2daa88 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateClusterRequest.java @@ -0,0 +1,1506 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for updating a Cluster
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.UpdateClusterRequest} + */ +public final class UpdateClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.UpdateClusterRequest) + UpdateClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateClusterRequest.newBuilder() to construct. + private UpdateClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateClusterRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateClusterRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.UpdateClusterRequest.class, + com.google.cloud.alloydb.v1alpha.UpdateClusterRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int CLUSTER_FIELD_NUMBER = 2; + private com.google.cloud.alloydb.v1alpha.Cluster cluster_; + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + @java.lang.Override + public boolean hasCluster() { + return cluster_ != null; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster getCluster() { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the update
+   * request.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_ = false; + /** + * + * + *
+   * Optional. If set to true, update succeeds even if cluster is not found. In
+   * that case, a new cluster is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (cluster_ != null) { + output.writeMessage(2, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (cluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + 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.alloydb.v1alpha.UpdateClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.UpdateClusterRequest other = + (com.google.cloud.alloydb.v1alpha.UpdateClusterRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasCluster() != other.hasCluster()) return false; + if (hasCluster()) { + if (!getCluster().equals(other.getCluster())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) 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 (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasCluster()) { + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.UpdateClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateClusterRequest 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.alloydb.v1alpha.UpdateClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateClusterRequest 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.alloydb.v1alpha.UpdateClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateClusterRequest 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.alloydb.v1alpha.UpdateClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateClusterRequest 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.alloydb.v1alpha.UpdateClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateClusterRequest 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.alloydb.v1alpha.UpdateClusterRequest 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; + } + /** + * + * + *
+   * Message for updating a Cluster
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.UpdateClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.UpdateClusterRequest) + com.google.cloud.alloydb.v1alpha.UpdateClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.UpdateClusterRequest.class, + com.google.cloud.alloydb.v1alpha.UpdateClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.UpdateClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UpdateClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.UpdateClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UpdateClusterRequest build() { + com.google.cloud.alloydb.v1alpha.UpdateClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UpdateClusterRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.UpdateClusterRequest result = + new com.google.cloud.alloydb.v1alpha.UpdateClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.UpdateClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @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.alloydb.v1alpha.UpdateClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.UpdateClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.UpdateClusterRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.UpdateClusterRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasCluster()) { + mergeCluster(other.getCluster()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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.alloydb.v1alpha.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster, + com.google.cloud.alloydb.v1alpha.Cluster.Builder, + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.alloydb.v1alpha.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1alpha.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1alpha.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.alloydb.v1alpha.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCluster() { + bitField0_ = (bitField0_ & ~0x00000002); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster, + com.google.cloud.alloydb.v1alpha.Cluster.Builder, + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster, + com.google.cloud.alloydb.v1alpha.Cluster.Builder, + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. If set to true, update succeeds even if cluster is not found. In
+     * that case, a new cluster is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if cluster is not found. In
+     * that case, a new cluster is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if cluster is not found. In
+     * that case, a new cluster is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000010); + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1alpha.UpdateClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.UpdateClusterRequest) + private static final com.google.cloud.alloydb.v1alpha.UpdateClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.UpdateClusterRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateClusterRequest 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.alloydb.v1alpha.UpdateClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateClusterRequestOrBuilder.java new file mode 100644 index 000000000000..1ab1c63f7767 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateClusterRequestOrBuilder.java @@ -0,0 +1,190 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface UpdateClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.UpdateClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.alloydb.v1alpha.Cluster getCluster(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1alpha.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the update
+   * request.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. If set to true, update succeeds even if cluster is not found. In
+   * that case, a new cluster is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateInstanceRequest.java new file mode 100644 index 000000000000..7c0200b76484 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateInstanceRequest.java @@ -0,0 +1,1506 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for updating a Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.UpdateInstanceRequest} + */ +public final class UpdateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.UpdateInstanceRequest) + UpdateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateInstanceRequest.newBuilder() to construct. + private UpdateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateInstanceRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateInstanceRequest(); + } + + @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.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest.class, + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + private com.google.cloud.alloydb.v1alpha.Instance instance_; + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return instance_ != null; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance getInstance() { + return instance_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.InstanceOrBuilder getInstanceOrBuilder() { + return instance_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance() + : instance_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the update
+   * request.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_ = false; + /** + * + * + *
+   * Optional. If set to true, update succeeds even if instance is not found. In
+   * that case, a new instance is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (instance_ != null) { + output.writeMessage(2, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (instance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + 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.alloydb.v1alpha.UpdateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest other = + (com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) 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 (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest 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.alloydb.v1alpha.UpdateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest 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.alloydb.v1alpha.UpdateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest 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.alloydb.v1alpha.UpdateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest 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.alloydb.v1alpha.UpdateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest 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.alloydb.v1alpha.UpdateInstanceRequest 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; + } + /** + * + * + *
+   * Message for updating a Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.UpdateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.UpdateInstanceRequest) + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest.class, + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest build() { + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest result = + new com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @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.alloydb.v1alpha.UpdateInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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.alloydb.v1alpha.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance, + com.google.cloud.alloydb.v1alpha.Instance.Builder, + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.alloydb.v1alpha.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1alpha.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + } else { + instanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1alpha.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.alloydb.v1alpha.Instance value) { + if (instanceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && instance_ != null + && instance_ != com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); + } else { + instance_ = value; + } + } else { + instanceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + bitField0_ = (bitField0_ & ~0x00000002); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.Instance.Builder getInstanceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance, + com.google.cloud.alloydb.v1alpha.Instance.Builder, + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance, + com.google.cloud.alloydb.v1alpha.Instance.Builder, + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new instance is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new instance is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new instance is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000010); + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1alpha.UpdateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.UpdateInstanceRequest) + private static final com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateInstanceRequest 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.alloydb.v1alpha.UpdateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..4206a0853855 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateInstanceRequestOrBuilder.java @@ -0,0 +1,190 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface UpdateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.UpdateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.alloydb.v1alpha.Instance getInstance(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1alpha.InstanceOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the update
+   * request.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. If set to true, update succeeds even if instance is not found. In
+   * that case, a new instance is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UserPassword.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UserPassword.java new file mode 100644 index 000000000000..1474f352d7c2 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UserPassword.java @@ -0,0 +1,812 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * The username/password for a database user. Used for specifying initial
+ * users at cluster creation time.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.UserPassword} + */ +public final class UserPassword extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.UserPassword) + UserPasswordOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserPassword.newBuilder() to construct. + private UserPassword(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserPassword() { + user_ = ""; + password_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserPassword(); + } + + @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.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_UserPassword_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_UserPassword_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.UserPassword.class, + com.google.cloud.alloydb.v1alpha.UserPassword.Builder.class); + } + + public static final int USER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object user_ = ""; + /** + * + * + *
+   * The database username.
+   * 
+ * + * string user = 1; + * + * @return The user. + */ + @java.lang.Override + public java.lang.String getUser() { + java.lang.Object ref = user_; + 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(); + user_ = s; + return s; + } + } + /** + * + * + *
+   * The database username.
+   * 
+ * + * string user = 1; + * + * @return The bytes for user. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + /** + * + * + *
+   * The initial password for the user.
+   * 
+ * + * string password = 2; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + 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(); + password_ = s; + return s; + } + } + /** + * + * + *
+   * The initial password for the user.
+   * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = 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(user_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, user_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); + } + 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(user_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, user_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); + } + 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.alloydb.v1alpha.UserPassword)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.UserPassword other = + (com.google.cloud.alloydb.v1alpha.UserPassword) obj; + + if (!getUser().equals(other.getUser())) return false; + if (!getPassword().equals(other.getPassword())) 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) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.UserPassword parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.UserPassword 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.alloydb.v1alpha.UserPassword parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.UserPassword 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.alloydb.v1alpha.UserPassword parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.UserPassword parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.UserPassword parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.UserPassword 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.alloydb.v1alpha.UserPassword parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.UserPassword 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.alloydb.v1alpha.UserPassword parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.UserPassword 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.alloydb.v1alpha.UserPassword 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 username/password for a database user. Used for specifying initial
+   * users at cluster creation time.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.UserPassword} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.UserPassword) + com.google.cloud.alloydb.v1alpha.UserPasswordOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_UserPassword_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_UserPassword_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.UserPassword.class, + com.google.cloud.alloydb.v1alpha.UserPassword.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.UserPassword.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + user_ = ""; + password_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_UserPassword_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UserPassword getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.UserPassword.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UserPassword build() { + com.google.cloud.alloydb.v1alpha.UserPassword result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UserPassword buildPartial() { + com.google.cloud.alloydb.v1alpha.UserPassword result = + new com.google.cloud.alloydb.v1alpha.UserPassword(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.UserPassword result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.user_ = user_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.password_ = password_; + } + } + + @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.alloydb.v1alpha.UserPassword) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.UserPassword) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.UserPassword other) { + if (other == com.google.cloud.alloydb.v1alpha.UserPassword.getDefaultInstance()) return this; + if (!other.getUser().isEmpty()) { + user_ = other.user_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000002; + 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: + { + user_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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 user_ = ""; + /** + * + * + *
+     * The database username.
+     * 
+ * + * string user = 1; + * + * @return The user. + */ + public java.lang.String getUser() { + java.lang.Object ref = user_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + user_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The database username.
+     * 
+ * + * string user = 1; + * + * @return The bytes for user. + */ + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The database username.
+     * 
+ * + * string user = 1; + * + * @param value The user to set. + * @return This builder for chaining. + */ + public Builder setUser(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The database username.
+     * 
+ * + * string user = 1; + * + * @return This builder for chaining. + */ + public Builder clearUser() { + user_ = getDefaultInstance().getUser(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The database username.
+     * 
+ * + * string user = 1; + * + * @param value The bytes for user to set. + * @return This builder for chaining. + */ + public Builder setUserBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + user_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + /** + * + * + *
+     * The initial password for the user.
+     * 
+ * + * string password = 2; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The initial password for the user.
+     * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The initial password for the user.
+     * 
+ * + * string password = 2; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The initial password for the user.
+     * 
+ * + * string password = 2; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The initial password for the user.
+     * 
+ * + * string password = 2; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000002; + 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.alloydb.v1alpha.UserPassword) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.UserPassword) + private static final com.google.cloud.alloydb.v1alpha.UserPassword DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.UserPassword(); + } + + public static com.google.cloud.alloydb.v1alpha.UserPassword getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserPassword 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.alloydb.v1alpha.UserPassword getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UserPasswordOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UserPasswordOrBuilder.java new file mode 100644 index 000000000000..528bcaf79020 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UserPasswordOrBuilder.java @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface UserPasswordOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.UserPassword) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The database username.
+   * 
+ * + * string user = 1; + * + * @return The user. + */ + java.lang.String getUser(); + /** + * + * + *
+   * The database username.
+   * 
+ * + * string user = 1; + * + * @return The bytes for user. + */ + com.google.protobuf.ByteString getUserBytes(); + + /** + * + * + *
+   * The initial password for the user.
+   * 
+ * + * string password = 2; + * + * @return The password. + */ + java.lang.String getPassword(); + /** + * + * + *
+   * The initial password for the user.
+   * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/proto/google/cloud/alloydb/v1alpha/resources.proto b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/proto/google/cloud/alloydb/v1alpha/resources.proto new file mode 100644 index 000000000000..9fb582bb9f7d --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/proto/google/cloud/alloydb/v1alpha/resources.proto @@ -0,0 +1,1028 @@ +// 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.alloydb.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Alpha"; +option go_package = "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.cloud.alloydb.v1alpha"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1alpha"; +option ruby_package = "Google::Cloud::AlloyDb::V1alpha"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; + +// The supported database engine versions. +enum DatabaseVersion { + // This is an unknown database version. + DATABASE_VERSION_UNSPECIFIED = 0; + + // DEPRECATED - The database version is Postgres 13. + POSTGRES_13 = 1 [deprecated = true]; + + // The database version is Postgres 14. + POSTGRES_14 = 2; +} + +// View on Instance. Pass this enum to rpcs that returns an Instance message to +// control which subsets of fields to get. +enum InstanceView { + // INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + INSTANCE_VIEW_UNSPECIFIED = 0; + + // BASIC server responses for a primary or read instance include all the + // relevant instance details, excluding the details of each node in the + // instance. The default value. + INSTANCE_VIEW_BASIC = 1; + + // FULL response is equivalent to BASIC for primary instance (for now). + // For read pool instance, this includes details of each node in the pool. + INSTANCE_VIEW_FULL = 2; +} + +// The username/password for a database user. Used for specifying initial +// users at cluster creation time. +message UserPassword { + // The database username. + string user = 1; + + // The initial password for the user. + string password = 2; +} + +// Subset of the source instance configuration that is available when reading +// the cluster resource. +message MigrationSource { + // Denote the type of migration source that created this cluster. + enum MigrationSourceType { + // Migration source is unknown. + MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + + // DMS source means the cluster was created via DMS migration job. + DMS = 1; + } + + // Output only. The host and port of the on-premises instance in host:port + // format + string host_port = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Place holder for the external source identifier(e.g DMS job + // name) that created the cluster. + string reference_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Type of migration source. + MigrationSourceType source_type = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// EncryptionConfig describes the encryption config of a cluster or a backup +// that is encrypted with a CMEK (customer-managed encryption key). +message EncryptionConfig { + // The fully-qualified resource name of the KMS key. + // Each Cloud KMS key is regionalized and has the following format: + // projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + string kms_key_name = 1; +} + +// EncryptionInfo describes the encryption information of a cluster or a backup. +message EncryptionInfo { + // Possible encryption types. + enum Type { + // Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. + TYPE_UNSPECIFIED = 0; + + // The data is encrypted at rest with a key that is fully managed by Google. + // No key version will be populated. This is the default state. + GOOGLE_DEFAULT_ENCRYPTION = 1; + + // The data is encrypted at rest with a key that is managed by the customer. + // KMS key versions will be populated. + CUSTOMER_MANAGED_ENCRYPTION = 2; + } + + // Output only. Type of encryption. + Type encryption_type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud KMS key versions that are being used to protect the + // database or the backup. + repeated string kms_key_versions = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// SSL configuration for an AlloyDB Cluster. +message SslConfig { + // SSL mode options. + enum SslMode { + // SSL mode not specified. Defaults to SSL_MODE_ALLOW. + SSL_MODE_UNSPECIFIED = 0; + + // SSL connections are optional. CA verification not enforced. + SSL_MODE_ALLOW = 1; + + // SSL connections are required. CA verification not enforced. + // Clients may use locally self-signed certificates (default psql client + // behavior). + SSL_MODE_REQUIRE = 2; + + // SSL connections are required. CA verification enforced. + // Clients must have certificates signed by a Cluster CA, e.g. via + // GenerateClientCertificate. + SSL_MODE_VERIFY_CA = 3; + } + + // Certificate Authority (CA) source for SSL/TLS certificates. + enum CaSource { + // Certificate Authority (CA) source not specified. Defaults to + // CA_SOURCE_MANAGED. + CA_SOURCE_UNSPECIFIED = 0; + + // Certificate Authority (CA) managed by the AlloyDB Cluster. + CA_SOURCE_MANAGED = 1; + } + + // Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + SslMode ssl_mode = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + // supported currently, and is the default value. + CaSource ca_source = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message describing the user-specified automated backup policy. +// +// All fields in the automated backup policy are optional. Defaults for each +// field are provided if they are not set. +message AutomatedBackupPolicy { + // A weekly schedule starts a backup at prescribed start times within a + // day, for the specified days of the week. + // + // The weekly schedule message is flexible and can be used to create many + // types of schedules. For example, to have a daily backup that starts at + // 22:00, configure the `start_times` field to have one element "22:00" and + // the `days_of_week` field to have all seven days of the week. + message WeeklySchedule { + // The times during the day to start a backup. The start times are assumed + // to be in UTC and to be an exact hour (e.g., 04:00:00). + // + // If no start times are provided, a single fixed start time is chosen + // arbitrarily. + repeated google.type.TimeOfDay start_times = 1; + + // The days of the week to perform a backup. + // + // If this field is left empty, the default of every day of the week is + // used. + repeated google.type.DayOfWeek days_of_week = 2; + } + + // A time based retention policy specifies that all backups within a certain + // time period should be retained. + message TimeBasedRetention { + // The retention period. + google.protobuf.Duration retention_period = 1; + } + + // A quantity based policy specifies that a certain number of the most recent + // successful backups should be retained. + message QuantityBasedRetention { + // The number of backups to retain. + int32 count = 1; + } + + // The schedule for this automated backup policy. + // + // A schedule specifies times at which to start a backup. If a backup + // window is also provided, the backup is guaranteed to be started and + // completed within the start time plus the backup window. If the backup is + // not completed within the backup window it is marked as failed. + // + // If not set, the schedule defaults to a weekly schedule with one backup + // per day and a start time chosen arbitrarily. + oneof schedule { + // Weekly schedule for the Backup. + WeeklySchedule weekly_schedule = 2; + } + + // The retention policy for automated backups. + // + // The retention policy for a backup is fixed at the time the backup is + // created. Changes to this field only apply to new backups taken with the + // policy; the retentions of existing backups remain unchanged. + // + // If no retention policy is set, a default of 14 days is used. + oneof retention { + // Time-based Backup retention policy. + TimeBasedRetention time_based_retention = 4; + + // Quantity-based Backup retention policy to retain recent backups. + QuantityBasedRetention quantity_based_retention = 5; + } + + // Whether automated automated backups are enabled. If not set, defaults to + // true. + optional bool enabled = 1; + + // The length of the time window during which a backup can be + // taken. If a backup does not succeed within this time window, it will be + // canceled and considered failed. + // + // The backup window must be at least 5 minutes long. There is no upper bound + // on the window. If not set, it defaults to 1 hour. + google.protobuf.Duration backup_window = 3; + + // Optional. The encryption config can be specified to encrypt the + // backups with a customer-managed encryption key (CMEK). When this field is + // not specified, the backup will then use default encryption scheme to + // protect the user data. + EncryptionConfig encryption_config = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // The location where the backup will be stored. Currently, the only supported + // option is to store the backup in the same region as the cluster. + // + // If empty, defaults to the region of the cluster. + string location = 6; + + // Labels to apply to backups created using this configuration. + map labels = 7; +} + +// ContinuousBackupConfig describes the continuous backups recovery +// configurations of a cluster. +message ContinuousBackupConfig { + // Whether ContinuousBackup is enabled. + optional bool enabled = 1; + + // The number of days backups and logs will be retained, which determines the + // window of time that data is recoverable for. If not set, it defaults to 14 + // days. + int32 recovery_window_days = 4; + + // The encryption config can be specified to encrypt the + // backups with a customer-managed encryption key (CMEK). When this field is + // not specified, the backup will then use default encryption scheme to + // protect the user data. + EncryptionConfig encryption_config = 3; +} + +// ContinuousBackupInfo describes the continuous backup properties of a +// cluster. +message ContinuousBackupInfo { + // Output only. The encryption information for the WALs and backups required + // for ContinuousBackup. + EncryptionInfo encryption_info = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When ContinuousBackup was most recently enabled. Set to null + // if ContinuousBackup is not enabled. + google.protobuf.Timestamp enabled_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Days of the week on which a continuous backup is taken. Output + // only field. Ignored if passed into the request. + repeated google.type.DayOfWeek schedule = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message describing a BackupSource. +message BackupSource { + // Output only. The system-generated UID of the backup which was used to + // create this resource. The UID is generated when the backup is created, and + // it is retained until the backup is deleted. + string backup_uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The name of the backup resource with the format: + // * projects/{project}/locations/{region}/backups/{backup_id} + string backup_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; +} + +// Message describing a ContinuousBackupSource. +message ContinuousBackupSource { + // Required. The source cluster from which to restore. This cluster must have + // continuous backup enabled for this operation to succeed. For the required + // format, see the comment on the Cluster.name field. + string cluster = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The point in time to restore to. + google.protobuf.Timestamp point_in_time = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// A cluster is a collection of regional AlloyDB resources. It can include a +// primary instance and one or more read pool instances. +// All cluster resources share a storage layer, which scales as needed. +message Cluster { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Cluster" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}" + style: DECLARATIVE_FRIENDLY + }; + + // Configuration information for the secondary cluster. This should be set + // if and only if the cluster is of type SECONDARY. + message SecondaryConfig { + // The name of the primary cluster name with the format: + // * projects/{project}/locations/{region}/clusters/{cluster_id} + string primary_cluster_name = 1; + } + + // Configuration for the primary cluster. It has the list of clusters that are + // replicating from this cluster. This should be set if and only if the + // cluster is of type PRIMARY. + message PrimaryConfig { + // Output only. Names of the clusters that are replicating from this + // cluster. + repeated string secondary_cluster_names = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Cluster State + enum State { + // The state of the cluster is unknown. + STATE_UNSPECIFIED = 0; + + // The cluster is active and running. + READY = 1; + + // The cluster is stopped. All instances in the cluster are stopped. + // Customers can start a stopped cluster at any point and all their + // instances will come back to life with same names and IP resources. In + // this state, customer pays for storage. + // Associated backups could also be present in a stopped cluster. + STOPPED = 2; + + // The cluster is empty and has no associated resources. + // All instances, associated storage and backups have been deleted. + EMPTY = 3; + + // The cluster is being created. + CREATING = 4; + + // The cluster is being deleted. + DELETING = 5; + + // The creation of the cluster failed. + FAILED = 6; + + // The cluster is bootstrapping with data from some other source. + // Direct mutations to the cluster (e.g. adding read pool) are not allowed. + BOOTSTRAPPING = 7; + + // The cluster is under maintenance. AlloyDB regularly performs maintenance + // and upgrades on customer clusters. Updates on the cluster are + // not allowed while the cluster is in this state. + MAINTENANCE = 8; + + // The cluster is being promoted. + PROMOTING = 9; + } + + // Type of Cluster + enum ClusterType { + // The type of the cluster is unknown. + CLUSTER_TYPE_UNSPECIFIED = 0; + + // Primary cluster that support read and write operations. + PRIMARY = 1; + + // Secondary cluster that is replicating from another region. + // This only supports read. + SECONDARY = 2; + } + + // In case of an imported cluster, this field contains information about the + // source this cluster was imported from. + oneof source { + // Output only. Cluster created from backup. + BackupSource backup_source = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cluster created via DMS migration. + MigrationSource migration_source = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The name of the cluster resource with the format: + // * projects/{project}/locations/{region}/clusters/{cluster_id} + // where the cluster ID segment should satisfy the regex expression + // `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + // The prefix of the cluster resource name is the name of the parent resource: + // * projects/{project}/locations/{region} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Cluster. + string display_name = 2; + + // Output only. The system-generated UID of the resource. The UID is assigned + // when the resource is created, and it is retained until it is deleted. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 7; + + // Output only. The current serving state of the cluster. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of the cluster. This is an output-only field and it's + // populated at the Cluster creation time or the Cluster promotion + // time. The cluster type is determined by which RPC was used to create + // the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + ClusterType cluster_type = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The database engine major version. This is an output-only + // field and it's populated at the Cluster creation time. This field cannot be + // changed after cluster creation. + DatabaseVersion database_version = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The resource link for the VPC network in which cluster resources + // are created and from which they are accessible via Private IP. The network + // must belong to the same project as the cluster. It is specified in the + // form: "projects/{project_number}/global/networks/{network_id}". This is + // required to create a cluster. It can be updated, but it cannot be removed. + string network = 10 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 11; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 12; + + // Output only. Reconciling (https://google.aip.dev/128#reconciliation). + // Set to true if the current state of Cluster does not match the user's + // intended state, and the service is actively updating the resource to + // reconcile them. This can happen due to user-triggered updates or + // system actions like failover or maintenance. + bool reconciling = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Initial user to setup during cluster creation. Required. + // If used in `RestoreCluster` this is ignored. + UserPassword initial_user = 14 [(google.api.field_behavior) = INPUT_ONLY]; + + // The automated backup policy for this cluster. + // + // If no policy is provided then the default policy will be used. If backups + // are supported for the cluster, the default policy takes one backup a day, + // has a backup window of 1 hour, and retains backups for 14 days. + // For more information on the defaults, consult the + // documentation for the message type. + AutomatedBackupPolicy automated_backup_policy = 17; + + // SSL configuration for this AlloyDB Cluster. + SslConfig ssl_config = 18; + + // Optional. The encryption config can be specified to encrypt the data disks + // and other persistent data resources of a cluster with a + // customer-managed encryption key (CMEK). When this field is not + // specified, the cluster will then use default encryption scheme to + // protect the user data. + EncryptionConfig encryption_config = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The encryption information for the cluster. + EncryptionInfo encryption_info = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Continuous backup configuration for this cluster. + ContinuousBackupConfig continuous_backup_config = 27 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Continuous backup properties for this cluster. + ContinuousBackupInfo continuous_backup_info = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cross Region replication config specific to SECONDARY cluster. + SecondaryConfig secondary_config = 22; + + // Output only. Cross Region replication config specific to PRIMARY cluster. + PrimaryConfig primary_config = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// An Instance is a computing unit that an end customer can connect to. +// It's the main unit of computing resources in AlloyDB. +message Instance { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}" + style: DECLARATIVE_FRIENDLY + }; + + // MachineConfig describes the configuration of a machine. + message MachineConfig { + // The number of CPU's in the VM instance. + int32 cpu_count = 1; + } + + // Details of a single node in the instance. + // Nodes in an AlloyDB instance are ephemereal, they can change during + // update, failover, autohealing and resize operations. + message Node { + // The Compute Engine zone of the VM e.g. "us-central1-b". + string zone_id = 1; + + // The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + string id = 2; + + // The private IP address of the VM e.g. "10.57.0.34". + string ip = 3; + + // Determined by state of the compute VM and postgres-service health. + // Compute VM state can have values listed in + // https://cloud.google.com/compute/docs/instances/instance-life-cycle and + // postgres-service health can have values: HEALTHY and UNHEALTHY. + string state = 4; + } + + // QueryInsights Instance specific configuration. + message QueryInsightsInstanceConfig { + // Record application tags for an instance. + // This flag is turned "on" by default. + optional bool record_application_tags = 2; + + // Record client address for an instance. Client address is PII information. + // This flag is turned "on" by default. + optional bool record_client_address = 3; + + // Query string length. The default value is 1024. + // Any integer between 256 and 4500 is considered valid. + uint32 query_string_length = 4; + + // Number of query execution plans captured by Insights per minute + // for all queries combined. The default value is 5. + // Any integer between 0 and 20 is considered valid. + optional uint32 query_plans_per_minute = 5; + } + + // Configuration for a read pool instance. + message ReadPoolConfig { + // Read capacity, i.e. number of nodes in a read pool instance. + int32 node_count = 1; + } + + // Instance State + enum State { + // The state of the instance is unknown. + STATE_UNSPECIFIED = 0; + + // The instance is active and running. + READY = 1; + + // The instance is stopped. Instance name and IP resources are preserved. + STOPPED = 2; + + // The instance is being created. + CREATING = 3; + + // The instance is being deleted. + DELETING = 4; + + // The instance is down for maintenance. + MAINTENANCE = 5; + + // The creation of the instance failed or a fatal error occurred during + // an operation on the instance. + // Note: Instances in this state would tried to be auto-repaired. And + // Customers should be able to restart, update or delete these instances. + FAILED = 6; + + // Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that + // index unused in case that state also needs to exposed via consumer apis + // in future. + // The instance has been configured to sync data from some other source. + BOOTSTRAPPING = 8; + + // The instance is being promoted. + PROMOTING = 9; + } + + // Type of an Instance + enum InstanceType { + // The type of the instance is unknown. + INSTANCE_TYPE_UNSPECIFIED = 0; + + // PRIMARY instances support read and write operations. + PRIMARY = 1; + + // READ POOL instances support read operations only. Each read pool instance + // consists of one or more homogeneous nodes. + // * Read pool of size 1 can only have zonal availability. + // * Read pools with node count of 2 or more can have regional + // availability (nodes are present in 2 or more zones in a region). + READ_POOL = 2; + + // SECONDARY instances support read operations only. SECONDARY instance + // is a cross-region read replica + SECONDARY = 3; + } + + // The Availability type of an instance. Potential values: + //
ZONAL: The instance serves data from only one zone. + // Outages in that zone affect instance availability. + //
REGIONAL: The instance can serve data from more than one zone + // in a region (it is highly available). + enum AvailabilityType { + // This is an unknown Availability type. + AVAILABILITY_TYPE_UNSPECIFIED = 0; + + // Zonal available instance. + ZONAL = 1; + + // Regional (or Highly) available instance. + REGIONAL = 2; + } + + // Output only. The name of the instance resource with the format: + // * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} + // where the cluster and instance ID segments should satisfy the regex + // expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + // lowercase letters, numbers, and dashes, starting with a letter, and ending + // with a letter or number. For more details see https://google.aip.dev/122. + // The prefix of the instance resource name is the name of the parent + // resource: + // * projects/{project}/locations/{region}/clusters/{cluster_id} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Instance. + string display_name = 2; + + // Output only. The system-generated UID of the resource. The UID is assigned + // when the resource is created, and it is retained until it is deleted. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 7; + + // Output only. The current serving state of the instance. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The type of the instance. Specified at creation time. + InstanceType instance_type = 9 [(google.api.field_behavior) = REQUIRED]; + + // Configurations for the machines that host the underlying + // database engine. + MachineConfig machine_config = 10; + + // Availability type of an Instance. + // Defaults to REGIONAL for both primary and read instances. + // Note that primary and read instances can have different availability types. + AvailabilityType availability_type = 11; + + // The Compute Engine zone that the instance should serve from, per + // https://cloud.google.com/compute/docs/regions-zones + // This can ONLY be specified for ZONAL instances. + // If present for a REGIONAL instance, an error will be thrown. + // If this is absent for a ZONAL instance, instance is created in a random + // zone with available capacity. + string gce_zone = 12; + + // Database flags. Set at instance level. + // * They are copied from primary instance on read instance creation. + // * Read instances can set new or override existing flags that are relevant + // for reads, e.g. for enabling columnar cache on a read instance. Flags + // set on read instance may or may not be present on primary. + // + // + // This is a list of "key": "value" pairs. + // "key": The name of the flag. These flags are passed at instance setup time, + // so include both server options and system variables for Postgres. Flags are + // specified with underscores, not hyphens. + // "value": The value of the flag. Booleans are set to **on** for true + // and **off** for false. This field must be omitted if the flag + // doesn't take a value. + map database_flags = 13; + + // Output only. This is set for the read-write VM of the PRIMARY instance + // only. + Node writable_node = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of available read-only VMs in this instance, including + // the standby for a PRIMARY instance. + repeated Node nodes = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration for query insights. + QueryInsightsInstanceConfig query_insights_config = 21; + + // Read pool specific config. + ReadPoolConfig read_pool_config = 14; + + // Output only. The IP address for the Instance. + // This is the connection endpoint for an end-user application. + string ip_address = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reconciling (https://google.aip.dev/128#reconciliation). + // Set to true if the current state of Instance does not match the user's + // intended state, and the service is actively updating the resource to + // reconcile them. This can happen due to user-triggered updates or + // system actions like failover or maintenance. + bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 17; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 18; +} + +// ConnectionInfo singleton resource. +// https://google.aip.dev/156 +message ConnectionInfo { + option (google.api.resource) = { + type: "alloydb.googleapis.com/ConnectionInfo" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo" + }; + + // The name of the ConnectionInfo singleton resource, e.g.: + // projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + // This field currently has no semantic meaning. + string name = 1; + + // Output only. The IP address for the Instance. + // This is the connection endpoint for an end-user application. + string ip_address = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The pem-encoded chain that may be used to verify the X.509 + // certificate. Expected to be in issuer-to-root order according to RFC 5246. + repeated string pem_certificate_chain = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The unique ID of the Instance. + string instance_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message describing Backup object +message Backup { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backups/{backup}" + style: DECLARATIVE_FRIENDLY + }; + + // Backup State + enum State { + // The state of the backup is unknown. + STATE_UNSPECIFIED = 0; + + // The backup is ready. + READY = 1; + + // The backup is creating. + CREATING = 2; + + // The backup failed. + FAILED = 3; + + // The backup is being deleted. + DELETING = 4; + } + + // Backup Type + enum Type { + // Backup Type is unknown. + TYPE_UNSPECIFIED = 0; + + // ON_DEMAND backups that were triggered by the customer (e.g., not + // AUTOMATED). + ON_DEMAND = 1; + + // AUTOMATED backups triggered by the automated backups scheduler pursuant + // to an automated backup policy. + AUTOMATED = 2; + + // CONTINUOUS backups triggered by the automated backups scheduler + // due to a continuous backup policy. + CONTINUOUS = 3; + } + + // Output only. The name of the backup resource with the format: + // * projects/{project}/locations/{region}/backups/{backup_id} + // where the cluster and backup ID segments should satisfy the regex + // expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + // lowercase letters, numbers, and dashes, starting with a letter, and ending + // with a letter or number. For more details see https://google.aip.dev/122. + // The prefix of the backup resource name is the name of the parent + // resource: + // * projects/{project}/locations/{region} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Backup. + string display_name = 2; + + // Output only. The system-generated UID of the resource. The UID is assigned + // when the resource is created, and it is retained until it is deleted. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 6; + + // Output only. The current state of the backup. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The backup type, which suggests the trigger for the backup. + Type type = 8; + + // User-provided description of the backup. + string description = 9; + + // Output only. The system-generated UID of the cluster which was used to + // create this resource. + string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The full resource name of the backup source cluster + // (e.g., projects//locations//clusters/). + string cluster_name = 10 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + // true, indicates that the service is actively updating the resource. This + // can happen due to user-triggered updates or system actions like failover or + // maintenance. + bool reconciling = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The encryption config can be specified to encrypt the + // backup with a customer-managed encryption key (CMEK). When this field is + // not specified, the backup will then use default encryption scheme to + // protect the user data. + EncryptionConfig encryption_config = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The encryption information for the backup. + EncryptionInfo encryption_info = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 14; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 16; + + // Output only. The size of the backup in bytes. + int64 size_bytes = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which after the backup is eligible to be garbage + // collected. It is the duration specified by the backup's retention policy, + // added to the backup's create_time. + google.protobuf.Timestamp expiry_time = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// SupportedDatabaseFlag gives general information about a database flag, +// like type and allowed values. This is a static value that is defined +// on the server side, and it cannot be modified by callers. +// To set the Database flags on a particular Instance, a caller should modify +// the Instance.database_flags field. +message SupportedDatabaseFlag { + option (google.api.resource) = { + type: "alloydb.googleapis.com/SupportedDatabaseFlag" + pattern: "projects/{project}/locations/{location}/flags/{flag}" + }; + + // Restrictions on STRING type values + message StringRestrictions { + // The list of allowed values, if bounded. This field will be empty + // if there is a unbounded number of allowed values. + repeated string allowed_values = 1; + } + + // Restrictions on INTEGER type values. + message IntegerRestrictions { + // The minimum value that can be specified, if applicable. + google.protobuf.Int64Value min_value = 1; + + // The maximum value that can be specified, if applicable. + google.protobuf.Int64Value max_value = 2; + } + + // ValueType describes the semantic type of the value that the flag accepts. + // Regardless of the ValueType, the Instance.database_flags field accepts the + // stringified version of the value, i.e. "20" or "3.14". + enum ValueType { + // This is an unknown flag type. + VALUE_TYPE_UNSPECIFIED = 0; + + // String type flag. + STRING = 1; + + // Integer type flag. + INTEGER = 2; + + // Float type flag. + FLOAT = 3; + + // Denotes that the flag does not accept any values. + NONE = 4; + } + + // The restrictions on the flag value per type. + oneof restrictions { + // Restriction on STRING type value. + StringRestrictions string_restrictions = 7; + + // Restriction on INTEGER type value. + IntegerRestrictions integer_restrictions = 8; + } + + // The name of the flag resource, following Google Cloud conventions, e.g.: + // * projects/{project}/locations/{location}/flags/{flag} + // This field currently has no semantic meaning. + string name = 1; + + // The name of the database flag, e.g. "max_allowed_packets". + // The is a possibly key for the Instance.database_flags map field. + string flag_name = 2; + + ValueType value_type = 3; + + // Whether the database flag accepts multiple values. If true, + // a comma-separated list of stringified values may be specified. + bool accepts_multiple_values = 4; + + // Major database engine versions for which this flag is supported. + repeated DatabaseVersion supported_db_versions = 5; + + // Whether setting or updating this flag on an Instance requires a database + // restart. If a flag that requires database restart is set, the backend + // will automatically restart the database (making sure to satisfy any + // availability SLO's). + bool requires_db_restart = 6; +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/proto/google/cloud/alloydb/v1alpha/service.proto b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/proto/google/cloud/alloydb/v1alpha/service.proto new file mode 100644 index 000000000000..792379eb69c1 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/proto/google/cloud/alloydb/v1alpha/service.proto @@ -0,0 +1,1329 @@ +// 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.alloydb.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/alloydb/v1alpha/resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Alpha"; +option go_package = "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.alloydb.v1alpha"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1alpha"; +option ruby_package = "Google::Cloud::AlloyDb::V1alpha"; + +// Service describing handlers for resources +service AlloyDBAdmin { + option (google.api.default_host) = "alloydb.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Clusters in a given project and location. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/clusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Cluster in a given project and location. + rpc CreateCluster(CreateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/clusters" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Cluster. + rpc UpdateCluster(UpdateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha/{cluster.name=projects/*/locations/*/clusters/*}" + body: "cluster" + }; + option (google.api.method_signature) = "cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Cluster. + rpc DeleteCluster(DeleteClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Promotes a SECONDARY cluster. This turns down replication + // from the PRIMARY cluster and promotes a secondary cluster + // into its own standalone cluster. + // Imperative only. + rpc PromoteCluster(PromoteClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/clusters/*}:promote" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new Cluster in a given project and location, with a volume + // restored from the provided source, either a backup ID or a point-in-time + // and a source cluster. + rpc RestoreCluster(RestoreClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/clusters:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Creates a cluster of type SECONDARY in the given location using + // the primary cluster as the source. + rpc CreateSecondaryCluster(CreateSecondaryClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/clusters:createsecondary" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Lists Instances in a given project and location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Instance in a given project and location. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new SECONDARY Instance in a given project and location. + rpc CreateSecondaryInstance(CreateSecondaryInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Creates new instances under the given project, location and cluster. + // There can be only one primary instance in a cluster. If the primary + // instance exists in the cluster as well as this request, then API will + // throw an error. + // The primary instance should exist before any read pool instance is + // created. If the primary instance is a part of the request payload, then + // the API will take care of creating instances in the correct order. + // This method is here to support Google-internal use cases, and is not meant + // for external customers to consume. Please do not start relying on it; its + // behavior is subject to change without notice. + rpc BatchCreateInstances(BatchCreateInstancesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate" + body: "requests" + }; + option (google.longrunning.operation_info) = { + response_type: "BatchCreateInstancesResponse" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Instance. + rpc UpdateInstance(UpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha/{instance.name=projects/*/locations/*/clusters/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Instance. + rpc DeleteInstance(DeleteInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Forces a Failover for a highly available instance. + // Failover promotes the HA standby instance as the new primary. + // Imperative only. + rpc FailoverInstance(FailoverInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:failover" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Restart an Instance in a cluster. + // Imperative only. + rpc RestartInstance(RestartInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:restart" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Lists Backups in a given project and location. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Backup in a given project and location. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup,backup_id"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Backup. + rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha/{backup.name=projects/*/locations/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists SupportedDatabaseFlags for a given project and location. + rpc ListSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest) + returns (ListSupportedDatabaseFlagsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/supportedDatabaseFlags" + }; + option (google.api.method_signature) = "parent"; + } + + // Generate a client certificate signed by a Cluster CA. + // The sole purpose of this endpoint is to support the Auth Proxy client and + // the endpoint's behavior is subject to change without notice, so do not rely + // on its behavior remaining constant. Future changes will not break the Auth + // Proxy client. + rpc GenerateClientCertificate(GenerateClientCertificateRequest) + returns (GenerateClientCertificateResponse) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Get instance metadata used for a connection. + rpc GetConnectionInfo(GetConnectionInfoRequest) returns (ConnectionInfo) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Message for requesting list of Clusters +message ListClustersRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Cluster.name field. Additionally, you can perform an + // aggregated list operation by specifying a value with the following format: + // * projects/{project}/locations/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Clusters +message ListClustersResponse { + // The list of Cluster + repeated Cluster clusters = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Cluster +message GetClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; +} + +message CreateSecondaryClusterRequest { + // Required. The name of the parent resource (the primary cluster). For the + // required format, see the comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object (the secondary cluster). + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Configuration of the requesting object (the secondary cluster). + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the create + // request. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating a Cluster +message CreateClusterRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the create + // request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Cluster +message UpdateClusterRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Cluster resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Cluster cluster = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the update + // request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, update succeeds even if cluster is not found. In + // that case, a new cluster is created and `update_mask` is ignored. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Cluster +message DeleteClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the Cluster. + // If an etag is provided and does not match the current etag of the Cluster, + // deletion will be blocked and an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to cascade delete child instances for given cluster. + bool force = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for promoting a Cluster +message PromoteClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the Cluster. + // If an etag is provided and does not match the current etag of the Cluster, + // deletion will be blocked and an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for restoring a Cluster from a backup or another cluster at a given +// point in time. +message RestoreClusterRequest { + // Required. + // The source to import from. + oneof source { + // Backup source. + BackupSource backup_source = 4; + + // ContinuousBackup source. Continuous backup needs to be enabled in the + // source cluster for this operation to succeed. + ContinuousBackupSource continuous_backup_source = 8; + } + + // Required. The name of the parent resource. For the required format, see the + // comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the import + // request. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Instances +message ListInstancesRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. Additionally, you can perform an + // aggregated list operation by specifying a value with one of the following + // formats: + // * projects/{project}/locations/-/clusters/- + // * projects/{project}/locations/{region}/clusters/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Instances +message ListInstancesResponse { + // The list of Instance + repeated Instance instances = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Instance +message GetInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // The view of the instance to return. + InstanceView view = 2; +} + +// Message for creating a Instance +message CreateInstanceRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. ID of the requesting object. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the create + // request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating a Secondary Instance +message CreateSecondaryInstanceRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. ID of the requesting object. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the create + // request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// See usage below for notes. +message CreateInstanceRequests { + // Required. Primary and read replica instances to be created. This list + // should not be empty. + repeated CreateInstanceRequest create_instance_requests = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Message for creating a batch of instances under the specified cluster. +message BatchCreateInstancesRequest { + // Required. The name of the parent resource. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. Resources being created. + CreateInstanceRequests requests = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating batches of instances in a cluster. +message BatchCreateInstancesResponse { + // Created instances. + repeated Instance instances = 1; +} + +// Message for metadata that is specific to BatchCreateInstances API. +message BatchCreateInstancesMetadata { + // The instances being created in the API call. Each string in this list + // is the server defined resource path for target instances in the request + // and for the format of each string, see the comment on the Instance.name + // field. + repeated string instance_targets = 1; + + // A map representing state of the instances involved in the + // BatchCreateInstances operation during the operation execution. + // The instance state will be in STATE_UNSPECIFIED state if the instance has + // not yet been picked up for processing. + // The key of the map is the name of the instance resource. + // For the format, see the comment on the Instance.name field. + map instance_statuses = 2; +} + +// Message for current status of an instance in the BatchCreateInstances +// operation. +// For example, lets say a BatchCreateInstances workflow has 4 instances, +// Instance1 through Instance4. Lets also assume that 2 instances succeeded +// but the third failed to create and the 4th was never picked up for creation +// because of failure of the previous one. Then, resulting states would look +// something like: +// 1. Instance1 = ROLLED_BACK +// 2. Instance2 = ROLLED_BACK +// 3. Instance3 = FAILED +// 4. Instance4 = FAILED +// However, while the operation is running, the instance might be in other +// states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states +// / do not get further updated once the operation is done. +message BatchCreateInstanceStatus { + // State contains all valid instance states for the BatchCreateInstances + // operation. This is mainly used for status reporting through the LRO + // metadata. + enum State { + // The state of the instance is unknown. + STATE_UNSPECIFIED = 0; + + // Instance is pending creation and has not yet been picked up for + // processsing in the backend. + PENDING_CREATE = 1; + + // The instance is active and running. + READY = 2; + + // The instance is being created. + CREATING = 3; + + // The instance is being deleted. + DELETING = 4; + + // The creation of the instance failed or a fatal error occurred during + // an operation on the instance or a batch of instances. + FAILED = 5; + + // The instance was created successfully, but was rolled back and deleted + // due to some other failure during BatchCreateInstances operation. + ROLLED_BACK = 6; + } + + // The current state of an instance involved in the batch create operation. + // Once the operation is complete, the final state of the instances in the + // LRO can be one of: + // 1. ACTIVE, indicating that instances were created successfully + // 2. FAILED, indicating that a particular instance failed creation + // 3. ROLLED_BACK indicating that although the instance was created + // successfully, it had to be rolled back and deleted due to failure in + // other steps of the workflow. + State state = 1; + + // DEPRECATED - Use the error field instead. + // Error, if any error occurred and is available, during instance creation. + string error_msg = 2; + + // The RPC status of the instance creation operation. This field will be + // present if an error happened during the instance creation. + google.rpc.Status error = 4; + + Instance.InstanceType type = 3; +} + +// Message for updating a Instance +message UpdateInstanceRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Instance resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the update + // request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, update succeeds even if instance is not found. In + // that case, a new instance is created and `update_mask` is ignored. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Instance +message DeleteInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the Instance. + // If an etag is provided and does not match the current etag of the Instance, + // deletion will be blocked and an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for triggering failover on an Instance +message FailoverInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the failover. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +message RestartInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the restart. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Backups +message ListBackupsRequest { + // Required. Parent value for ListBackupsRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Backup" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results + string filter = 4; + + // Hint for how to order the results + string order_by = 5; +} + +// Message for response to listing Backups +message ListBackupsResponse { + // The list of Backup + repeated Backup backups = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Backup +message GetBackupRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; +} + +// Message for creating a Backup +message CreateBackupRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Backup" + } + ]; + + // Required. ID of the requesting object. + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Backup +message UpdateBackupRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Backup resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, update succeeds even if instance is not found. In + // that case, a new backup is created and `update_mask` is ignored. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Backup +message DeleteBackupRequest { + // Required. Name of the resource. For the required format, see the comment on + // the Backup.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the Backup. + // If an etag is provided and does not match the current etag of the Backup, + // deletion will be blocked and an ABORTED error will be returned. + string etag = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for listing the information about the supported Database flags. +message ListSupportedDatabaseFlagsRequest { + // Required. The name of the parent resource. The required format is: + // * projects/{project}/locations/{location} + // + // Regardless of the parent specified here, as long it is contains a valid + // project and location, the service will return a static list of supported + // flags resources. Note that we do not yet support region-specific + // flags. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/SupportedDatabaseFlag" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; +} + +// Message for response to listing SupportedDatabaseFlags. +message ListSupportedDatabaseFlagsResponse { + // The list of SupportedDatabaseFlags. + repeated SupportedDatabaseFlag supported_database_flags = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; +} + +// Message for requests to generate a client certificate signed by the Cluster +// CA. +message GenerateClientCertificateRequest { + // Required. The name of the parent resource. The required format is: + // * projects/{project}/locations/{location}/clusters/{cluster} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pem-encoded X.509 certificate signing request (CSR). + string pem_csr = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional hint to the endpoint to generate the client + // certificate with the requested duration. The duration can be from 1 hour to + // 24 hours. The endpoint may or may not honor the hint. If the hint is left + // unspecified or is not honored, then the endpoint will pick an appropriate + // default duration. + google.protobuf.Duration cert_duration = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Message returned by a GenerateClientCertificate operation. +message GenerateClientCertificateResponse { + // Output only. The pem-encoded, signed X.509 certificate. + string pem_certificate = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The pem-encoded chain that may be used to verify the X.509 + // certificate. Expected to be in issuer-to-root order according to RFC 5246. + repeated string pem_certificate_chain = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for GetConnectionInfo. +message GetConnectionInfoRequest { + // Required. The name of the parent resource. The required format is: + // projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Request specific metadata, if any. + oneof request_specific { + // Output only. BatchCreateInstances related metadata. + BatchCreateInstancesMetadata batch_create_instances_metadata = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/clirr-ignored-differences.xml b/java-alloydb/proto-google-cloud-alloydb-v1beta/clirr-ignored-differences.xml new file mode 100644 index 000000000000..e30d0177aacc --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/alloydb/v1beta/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/alloydb/v1beta/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/alloydb/v1beta/*OrBuilder + boolean has*(*) + + diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/pom.xml b/java-alloydb/proto-google-cloud-alloydb-v1beta/pom.xml new file mode 100644 index 000000000000..6751d5864cce --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-alloydb-v1beta + 0.0.1-SNAPSHOT + proto-google-cloud-alloydb-v1beta + Proto library for google-cloud-alloydb + + com.google.cloud + google-cloud-alloydb-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-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/AutomatedBackupPolicy.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/AutomatedBackupPolicy.java new file mode 100644 index 000000000000..943cdf1188f7 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/AutomatedBackupPolicy.java @@ -0,0 +1,5843 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message describing the user-specified automated backup policy.
+ * All fields in the automated backup policy are optional. Defaults for each
+ * field are provided if they are not set.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.AutomatedBackupPolicy} + */ +public final class AutomatedBackupPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.AutomatedBackupPolicy) + AutomatedBackupPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use AutomatedBackupPolicy.newBuilder() to construct. + private AutomatedBackupPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AutomatedBackupPolicy() { + location_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AutomatedBackupPolicy(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.class, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.Builder.class); + } + + public interface WeeklyScheduleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + java.util.List getStartTimesList(); + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + com.google.type.TimeOfDay getStartTimes(int index); + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + int getStartTimesCount(); + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + java.util.List getStartTimesOrBuilderList(); + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + com.google.type.TimeOfDayOrBuilder getStartTimesOrBuilder(int index); + + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the daysOfWeek. + */ + java.util.List getDaysOfWeekList(); + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return The count of daysOfWeek. + */ + int getDaysOfWeekCount(); + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the element to return. + * @return The daysOfWeek at the given index. + */ + com.google.type.DayOfWeek getDaysOfWeek(int index); + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the enum numeric values on the wire for daysOfWeek. + */ + java.util.List getDaysOfWeekValueList(); + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of daysOfWeek at the given index. + */ + int getDaysOfWeekValue(int index); + } + /** + * + * + *
+   * A weekly schedule starts a backup at prescribed start times within a
+   * day, for the specified days of the week.
+   * The weekly schedule message is flexible and can be used to create many
+   * types of schedules. For example, to have a daily backup that starts at
+   * 22:00, configure the `start_times` field to have one element "22:00" and
+   * the `days_of_week` field to have all seven days of the week.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} + */ + public static final class WeeklySchedule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) + WeeklyScheduleOrBuilder { + private static final long serialVersionUID = 0L; + // Use WeeklySchedule.newBuilder() to construct. + private WeeklySchedule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WeeklySchedule() { + startTimes_ = java.util.Collections.emptyList(); + daysOfWeek_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WeeklySchedule(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_WeeklySchedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_WeeklySchedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.class, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.Builder.class); + } + + public static final int START_TIMES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List startTimes_; + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + @java.lang.Override + public java.util.List getStartTimesList() { + return startTimes_; + } + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + @java.lang.Override + public java.util.List + getStartTimesOrBuilderList() { + return startTimes_; + } + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + @java.lang.Override + public int getStartTimesCount() { + return startTimes_.size(); + } + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + @java.lang.Override + public com.google.type.TimeOfDay getStartTimes(int index) { + return startTimes_.get(index); + } + /** + * + * + *
+     * The times during the day to start a backup. The start times are assumed
+     * to be in UTC and to be an exact hour (e.g., 04:00:00).
+     * If no start times are provided, a single fixed start time is chosen
+     * arbitrarily.
+     * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + @java.lang.Override + public com.google.type.TimeOfDayOrBuilder getStartTimesOrBuilder(int index) { + return startTimes_.get(index); + } + + public static final int DAYS_OF_WEEK_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List daysOfWeek_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.type.DayOfWeek> + daysOfWeek_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.type.DayOfWeek>() { + public com.google.type.DayOfWeek convert(java.lang.Integer from) { + com.google.type.DayOfWeek result = com.google.type.DayOfWeek.forNumber(from); + return result == null ? com.google.type.DayOfWeek.UNRECOGNIZED : result; + } + }; + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the daysOfWeek. + */ + @java.lang.Override + public java.util.List getDaysOfWeekList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.type.DayOfWeek>(daysOfWeek_, daysOfWeek_converter_); + } + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return The count of daysOfWeek. + */ + @java.lang.Override + public int getDaysOfWeekCount() { + return daysOfWeek_.size(); + } + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the element to return. + * @return The daysOfWeek at the given index. + */ + @java.lang.Override + public com.google.type.DayOfWeek getDaysOfWeek(int index) { + return daysOfWeek_converter_.convert(daysOfWeek_.get(index)); + } + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the enum numeric values on the wire for daysOfWeek. + */ + @java.lang.Override + public java.util.List getDaysOfWeekValueList() { + return daysOfWeek_; + } + /** + * + * + *
+     * The days of the week to perform a backup.
+     * If this field is left empty, the default of every day of the week is
+     * used.
+     * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of daysOfWeek at the given index. + */ + @java.lang.Override + public int getDaysOfWeekValue(int index) { + return daysOfWeek_.get(index); + } + + private int daysOfWeekMemoizedSerializedSize; + + 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(); + for (int i = 0; i < startTimes_.size(); i++) { + output.writeMessage(1, startTimes_.get(i)); + } + if (getDaysOfWeekList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(daysOfWeekMemoizedSerializedSize); + } + for (int i = 0; i < daysOfWeek_.size(); i++) { + output.writeEnumNoTag(daysOfWeek_.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 < startTimes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, startTimes_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < daysOfWeek_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(daysOfWeek_.get(i)); + } + size += dataSize; + if (!getDaysOfWeekList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + daysOfWeekMemoizedSerializedSize = 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.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule other = + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) obj; + + if (!getStartTimesList().equals(other.getStartTimesList())) return false; + if (!daysOfWeek_.equals(other.daysOfWeek_)) 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 (getStartTimesCount() > 0) { + hash = (37 * hash) + START_TIMES_FIELD_NUMBER; + hash = (53 * hash) + getStartTimesList().hashCode(); + } + if (getDaysOfWeekCount() > 0) { + hash = (37 * hash) + DAYS_OF_WEEK_FIELD_NUMBER; + hash = (53 * hash) + daysOfWeek_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule 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.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule 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.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule 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.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + 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.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule 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.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule 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 weekly schedule starts a backup at prescribed start times within a
+     * day, for the specified days of the week.
+     * The weekly schedule message is flexible and can be used to create many
+     * types of schedules. For example, to have a daily backup that starts at
+     * 22:00, configure the `start_times` field to have one element "22:00" and
+     * the `days_of_week` field to have all seven days of the week.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklyScheduleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_WeeklySchedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_WeeklySchedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.class, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.Builder.class); + } + + // Construct using + // com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (startTimesBuilder_ == null) { + startTimes_ = java.util.Collections.emptyList(); + } else { + startTimes_ = null; + startTimesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + daysOfWeek_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_WeeklySchedule_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule build() { + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule buildPartial() { + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule result = + new com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule result) { + if (startTimesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + startTimes_ = java.util.Collections.unmodifiableList(startTimes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.startTimes_ = startTimes_; + } else { + result.startTimes_ = startTimesBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + daysOfWeek_ = java.util.Collections.unmodifiableList(daysOfWeek_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.daysOfWeek_ = daysOfWeek_; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule result) { + int from_bitField0_ = bitField0_; + } + + @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.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) { + return mergeFrom( + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule other) { + if (other + == com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance()) return this; + if (startTimesBuilder_ == null) { + if (!other.startTimes_.isEmpty()) { + if (startTimes_.isEmpty()) { + startTimes_ = other.startTimes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStartTimesIsMutable(); + startTimes_.addAll(other.startTimes_); + } + onChanged(); + } + } else { + if (!other.startTimes_.isEmpty()) { + if (startTimesBuilder_.isEmpty()) { + startTimesBuilder_.dispose(); + startTimesBuilder_ = null; + startTimes_ = other.startTimes_; + bitField0_ = (bitField0_ & ~0x00000001); + startTimesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStartTimesFieldBuilder() + : null; + } else { + startTimesBuilder_.addAllMessages(other.startTimes_); + } + } + } + if (!other.daysOfWeek_.isEmpty()) { + if (daysOfWeek_.isEmpty()) { + daysOfWeek_ = other.daysOfWeek_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDaysOfWeekIsMutable(); + daysOfWeek_.addAll(other.daysOfWeek_); + } + 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.type.TimeOfDay m = + input.readMessage(com.google.type.TimeOfDay.parser(), extensionRegistry); + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + startTimes_.add(m); + } else { + startTimesBuilder_.addMessage(m); + } + break; + } // case 10 + case 16: + { + int tmpRaw = input.readEnum(); + ensureDaysOfWeekIsMutable(); + daysOfWeek_.add(tmpRaw); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureDaysOfWeekIsMutable(); + daysOfWeek_.add(tmpRaw); + } + input.popLimit(oldLimit); + 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 startTimes_ = + java.util.Collections.emptyList(); + + private void ensureStartTimesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + startTimes_ = new java.util.ArrayList(startTimes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.type.TimeOfDay, + com.google.type.TimeOfDay.Builder, + com.google.type.TimeOfDayOrBuilder> + startTimesBuilder_; + + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public java.util.List getStartTimesList() { + if (startTimesBuilder_ == null) { + return java.util.Collections.unmodifiableList(startTimes_); + } else { + return startTimesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public int getStartTimesCount() { + if (startTimesBuilder_ == null) { + return startTimes_.size(); + } else { + return startTimesBuilder_.getCount(); + } + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public com.google.type.TimeOfDay getStartTimes(int index) { + if (startTimesBuilder_ == null) { + return startTimes_.get(index); + } else { + return startTimesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder setStartTimes(int index, com.google.type.TimeOfDay value) { + if (startTimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartTimesIsMutable(); + startTimes_.set(index, value); + onChanged(); + } else { + startTimesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder setStartTimes(int index, com.google.type.TimeOfDay.Builder builderForValue) { + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + startTimes_.set(index, builderForValue.build()); + onChanged(); + } else { + startTimesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder addStartTimes(com.google.type.TimeOfDay value) { + if (startTimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartTimesIsMutable(); + startTimes_.add(value); + onChanged(); + } else { + startTimesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder addStartTimes(int index, com.google.type.TimeOfDay value) { + if (startTimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartTimesIsMutable(); + startTimes_.add(index, value); + onChanged(); + } else { + startTimesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder addStartTimes(com.google.type.TimeOfDay.Builder builderForValue) { + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + startTimes_.add(builderForValue.build()); + onChanged(); + } else { + startTimesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder addStartTimes(int index, com.google.type.TimeOfDay.Builder builderForValue) { + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + startTimes_.add(index, builderForValue.build()); + onChanged(); + } else { + startTimesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder addAllStartTimes( + java.lang.Iterable values) { + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, startTimes_); + onChanged(); + } else { + startTimesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder clearStartTimes() { + if (startTimesBuilder_ == null) { + startTimes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + startTimesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public Builder removeStartTimes(int index) { + if (startTimesBuilder_ == null) { + ensureStartTimesIsMutable(); + startTimes_.remove(index); + onChanged(); + } else { + startTimesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public com.google.type.TimeOfDay.Builder getStartTimesBuilder(int index) { + return getStartTimesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public com.google.type.TimeOfDayOrBuilder getStartTimesOrBuilder(int index) { + if (startTimesBuilder_ == null) { + return startTimes_.get(index); + } else { + return startTimesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public java.util.List + getStartTimesOrBuilderList() { + if (startTimesBuilder_ != null) { + return startTimesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(startTimes_); + } + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public com.google.type.TimeOfDay.Builder addStartTimesBuilder() { + return getStartTimesFieldBuilder() + .addBuilder(com.google.type.TimeOfDay.getDefaultInstance()); + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public com.google.type.TimeOfDay.Builder addStartTimesBuilder(int index) { + return getStartTimesFieldBuilder() + .addBuilder(index, com.google.type.TimeOfDay.getDefaultInstance()); + } + /** + * + * + *
+       * The times during the day to start a backup. The start times are assumed
+       * to be in UTC and to be an exact hour (e.g., 04:00:00).
+       * If no start times are provided, a single fixed start time is chosen
+       * arbitrarily.
+       * 
+ * + * repeated .google.type.TimeOfDay start_times = 1; + */ + public java.util.List getStartTimesBuilderList() { + return getStartTimesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.type.TimeOfDay, + com.google.type.TimeOfDay.Builder, + com.google.type.TimeOfDayOrBuilder> + getStartTimesFieldBuilder() { + if (startTimesBuilder_ == null) { + startTimesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.type.TimeOfDay, + com.google.type.TimeOfDay.Builder, + com.google.type.TimeOfDayOrBuilder>( + startTimes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + startTimes_ = null; + } + return startTimesBuilder_; + } + + private java.util.List daysOfWeek_ = java.util.Collections.emptyList(); + + private void ensureDaysOfWeekIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + daysOfWeek_ = new java.util.ArrayList(daysOfWeek_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the daysOfWeek. + */ + public java.util.List getDaysOfWeekList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.type.DayOfWeek>(daysOfWeek_, daysOfWeek_converter_); + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return The count of daysOfWeek. + */ + public int getDaysOfWeekCount() { + return daysOfWeek_.size(); + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the element to return. + * @return The daysOfWeek at the given index. + */ + public com.google.type.DayOfWeek getDaysOfWeek(int index) { + return daysOfWeek_converter_.convert(daysOfWeek_.get(index)); + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index to set the value at. + * @param value The daysOfWeek to set. + * @return This builder for chaining. + */ + public Builder setDaysOfWeek(int index, com.google.type.DayOfWeek value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDaysOfWeekIsMutable(); + daysOfWeek_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param value The daysOfWeek to add. + * @return This builder for chaining. + */ + public Builder addDaysOfWeek(com.google.type.DayOfWeek value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDaysOfWeekIsMutable(); + daysOfWeek_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param values The daysOfWeek to add. + * @return This builder for chaining. + */ + public Builder addAllDaysOfWeek( + java.lang.Iterable values) { + ensureDaysOfWeekIsMutable(); + for (com.google.type.DayOfWeek value : values) { + daysOfWeek_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return This builder for chaining. + */ + public Builder clearDaysOfWeek() { + daysOfWeek_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @return A list containing the enum numeric values on the wire for daysOfWeek. + */ + public java.util.List getDaysOfWeekValueList() { + return java.util.Collections.unmodifiableList(daysOfWeek_); + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of daysOfWeek at the given index. + */ + public int getDaysOfWeekValue(int index) { + return daysOfWeek_.get(index); + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for daysOfWeek to set. + * @return This builder for chaining. + */ + public Builder setDaysOfWeekValue(int index, int value) { + ensureDaysOfWeekIsMutable(); + daysOfWeek_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param value The enum numeric value on the wire for daysOfWeek to add. + * @return This builder for chaining. + */ + public Builder addDaysOfWeekValue(int value) { + ensureDaysOfWeekIsMutable(); + daysOfWeek_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * The days of the week to perform a backup.
+       * If this field is left empty, the default of every day of the week is
+       * used.
+       * 
+ * + * repeated .google.type.DayOfWeek days_of_week = 2; + * + * @param values The enum numeric values on the wire for daysOfWeek to add. + * @return This builder for chaining. + */ + public Builder addAllDaysOfWeekValue(java.lang.Iterable values) { + ensureDaysOfWeekIsMutable(); + for (int value : values) { + daysOfWeek_.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.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) + private static final com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule(); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WeeklySchedule 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.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TimeBasedRetentionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return Whether the retentionPeriod field is set. + */ + boolean hasRetentionPeriod(); + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return The retentionPeriod. + */ + com.google.protobuf.Duration getRetentionPeriod(); + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder(); + } + /** + * + * + *
+   * A time based retention policy specifies that all backups within a certain
+   * time period should be retained.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} + */ + public static final class TimeBasedRetention extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) + TimeBasedRetentionOrBuilder { + private static final long serialVersionUID = 0L; + // Use TimeBasedRetention.newBuilder() to construct. + private TimeBasedRetention(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimeBasedRetention() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TimeBasedRetention(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_TimeBasedRetention_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_TimeBasedRetention_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.class, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.Builder + .class); + } + + public static final int RETENTION_PERIOD_FIELD_NUMBER = 1; + private com.google.protobuf.Duration retentionPeriod_; + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return Whether the retentionPeriod field is set. + */ + @java.lang.Override + public boolean hasRetentionPeriod() { + return retentionPeriod_ != null; + } + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return The retentionPeriod. + */ + @java.lang.Override + public com.google.protobuf.Duration getRetentionPeriod() { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } + /** + * + * + *
+     * The retention period.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder() { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } + + 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 (retentionPeriod_ != null) { + output.writeMessage(1, getRetentionPeriod()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (retentionPeriod_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRetentionPeriod()); + } + 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.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention other = + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) obj; + + if (hasRetentionPeriod() != other.hasRetentionPeriod()) return false; + if (hasRetentionPeriod()) { + if (!getRetentionPeriod().equals(other.getRetentionPeriod())) 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 (hasRetentionPeriod()) { + hash = (37 * hash) + RETENTION_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getRetentionPeriod().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + 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.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + 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.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + 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.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + 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.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + 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.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention 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 time based retention policy specifies that all backups within a certain
+     * time period should be retained.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_TimeBasedRetention_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_TimeBasedRetention_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.class, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.Builder + .class); + } + + // Construct using + // com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + retentionPeriod_ = null; + if (retentionPeriodBuilder_ != null) { + retentionPeriodBuilder_.dispose(); + retentionPeriodBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_TimeBasedRetention_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention build() { + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + buildPartial() { + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention result = + new com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.retentionPeriod_ = + retentionPeriodBuilder_ == null ? retentionPeriod_ : retentionPeriodBuilder_.build(); + } + } + + @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.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) { + return mergeFrom( + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention other) { + if (other + == com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance()) return this; + if (other.hasRetentionPeriod()) { + mergeRetentionPeriod(other.getRetentionPeriod()); + } + 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( + getRetentionPeriodFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + 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.Duration retentionPeriod_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + retentionPeriodBuilder_; + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return Whether the retentionPeriod field is set. + */ + public boolean hasRetentionPeriod() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return The retentionPeriod. + */ + public com.google.protobuf.Duration getRetentionPeriod() { + if (retentionPeriodBuilder_ == null) { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } else { + return retentionPeriodBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder setRetentionPeriod(com.google.protobuf.Duration value) { + if (retentionPeriodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retentionPeriod_ = value; + } else { + retentionPeriodBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder setRetentionPeriod(com.google.protobuf.Duration.Builder builderForValue) { + if (retentionPeriodBuilder_ == null) { + retentionPeriod_ = builderForValue.build(); + } else { + retentionPeriodBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder mergeRetentionPeriod(com.google.protobuf.Duration value) { + if (retentionPeriodBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && retentionPeriod_ != null + && retentionPeriod_ != com.google.protobuf.Duration.getDefaultInstance()) { + getRetentionPeriodBuilder().mergeFrom(value); + } else { + retentionPeriod_ = value; + } + } else { + retentionPeriodBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder clearRetentionPeriod() { + bitField0_ = (bitField0_ & ~0x00000001); + retentionPeriod_ = null; + if (retentionPeriodBuilder_ != null) { + retentionPeriodBuilder_.dispose(); + retentionPeriodBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public com.google.protobuf.Duration.Builder getRetentionPeriodBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getRetentionPeriodFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder() { + if (retentionPeriodBuilder_ != null) { + return retentionPeriodBuilder_.getMessageOrBuilder(); + } else { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } + } + /** + * + * + *
+       * The retention period.
+       * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getRetentionPeriodFieldBuilder() { + if (retentionPeriodBuilder_ == null) { + retentionPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getRetentionPeriod(), getParentForChildren(), isClean()); + retentionPeriod_ = null; + } + return retentionPeriodBuilder_; + } + + @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.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) + private static final com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention(); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimeBasedRetention 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.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QuantityBasedRetentionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The number of backups to retain.
+     * 
+ * + * int32 count = 1; + * + * @return The count. + */ + int getCount(); + } + /** + * + * + *
+   * A quantity based policy specifies that a certain number of the most recent
+   * successful backups should be retained.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} + */ + public static final class QuantityBasedRetention extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) + QuantityBasedRetentionOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuantityBasedRetention.newBuilder() to construct. + private QuantityBasedRetention(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuantityBasedRetention() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuantityBasedRetention(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_QuantityBasedRetention_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_QuantityBasedRetention_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.class, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.Builder + .class); + } + + public static final int COUNT_FIELD_NUMBER = 1; + private int count_ = 0; + /** + * + * + *
+     * The number of backups to retain.
+     * 
+ * + * int32 count = 1; + * + * @return The count. + */ + @java.lang.Override + public int getCount() { + return count_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (count_ != 0) { + output.writeInt32(1, count_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (count_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, count_); + } + 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.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention other = + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) obj; + + if (getCount() != other.getCount()) 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) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + getCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + 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.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + 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.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + 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.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + 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.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + 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.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention 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 quantity based policy specifies that a certain number of the most recent
+     * successful backups should be retained.
+     * 
+ * + * Protobuf type {@code + * google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_QuantityBasedRetention_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_QuantityBasedRetention_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.class, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.Builder + .class); + } + + // Construct using + // com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + count_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_QuantityBasedRetention_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention build() { + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + buildPartial() { + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention result = + new com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.count_ = count_; + } + } + + @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.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) { + return mergeFrom( + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention other) { + if (other + == com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance()) return this; + if (other.getCount() != 0) { + setCount(other.getCount()); + } + 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: + { + count_ = input.readInt32(); + bitField0_ |= 0x00000001; + 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 bitField0_; + + private int count_; + /** + * + * + *
+       * The number of backups to retain.
+       * 
+ * + * int32 count = 1; + * + * @return The count. + */ + @java.lang.Override + public int getCount() { + return count_; + } + /** + * + * + *
+       * The number of backups to retain.
+       * 
+ * + * int32 count = 1; + * + * @param value The count to set. + * @return This builder for chaining. + */ + public Builder setCount(int value) { + + count_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The number of backups to retain.
+       * 
+ * + * int32 count = 1; + * + * @return This builder for chaining. + */ + public Builder clearCount() { + bitField0_ = (bitField0_ & ~0x00000001); + count_ = 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.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) + private static final com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy + .QuantityBasedRetention + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention(); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuantityBasedRetention 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.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + private int scheduleCase_ = 0; + private java.lang.Object schedule_; + + public enum ScheduleCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + WEEKLY_SCHEDULE(2), + SCHEDULE_NOT_SET(0); + private final int value; + + private ScheduleCase(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 ScheduleCase valueOf(int value) { + return forNumber(value); + } + + public static ScheduleCase forNumber(int value) { + switch (value) { + case 2: + return WEEKLY_SCHEDULE; + case 0: + return SCHEDULE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ScheduleCase getScheduleCase() { + return ScheduleCase.forNumber(scheduleCase_); + } + + private int retentionCase_ = 0; + private java.lang.Object retention_; + + public enum RetentionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TIME_BASED_RETENTION(4), + QUANTITY_BASED_RETENTION(5), + RETENTION_NOT_SET(0); + private final int value; + + private RetentionCase(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 RetentionCase valueOf(int value) { + return forNumber(value); + } + + public static RetentionCase forNumber(int value) { + switch (value) { + case 4: + return TIME_BASED_RETENTION; + case 5: + return QUANTITY_BASED_RETENTION; + case 0: + return RETENTION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RetentionCase getRetentionCase() { + return RetentionCase.forNumber(retentionCase_); + } + + public static final int WEEKLY_SCHEDULE_FIELD_NUMBER = 2; + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * + * @return Whether the weeklySchedule field is set. + */ + @java.lang.Override + public boolean hasWeeklySchedule() { + return scheduleCase_ == 2; + } + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * + * @return The weeklySchedule. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule getWeeklySchedule() { + if (scheduleCase_ == 2) { + return (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) schedule_; + } + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklyScheduleOrBuilder + getWeeklyScheduleOrBuilder() { + if (scheduleCase_ == 2) { + return (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) schedule_; + } + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } + + public static final int TIME_BASED_RETENTION_FIELD_NUMBER = 4; + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return Whether the timeBasedRetention field is set. + */ + @java.lang.Override + public boolean hasTimeBasedRetention() { + return retentionCase_ == 4; + } + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return The timeBasedRetention. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + getTimeBasedRetention() { + if (retentionCase_ == 4) { + return (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) retention_; + } + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder + getTimeBasedRetentionOrBuilder() { + if (retentionCase_ == 4) { + return (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) retention_; + } + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + + public static final int QUANTITY_BASED_RETENTION_FIELD_NUMBER = 5; + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return Whether the quantityBasedRetention field is set. + */ + @java.lang.Override + public boolean hasQuantityBasedRetention() { + return retentionCase_ == 5; + } + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return The quantityBasedRetention. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + getQuantityBasedRetention() { + if (retentionCase_ == 5) { + return (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) + retention_; + } + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder + getQuantityBasedRetentionOrBuilder() { + if (retentionCase_ == 5) { + return (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) + retention_; + } + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_ = false; + /** + * + * + *
+   * Whether automated automated backups are enabled. If not set, defaults to
+   * true.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Whether automated automated backups are enabled. If not set, defaults to
+   * true.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + public static final int BACKUP_WINDOW_FIELD_NUMBER = 3; + private com.google.protobuf.Duration backupWindow_; + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return Whether the backupWindow field is set. + */ + @java.lang.Override + public boolean hasBackupWindow() { + return backupWindow_ != null; + } + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return The backupWindow. + */ + @java.lang.Override + public com.google.protobuf.Duration getBackupWindow() { + return backupWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backupWindow_; + } + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getBackupWindowOrBuilder() { + return backupWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backupWindow_; + } + + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 8; + private com.google.cloud.alloydb.v1beta.EncryptionConfig encryptionConfig_; + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return encryptionConfig_ != null; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + public static final int LOCATION_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + /** + * + * + *
+   * The location where the backup will be stored. Currently, the only supported
+   * option is to store the backup in the same region as the cluster.
+   * If empty, defaults to the region of the cluster.
+   * 
+ * + * string location = 6; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + 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(); + location_ = s; + return s; + } + } + /** + * + * + *
+   * The location where the backup will be stored. Currently, the only supported
+   * option is to store the backup in the same region as the cluster.
+   * If empty, defaults to the region of the cluster.
+   * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 7; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().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 (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, enabled_); + } + if (scheduleCase_ == 2) { + output.writeMessage( + 2, (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) schedule_); + } + if (backupWindow_ != null) { + output.writeMessage(3, getBackupWindow()); + } + if (retentionCase_ == 4) { + output.writeMessage( + 4, (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) retention_); + } + if (retentionCase_ == 5) { + output.writeMessage( + 5, + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) + retention_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, location_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 7); + if (encryptionConfig_ != null) { + output.writeMessage(8, getEncryptionConfig()); + } + 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, enabled_); + } + if (scheduleCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) schedule_); + } + if (backupWindow_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBackupWindow()); + } + if (retentionCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) + retention_); + } + if (retentionCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) + retention_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, location_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, labels__); + } + if (encryptionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getEncryptionConfig()); + } + 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.alloydb.v1beta.AutomatedBackupPolicy)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy other = + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy) obj; + + if (hasEnabled() != other.hasEnabled()) return false; + if (hasEnabled()) { + if (getEnabled() != other.getEnabled()) return false; + } + if (hasBackupWindow() != other.hasBackupWindow()) return false; + if (hasBackupWindow()) { + if (!getBackupWindow().equals(other.getBackupWindow())) return false; + } + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) return false; + } + if (!getLocation().equals(other.getLocation())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getScheduleCase().equals(other.getScheduleCase())) return false; + switch (scheduleCase_) { + case 2: + if (!getWeeklySchedule().equals(other.getWeeklySchedule())) return false; + break; + case 0: + default: + } + if (!getRetentionCase().equals(other.getRetentionCase())) return false; + switch (retentionCase_) { + case 4: + if (!getTimeBasedRetention().equals(other.getTimeBasedRetention())) return false; + break; + case 5: + if (!getQuantityBasedRetention().equals(other.getQuantityBasedRetention())) 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(); + if (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); + } + if (hasBackupWindow()) { + hash = (37 * hash) + BACKUP_WINDOW_FIELD_NUMBER; + hash = (53 * hash) + getBackupWindow().hashCode(); + } + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + switch (scheduleCase_) { + case 2: + hash = (37 * hash) + WEEKLY_SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + getWeeklySchedule().hashCode(); + break; + case 0: + default: + } + switch (retentionCase_) { + case 4: + hash = (37 * hash) + TIME_BASED_RETENTION_FIELD_NUMBER; + hash = (53 * hash) + getTimeBasedRetention().hashCode(); + break; + case 5: + hash = (37 * hash) + QUANTITY_BASED_RETENTION_FIELD_NUMBER; + hash = (53 * hash) + getQuantityBasedRetention().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy 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.alloydb.v1beta.AutomatedBackupPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy 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.alloydb.v1beta.AutomatedBackupPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy 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.alloydb.v1beta.AutomatedBackupPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy 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.alloydb.v1beta.AutomatedBackupPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy 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.alloydb.v1beta.AutomatedBackupPolicy 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; + } + /** + * + * + *
+   * Message describing the user-specified automated backup policy.
+   * All fields in the automated backup policy are optional. Defaults for each
+   * field are provided if they are not set.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.AutomatedBackupPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.AutomatedBackupPolicy) + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.class, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (weeklyScheduleBuilder_ != null) { + weeklyScheduleBuilder_.clear(); + } + if (timeBasedRetentionBuilder_ != null) { + timeBasedRetentionBuilder_.clear(); + } + if (quantityBasedRetentionBuilder_ != null) { + quantityBasedRetentionBuilder_.clear(); + } + enabled_ = false; + backupWindow_ = null; + if (backupWindowBuilder_ != null) { + backupWindowBuilder_.dispose(); + backupWindowBuilder_ = null; + } + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + location_ = ""; + internalGetMutableLabels().clear(); + scheduleCase_ = 0; + schedule_ = null; + retentionCase_ = 0; + retention_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy build() { + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy buildPartial() { + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy result = + new com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.enabled_ = enabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.backupWindow_ = + backupWindowBuilder_ == null ? backupWindow_ : backupWindowBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.encryptionConfig_ = + encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.location_ = location_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy result) { + result.scheduleCase_ = scheduleCase_; + result.schedule_ = this.schedule_; + if (scheduleCase_ == 2 && weeklyScheduleBuilder_ != null) { + result.schedule_ = weeklyScheduleBuilder_.build(); + } + result.retentionCase_ = retentionCase_; + result.retention_ = this.retention_; + if (retentionCase_ == 4 && timeBasedRetentionBuilder_ != null) { + result.retention_ = timeBasedRetentionBuilder_.build(); + } + if (retentionCase_ == 5 && quantityBasedRetentionBuilder_ != null) { + result.retention_ = quantityBasedRetentionBuilder_.build(); + } + } + + @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.alloydb.v1beta.AutomatedBackupPolicy) { + return mergeFrom((com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy other) { + if (other == com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.getDefaultInstance()) + return this; + if (other.hasEnabled()) { + setEnabled(other.getEnabled()); + } + if (other.hasBackupWindow()) { + mergeBackupWindow(other.getBackupWindow()); + } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000040; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000080; + switch (other.getScheduleCase()) { + case WEEKLY_SCHEDULE: + { + mergeWeeklySchedule(other.getWeeklySchedule()); + break; + } + case SCHEDULE_NOT_SET: + { + break; + } + } + switch (other.getRetentionCase()) { + case TIME_BASED_RETENTION: + { + mergeTimeBasedRetention(other.getTimeBasedRetention()); + break; + } + case QUANTITY_BASED_RETENTION: + { + mergeQuantityBasedRetention(other.getQuantityBasedRetention()); + break; + } + case RETENTION_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 8: + { + enabled_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 8 + case 18: + { + input.readMessage(getWeeklyScheduleFieldBuilder().getBuilder(), extensionRegistry); + scheduleCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getBackupWindowFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 26 + case 34: + { + input.readMessage( + getTimeBasedRetentionFieldBuilder().getBuilder(), extensionRegistry); + retentionCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + getQuantityBasedRetentionFieldBuilder().getBuilder(), extensionRegistry); + retentionCase_ = 5; + break; + } // case 42 + case 50: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 58: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + input.readMessage( + getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 66 + 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 scheduleCase_ = 0; + private java.lang.Object schedule_; + + public ScheduleCase getScheduleCase() { + return ScheduleCase.forNumber(scheduleCase_); + } + + public Builder clearSchedule() { + scheduleCase_ = 0; + schedule_ = null; + onChanged(); + return this; + } + + private int retentionCase_ = 0; + private java.lang.Object retention_; + + public RetentionCase getRetentionCase() { + return RetentionCase.forNumber(retentionCase_); + } + + public Builder clearRetention() { + retentionCase_ = 0; + retention_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.Builder, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklyScheduleOrBuilder> + weeklyScheduleBuilder_; + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * + * @return Whether the weeklySchedule field is set. + */ + @java.lang.Override + public boolean hasWeeklySchedule() { + return scheduleCase_ == 2; + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * + * @return The weeklySchedule. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + getWeeklySchedule() { + if (weeklyScheduleBuilder_ == null) { + if (scheduleCase_ == 2) { + return (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) schedule_; + } + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } else { + if (scheduleCase_ == 2) { + return weeklyScheduleBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + public Builder setWeeklySchedule( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule value) { + if (weeklyScheduleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schedule_ = value; + onChanged(); + } else { + weeklyScheduleBuilder_.setMessage(value); + } + scheduleCase_ = 2; + return this; + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + public Builder setWeeklySchedule( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.Builder + builderForValue) { + if (weeklyScheduleBuilder_ == null) { + schedule_ = builderForValue.build(); + onChanged(); + } else { + weeklyScheduleBuilder_.setMessage(builderForValue.build()); + } + scheduleCase_ = 2; + return this; + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + public Builder mergeWeeklySchedule( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule value) { + if (weeklyScheduleBuilder_ == null) { + if (scheduleCase_ == 2 + && schedule_ + != com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance()) { + schedule_ = + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.newBuilder( + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) + schedule_) + .mergeFrom(value) + .buildPartial(); + } else { + schedule_ = value; + } + onChanged(); + } else { + if (scheduleCase_ == 2) { + weeklyScheduleBuilder_.mergeFrom(value); + } else { + weeklyScheduleBuilder_.setMessage(value); + } + } + scheduleCase_ = 2; + return this; + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + public Builder clearWeeklySchedule() { + if (weeklyScheduleBuilder_ == null) { + if (scheduleCase_ == 2) { + scheduleCase_ = 0; + schedule_ = null; + onChanged(); + } + } else { + if (scheduleCase_ == 2) { + scheduleCase_ = 0; + schedule_ = null; + } + weeklyScheduleBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.Builder + getWeeklyScheduleBuilder() { + return getWeeklyScheduleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklyScheduleOrBuilder + getWeeklyScheduleOrBuilder() { + if ((scheduleCase_ == 2) && (weeklyScheduleBuilder_ != null)) { + return weeklyScheduleBuilder_.getMessageOrBuilder(); + } else { + if (scheduleCase_ == 2) { + return (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) schedule_; + } + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Weekly schedule for the Backup.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.Builder, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklyScheduleOrBuilder> + getWeeklyScheduleFieldBuilder() { + if (weeklyScheduleBuilder_ == null) { + if (!(scheduleCase_ == 2)) { + schedule_ = + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + .getDefaultInstance(); + } + weeklyScheduleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.Builder, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklyScheduleOrBuilder>( + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) schedule_, + getParentForChildren(), + isClean()); + schedule_ = null; + } + scheduleCase_ = 2; + onChanged(); + return weeklyScheduleBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.Builder, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder> + timeBasedRetentionBuilder_; + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return Whether the timeBasedRetention field is set. + */ + @java.lang.Override + public boolean hasTimeBasedRetention() { + return retentionCase_ == 4; + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return The timeBasedRetention. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + getTimeBasedRetention() { + if (timeBasedRetentionBuilder_ == null) { + if (retentionCase_ == 4) { + return (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) + retention_; + } + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } else { + if (retentionCase_ == 4) { + return timeBasedRetentionBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + public Builder setTimeBasedRetention( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention value) { + if (timeBasedRetentionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retention_ = value; + onChanged(); + } else { + timeBasedRetentionBuilder_.setMessage(value); + } + retentionCase_ = 4; + return this; + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + public Builder setTimeBasedRetention( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.Builder + builderForValue) { + if (timeBasedRetentionBuilder_ == null) { + retention_ = builderForValue.build(); + onChanged(); + } else { + timeBasedRetentionBuilder_.setMessage(builderForValue.build()); + } + retentionCase_ = 4; + return this; + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + public Builder mergeTimeBasedRetention( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention value) { + if (timeBasedRetentionBuilder_ == null) { + if (retentionCase_ == 4 + && retention_ + != com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance()) { + retention_ = + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.newBuilder( + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) + retention_) + .mergeFrom(value) + .buildPartial(); + } else { + retention_ = value; + } + onChanged(); + } else { + if (retentionCase_ == 4) { + timeBasedRetentionBuilder_.mergeFrom(value); + } else { + timeBasedRetentionBuilder_.setMessage(value); + } + } + retentionCase_ = 4; + return this; + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + public Builder clearTimeBasedRetention() { + if (timeBasedRetentionBuilder_ == null) { + if (retentionCase_ == 4) { + retentionCase_ = 0; + retention_ = null; + onChanged(); + } + } else { + if (retentionCase_ == 4) { + retentionCase_ = 0; + retention_ = null; + } + timeBasedRetentionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.Builder + getTimeBasedRetentionBuilder() { + return getTimeBasedRetentionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder + getTimeBasedRetentionOrBuilder() { + if ((retentionCase_ == 4) && (timeBasedRetentionBuilder_ != null)) { + return timeBasedRetentionBuilder_.getMessageOrBuilder(); + } else { + if (retentionCase_ == 4) { + return (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) + retention_; + } + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Time-based Backup retention policy.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.Builder, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder> + getTimeBasedRetentionFieldBuilder() { + if (timeBasedRetentionBuilder_ == null) { + if (!(retentionCase_ == 4)) { + retention_ = + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + .getDefaultInstance(); + } + timeBasedRetentionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.Builder, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder>( + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) + retention_, + getParentForChildren(), + isClean()); + retention_ = null; + } + retentionCase_ = 4; + onChanged(); + return timeBasedRetentionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.Builder, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder> + quantityBasedRetentionBuilder_; + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return Whether the quantityBasedRetention field is set. + */ + @java.lang.Override + public boolean hasQuantityBasedRetention() { + return retentionCase_ == 5; + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return The quantityBasedRetention. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + getQuantityBasedRetention() { + if (quantityBasedRetentionBuilder_ == null) { + if (retentionCase_ == 5) { + return (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) + retention_; + } + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } else { + if (retentionCase_ == 5) { + return quantityBasedRetentionBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + public Builder setQuantityBasedRetention( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention value) { + if (quantityBasedRetentionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retention_ = value; + onChanged(); + } else { + quantityBasedRetentionBuilder_.setMessage(value); + } + retentionCase_ = 5; + return this; + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + public Builder setQuantityBasedRetention( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.Builder + builderForValue) { + if (quantityBasedRetentionBuilder_ == null) { + retention_ = builderForValue.build(); + onChanged(); + } else { + quantityBasedRetentionBuilder_.setMessage(builderForValue.build()); + } + retentionCase_ = 5; + return this; + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + public Builder mergeQuantityBasedRetention( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention value) { + if (quantityBasedRetentionBuilder_ == null) { + if (retentionCase_ == 5 + && retention_ + != com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance()) { + retention_ = + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + .newBuilder( + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) + retention_) + .mergeFrom(value) + .buildPartial(); + } else { + retention_ = value; + } + onChanged(); + } else { + if (retentionCase_ == 5) { + quantityBasedRetentionBuilder_.mergeFrom(value); + } else { + quantityBasedRetentionBuilder_.setMessage(value); + } + } + retentionCase_ = 5; + return this; + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + public Builder clearQuantityBasedRetention() { + if (quantityBasedRetentionBuilder_ == null) { + if (retentionCase_ == 5) { + retentionCase_ = 0; + retention_ = null; + onChanged(); + } + } else { + if (retentionCase_ == 5) { + retentionCase_ = 0; + retention_ = null; + } + quantityBasedRetentionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.Builder + getQuantityBasedRetentionBuilder() { + return getQuantityBasedRetentionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder + getQuantityBasedRetentionOrBuilder() { + if ((retentionCase_ == 5) && (quantityBasedRetentionBuilder_ != null)) { + return quantityBasedRetentionBuilder_.getMessageOrBuilder(); + } else { + if (retentionCase_ == 5) { + return (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) + retention_; + } + return com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Quantity-based Backup retention policy to retain recent backups.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.Builder, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder> + getQuantityBasedRetentionFieldBuilder() { + if (quantityBasedRetentionBuilder_ == null) { + if (!(retentionCase_ == 5)) { + retention_ = + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + .getDefaultInstance(); + } + quantityBasedRetentionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + .Builder, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy + .QuantityBasedRetentionOrBuilder>( + (com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) + retention_, + getParentForChildren(), + isClean()); + retention_ = null; + } + retentionCase_ = 5; + onChanged(); + return quantityBasedRetentionBuilder_; + } + + private boolean enabled_; + /** + * + * + *
+     * Whether automated automated backups are enabled. If not set, defaults to
+     * true.
+     * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Whether automated automated backups are enabled. If not set, defaults to
+     * true.
+     * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + /** + * + * + *
+     * Whether automated automated backups are enabled. If not set, defaults to
+     * true.
+     * 
+ * + * optional bool enabled = 1; + * + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether automated automated backups are enabled. If not set, defaults to
+     * true.
+     * 
+ * + * optional bool enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000008); + enabled_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Duration backupWindow_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + backupWindowBuilder_; + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return Whether the backupWindow field is set. + */ + public boolean hasBackupWindow() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return The backupWindow. + */ + public com.google.protobuf.Duration getBackupWindow() { + if (backupWindowBuilder_ == null) { + return backupWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backupWindow_; + } else { + return backupWindowBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public Builder setBackupWindow(com.google.protobuf.Duration value) { + if (backupWindowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupWindow_ = value; + } else { + backupWindowBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public Builder setBackupWindow(com.google.protobuf.Duration.Builder builderForValue) { + if (backupWindowBuilder_ == null) { + backupWindow_ = builderForValue.build(); + } else { + backupWindowBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public Builder mergeBackupWindow(com.google.protobuf.Duration value) { + if (backupWindowBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && backupWindow_ != null + && backupWindow_ != com.google.protobuf.Duration.getDefaultInstance()) { + getBackupWindowBuilder().mergeFrom(value); + } else { + backupWindow_ = value; + } + } else { + backupWindowBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public Builder clearBackupWindow() { + bitField0_ = (bitField0_ & ~0x00000010); + backupWindow_ = null; + if (backupWindowBuilder_ != null) { + backupWindowBuilder_.dispose(); + backupWindowBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public com.google.protobuf.Duration.Builder getBackupWindowBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getBackupWindowFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + public com.google.protobuf.DurationOrBuilder getBackupWindowOrBuilder() { + if (backupWindowBuilder_ != null) { + return backupWindowBuilder_.getMessageOrBuilder(); + } else { + return backupWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backupWindow_; + } + } + /** + * + * + *
+     * The length of the time window during which a backup can be
+     * taken. If a backup does not succeed within this time window, it will be
+     * canceled and considered failed.
+     * The backup window must be at least 5 minutes long. There is no upper bound
+     * on the window. If not set, it defaults to 1 hour.
+     * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getBackupWindowFieldBuilder() { + if (backupWindowBuilder_ == null) { + backupWindowBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getBackupWindow(), getParentForChildren(), isClean()); + backupWindow_ = null; + } + return backupWindowBuilder_; + } + + private com.google.cloud.alloydb.v1beta.EncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionConfig, + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder> + encryptionConfigBuilder_; + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + public com.google.cloud.alloydb.v1beta.EncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig(com.google.cloud.alloydb.v1beta.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + } else { + encryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig( + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1beta.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); + } else { + encryptionConfig_ = value; + } + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEncryptionConfig() { + bitField0_ = (bitField0_ & ~0x00000020); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder getEncryptionConfigBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getEncryptionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionConfig, + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder> + getEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionConfig, + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + + private java.lang.Object location_ = ""; + /** + * + * + *
+     * The location where the backup will be stored. Currently, the only supported
+     * option is to store the backup in the same region as the cluster.
+     * If empty, defaults to the region of the cluster.
+     * 
+ * + * string location = 6; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The location where the backup will be stored. Currently, the only supported
+     * option is to store the backup in the same region as the cluster.
+     * If empty, defaults to the region of the cluster.
+     * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The location where the backup will be stored. Currently, the only supported
+     * option is to store the backup in the same region as the cluster.
+     * If empty, defaults to the region of the cluster.
+     * 
+ * + * string location = 6; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The location where the backup will be stored. Currently, the only supported
+     * option is to store the backup in the same region as the cluster.
+     * If empty, defaults to the region of the cluster.
+     * 
+ * + * string location = 6; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * The location where the backup will be stored. Currently, the only supported
+     * option is to store the backup in the same region as the cluster.
+     * If empty, defaults to the region of the cluster.
+     * 
+ * + * string location = 6; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000080; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000080); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000080; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000080; + return this; + } + /** + * + * + *
+     * Labels to apply to backups created using this configuration.
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000080; + 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.alloydb.v1beta.AutomatedBackupPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.AutomatedBackupPolicy) + private static final com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy(); + } + + public static com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AutomatedBackupPolicy 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.alloydb.v1beta.AutomatedBackupPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/AutomatedBackupPolicyOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/AutomatedBackupPolicyOrBuilder.java new file mode 100644 index 000000000000..bd56c8ef2081 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/AutomatedBackupPolicyOrBuilder.java @@ -0,0 +1,364 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface AutomatedBackupPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.AutomatedBackupPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * + * @return Whether the weeklySchedule field is set. + */ + boolean hasWeeklySchedule(); + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + * + * @return The weeklySchedule. + */ + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule getWeeklySchedule(); + /** + * + * + *
+   * Weekly schedule for the Backup.
+   * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * + */ + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklyScheduleOrBuilder + getWeeklyScheduleOrBuilder(); + + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return Whether the timeBasedRetention field is set. + */ + boolean hasTimeBasedRetention(); + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + * + * @return The timeBasedRetention. + */ + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention getTimeBasedRetention(); + /** + * + * + *
+   * Time-based Backup retention policy.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * + */ + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetentionOrBuilder + getTimeBasedRetentionOrBuilder(); + + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return Whether the quantityBasedRetention field is set. + */ + boolean hasQuantityBasedRetention(); + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + * + * @return The quantityBasedRetention. + */ + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + getQuantityBasedRetention(); + /** + * + * + *
+   * Quantity-based Backup retention policy to retain recent backups.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * + */ + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetentionOrBuilder + getQuantityBasedRetentionOrBuilder(); + + /** + * + * + *
+   * Whether automated automated backups are enabled. If not set, defaults to
+   * true.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + boolean hasEnabled(); + /** + * + * + *
+   * Whether automated automated backups are enabled. If not set, defaults to
+   * true.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + boolean getEnabled(); + + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return Whether the backupWindow field is set. + */ + boolean hasBackupWindow(); + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + * + * @return The backupWindow. + */ + com.google.protobuf.Duration getBackupWindow(); + /** + * + * + *
+   * The length of the time window during which a backup can be
+   * taken. If a backup does not succeed within this time window, it will be
+   * canceled and considered failed.
+   * The backup window must be at least 5 minutes long. There is no upper bound
+   * on the window. If not set, it defaults to 1 hour.
+   * 
+ * + * .google.protobuf.Duration backup_window = 3; + */ + com.google.protobuf.DurationOrBuilder getBackupWindowOrBuilder(); + + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + com.google.cloud.alloydb.v1beta.EncryptionConfig getEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); + + /** + * + * + *
+   * The location where the backup will be stored. Currently, the only supported
+   * option is to store the backup in the same region as the cluster.
+   * If empty, defaults to the region of the cluster.
+   * 
+ * + * string location = 6; + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+   * The location where the backup will be stored. Currently, the only supported
+   * option is to store the backup in the same region as the cluster.
+   * If empty, defaults to the region of the cluster.
+   * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels to apply to backups created using this configuration.
+   * 
+ * + * map<string, string> labels = 7; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ScheduleCase getScheduleCase(); + + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.RetentionCase getRetentionCase(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Backup.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Backup.java new file mode 100644 index 000000000000..90500cf0cfd0 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Backup.java @@ -0,0 +1,5137 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message describing Backup object
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Backup} + */ +public final class Backup extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.Backup) + BackupOrBuilder { + private static final long serialVersionUID = 0L; + // Use Backup.newBuilder() to construct. + private Backup(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Backup() { + name_ = ""; + displayName_ = ""; + uid_ = ""; + state_ = 0; + type_ = 0; + description_ = ""; + clusterUid_ = ""; + clusterName_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Backup(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Backup_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetLabels(); + case 16: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Backup.class, + com.google.cloud.alloydb.v1beta.Backup.Builder.class); + } + + /** + * + * + *
+   * Backup State
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.Backup.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the backup is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The backup is ready.
+     * 
+ * + * READY = 1; + */ + READY(1), + /** + * + * + *
+     * The backup is creating.
+     * 
+ * + * CREATING = 2; + */ + CREATING(2), + /** + * + * + *
+     * The backup failed.
+     * 
+ * + * FAILED = 3; + */ + FAILED(3), + /** + * + * + *
+     * The backup is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The state of the backup is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The backup is ready.
+     * 
+ * + * READY = 1; + */ + public static final int READY_VALUE = 1; + /** + * + * + *
+     * The backup is creating.
+     * 
+ * + * CREATING = 2; + */ + public static final int CREATING_VALUE = 2; + /** + * + * + *
+     * The backup failed.
+     * 
+ * + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + /** + * + * + *
+     * The backup is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_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 STATE_UNSPECIFIED; + case 1: + return READY; + case 2: + return CREATING; + case 3: + return FAILED; + case 4: + return DELETING; + 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.alloydb.v1beta.Backup.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.alloydb.v1beta.Backup.State) + } + + /** + * + * + *
+   * Backup Type
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.Backup.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Backup Type is unknown.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * ON_DEMAND backups that were triggered by the customer (e.g., not
+     * AUTOMATED).
+     * 
+ * + * ON_DEMAND = 1; + */ + ON_DEMAND(1), + /** + * + * + *
+     * AUTOMATED backups triggered by the automated backups scheduler pursuant
+     * to an automated backup policy.
+     * 
+ * + * AUTOMATED = 2; + */ + AUTOMATED(2), + /** + * + * + *
+     * CONTINUOUS backups triggered by the automated backups scheduler
+     * due to a continuous backup policy.
+     * 
+ * + * CONTINUOUS = 3; + */ + CONTINUOUS(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Backup Type is unknown.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * ON_DEMAND backups that were triggered by the customer (e.g., not
+     * AUTOMATED).
+     * 
+ * + * ON_DEMAND = 1; + */ + public static final int ON_DEMAND_VALUE = 1; + /** + * + * + *
+     * AUTOMATED backups triggered by the automated backups scheduler pursuant
+     * to an automated backup policy.
+     * 
+ * + * AUTOMATED = 2; + */ + public static final int AUTOMATED_VALUE = 2; + /** + * + * + *
+     * CONTINUOUS backups triggered by the automated backups scheduler
+     * due to a continuous backup policy.
+     * 
+ * + * CONTINUOUS = 3; + */ + public static final int CONTINUOUS_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 Type 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 Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return ON_DEMAND; + case 2: + return AUTOMATED; + case 3: + return CONTINUOUS; + 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 Type findValueByNumber(int number) { + return Type.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.alloydb.v1beta.Backup.getDescriptor().getEnumTypes().get(1); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.Backup.Type) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * where the cluster and backup ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the backup resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * where the cluster and backup ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the backup resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * User-settable and human-readable display name for the Backup.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * User-settable and human-readable display name for the Backup.
+   * 
+ * + * 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 UID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + 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(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int DELETE_TIME_FIELD_NUMBER = 15; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.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. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + + public static final int LABELS_FIELD_NUMBER = 6; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Backup_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATE_FIELD_NUMBER = 7; + private int state_ = 0; + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Backup.State getState() { + com.google.cloud.alloydb.v1beta.Backup.State result = + com.google.cloud.alloydb.v1beta.Backup.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1beta.Backup.State.UNRECOGNIZED : result; + } + + public static final int TYPE_FIELD_NUMBER = 8; + private int type_ = 0; + /** + * + * + *
+   * The backup type, which suggests the trigger for the backup.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup.Type type = 8; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * The backup type, which suggests the trigger for the backup.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup.Type type = 8; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Backup.Type getType() { + com.google.cloud.alloydb.v1beta.Backup.Type result = + com.google.cloud.alloydb.v1beta.Backup.Type.forNumber(type_); + return result == null ? com.google.cloud.alloydb.v1beta.Backup.Type.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * User-provided description of the backup.
+   * 
+ * + * string description = 9; + * + * @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; + } + } + /** + * + * + *
+   * User-provided description of the backup.
+   * 
+ * + * string description = 9; + * + * @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 CLUSTER_UID_FIELD_NUMBER = 18; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterUid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UID of the cluster which was used to
+   * create this resource.
+   * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clusterUid. + */ + @java.lang.Override + public java.lang.String getClusterUid() { + java.lang.Object ref = clusterUid_; + 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(); + clusterUid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UID of the cluster which was used to
+   * create this resource.
+   * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clusterUid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterUidBytes() { + java.lang.Object ref = clusterUid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_NAME_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterName_ = ""; + /** + * + * + *
+   * Required. The full resource name of the backup source cluster
+   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The clusterName. + */ + @java.lang.Override + public java.lang.String getClusterName() { + java.lang.Object ref = clusterName_; + 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(); + clusterName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The full resource name of the backup source cluster
+   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for clusterName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterNameBytes() { + java.lang.Object ref = clusterName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECONCILING_FIELD_NUMBER = 11; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
+   * true, indicates that the service is actively updating the resource. This
+   * can happen due to user-triggered updates or system actions like failover or
+   * maintenance.
+   * 
+ * + * bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 12; + private com.google.cloud.alloydb.v1beta.EncryptionConfig encryptionConfig_; + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return encryptionConfig_ != null; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + public static final int ENCRYPTION_INFO_FIELD_NUMBER = 13; + private com.google.cloud.alloydb.v1beta.EncryptionInfo encryptionInfo_; + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + @java.lang.Override + public boolean hasEncryptionInfo() { + return encryptionInfo_ != null; + } + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionInfo getEncryptionInfo() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + + public static final int ETAG_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 14; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 14; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 16; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Backup_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SIZE_BYTES_FIELD_NUMBER = 17; + private long sizeBytes_ = 0L; + /** + * + * + *
+   * Output only. The size of the backup in bytes.
+   * 
+ * + * int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + @java.lang.Override + public long getSizeBytes() { + return sizeBytes_; + } + + public static final int EXPIRY_TIME_FIELD_NUMBER = 19; + private com.google.protobuf.Timestamp expiryTime_; + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expiryTime field is set. + */ + @java.lang.Override + public boolean hasExpiryTime() { + return expiryTime_ != null; + } + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expiryTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpiryTime() { + return expiryTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expiryTime_; + } + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder() { + return expiryTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expiryTime_; + } + + 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(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uid_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 6); + if (state_ != com.google.cloud.alloydb.v1beta.Backup.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(7, state_); + } + if (type_ != com.google.cloud.alloydb.v1beta.Backup.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, clusterName_); + } + if (reconciling_ != false) { + output.writeBool(11, reconciling_); + } + if (encryptionConfig_ != null) { + output.writeMessage(12, getEncryptionConfig()); + } + if (encryptionInfo_ != null) { + output.writeMessage(13, getEncryptionInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, etag_); + } + if (deleteTime_ != null) { + output.writeMessage(15, getDeleteTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 16); + if (sizeBytes_ != 0L) { + output.writeInt64(17, sizeBytes_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterUid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 18, clusterUid_); + } + if (expiryTime_ != null) { + output.writeMessage(19, getExpiryTime()); + } + 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(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uid_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, labels__); + } + if (state_ != com.google.cloud.alloydb.v1beta.Backup.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, state_); + } + if (type_ != com.google.cloud.alloydb.v1beta.Backup.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, clusterName_); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, reconciling_); + } + if (encryptionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getEncryptionConfig()); + } + if (encryptionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getEncryptionInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, etag_); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getDeleteTime()); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, annotations__); + } + if (sizeBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(17, sizeBytes_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterUid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, clusterUid_); + } + if (expiryTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getExpiryTime()); + } + 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.alloydb.v1beta.Backup)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.Backup other = (com.google.cloud.alloydb.v1beta.Backup) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (state_ != other.state_) return false; + if (type_ != other.type_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getClusterUid().equals(other.getClusterUid())) return false; + if (!getClusterName().equals(other.getClusterName())) return false; + if (getReconciling() != other.getReconciling()) return false; + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) return false; + } + if (hasEncryptionInfo() != other.hasEncryptionInfo()) return false; + if (hasEncryptionInfo()) { + if (!getEncryptionInfo().equals(other.getEncryptionInfo())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (getSizeBytes() != other.getSizeBytes()) return false; + if (hasExpiryTime() != other.hasExpiryTime()) return false; + if (hasExpiryTime()) { + if (!getExpiryTime().equals(other.getExpiryTime())) 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(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + CLUSTER_UID_FIELD_NUMBER; + hash = (53 * hash) + getClusterUid().hashCode(); + hash = (37 * hash) + CLUSTER_NAME_FIELD_NUMBER; + hash = (53 * hash) + getClusterName().hashCode(); + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } + if (hasEncryptionInfo()) { + hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionInfo().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (37 * hash) + SIZE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSizeBytes()); + if (hasExpiryTime()) { + hash = (37 * hash) + EXPIRY_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpiryTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.Backup parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Backup 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.alloydb.v1beta.Backup parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Backup 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.alloydb.v1beta.Backup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Backup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Backup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Backup 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.alloydb.v1beta.Backup parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Backup 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.alloydb.v1beta.Backup parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Backup 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.alloydb.v1beta.Backup 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; + } + /** + * + * + *
+   * Message describing Backup object
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Backup} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.Backup) + com.google.cloud.alloydb.v1beta.BackupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Backup_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetLabels(); + case 16: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 6: + return internalGetMutableLabels(); + case 16: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Backup.class, + com.google.cloud.alloydb.v1beta.Backup.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.Backup.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + uid_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + state_ = 0; + type_ = 0; + description_ = ""; + clusterUid_ = ""; + clusterName_ = ""; + reconciling_ = false; + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + etag_ = ""; + internalGetMutableAnnotations().clear(); + sizeBytes_ = 0L; + expiryTime_ = null; + if (expiryTimeBuilder_ != null) { + expiryTimeBuilder_.dispose(); + expiryTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Backup_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Backup getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.Backup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Backup build() { + com.google.cloud.alloydb.v1beta.Backup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Backup buildPartial() { + com.google.cloud.alloydb.v1beta.Backup result = + new com.google.cloud.alloydb.v1beta.Backup(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.Backup result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.clusterUid_ = clusterUid_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.clusterName_ = clusterName_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.encryptionConfig_ = + encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.encryptionInfo_ = + encryptionInfoBuilder_ == null ? encryptionInfo_ : encryptionInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.sizeBytes_ = sizeBytes_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.expiryTime_ = expiryTimeBuilder_ == null ? expiryTime_ : expiryTimeBuilder_.build(); + } + } + + @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.alloydb.v1beta.Backup) { + return mergeFrom((com.google.cloud.alloydb.v1beta.Backup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.Backup other) { + if (other == com.google.cloud.alloydb.v1beta.Backup.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000040; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (!other.getClusterUid().isEmpty()) { + clusterUid_ = other.clusterUid_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (!other.getClusterName().isEmpty()) { + clusterName_ = other.clusterName_; + bitField0_ |= 0x00000800; + onChanged(); + } + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } + if (other.hasEncryptionInfo()) { + mergeEncryptionInfo(other.getEncryptionInfo()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00008000; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00010000; + if (other.getSizeBytes() != 0L) { + setSizeBytes(other.getSizeBytes()); + } + if (other.hasExpiryTime()) { + mergeExpiryTime(other.getExpiryTime()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 56: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 56 + case 64: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 64 + case 74: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 74 + case 82: + { + clusterName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 82 + case 88: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00001000; + break; + } // case 88 + case 98: + { + input.readMessage( + getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 98 + case 106: + { + input.readMessage(getEncryptionInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00004000; + break; + } // case 106 + case 114: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 114 + case 122: + { + input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 122 + case 130: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00010000; + break; + } // case 130 + case 136: + { + sizeBytes_ = input.readInt64(); + bitField0_ |= 0x00020000; + break; + } // case 136 + case 146: + { + clusterUid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 146 + case 154: + { + input.readMessage(getExpiryTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 154 + 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_ = ""; + /** + * + * + *
+     * Output only. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * where the cluster and backup ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the backup resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * where the cluster and backup ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the backup resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * where the cluster and backup ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the backup resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * where the cluster and backup ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the backup resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * where the cluster and backup ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the backup resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * User-settable and human-readable display name for the Backup.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Backup.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Backup.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Backup.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Backup.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + 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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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 deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.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; + } else { + deleteTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); + } else { + deleteTime_ = value; + } + } else { + deleteTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + bitField0_ = (bitField0_ & ~0x00000020); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 15 [(.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_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000040; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 6; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000040; + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Backup.State getState() { + com.google.cloud.alloydb.v1beta.Backup.State result = + com.google.cloud.alloydb.v1beta.Backup.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1beta.Backup.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.alloydb.v1beta.Backup.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000080); + state_ = 0; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * The backup type, which suggests the trigger for the backup.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Backup.Type type = 8; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * The backup type, which suggests the trigger for the backup.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Backup.Type type = 8; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The backup type, which suggests the trigger for the backup.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Backup.Type type = 8; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Backup.Type getType() { + com.google.cloud.alloydb.v1beta.Backup.Type result = + com.google.cloud.alloydb.v1beta.Backup.Type.forNumber(type_); + return result == null ? com.google.cloud.alloydb.v1beta.Backup.Type.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The backup type, which suggests the trigger for the backup.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Backup.Type type = 8; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.alloydb.v1beta.Backup.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The backup type, which suggests the trigger for the backup.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Backup.Type type = 8; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000100); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * User-provided description of the backup.
+     * 
+ * + * string description = 9; + * + * @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; + } + } + /** + * + * + *
+     * User-provided description of the backup.
+     * 
+ * + * string description = 9; + * + * @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; + } + } + /** + * + * + *
+     * User-provided description of the backup.
+     * 
+ * + * string description = 9; + * + * @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; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * User-provided description of the backup.
+     * 
+ * + * string description = 9; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * User-provided description of the backup.
+     * 
+ * + * string description = 9; + * + * @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; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.lang.Object clusterUid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UID of the cluster which was used to
+     * create this resource.
+     * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clusterUid. + */ + public java.lang.String getClusterUid() { + java.lang.Object ref = clusterUid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterUid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the cluster which was used to
+     * create this resource.
+     * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clusterUid. + */ + public com.google.protobuf.ByteString getClusterUidBytes() { + java.lang.Object ref = clusterUid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the cluster which was used to
+     * create this resource.
+     * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The clusterUid to set. + * @return This builder for chaining. + */ + public Builder setClusterUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterUid_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the cluster which was used to
+     * create this resource.
+     * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearClusterUid() { + clusterUid_ = getDefaultInstance().getClusterUid(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the cluster which was used to
+     * create this resource.
+     * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for clusterUid to set. + * @return This builder for chaining. + */ + public Builder setClusterUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterUid_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.lang.Object clusterName_ = ""; + /** + * + * + *
+     * Required. The full resource name of the backup source cluster
+     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The clusterName. + */ + public java.lang.String getClusterName() { + java.lang.Object ref = clusterName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The full resource name of the backup source cluster
+     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for clusterName. + */ + public com.google.protobuf.ByteString getClusterNameBytes() { + java.lang.Object ref = clusterName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The full resource name of the backup source cluster
+     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The clusterName to set. + * @return This builder for chaining. + */ + public Builder setClusterName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterName_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource name of the backup source cluster
+     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearClusterName() { + clusterName_ = getDefaultInstance().getClusterName(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource name of the backup source cluster
+     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for clusterName to set. + * @return This builder for chaining. + */ + public Builder setClusterNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterName_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
+     * true, indicates that the service is actively updating the resource. This
+     * can happen due to user-triggered updates or system actions like failover or
+     * maintenance.
+     * 
+ * + * bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
+     * true, indicates that the service is actively updating the resource. This
+     * can happen due to user-triggered updates or system actions like failover or
+     * maintenance.
+     * 
+ * + * bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
+     * true, indicates that the service is actively updating the resource. This
+     * can happen due to user-triggered updates or system actions like failover or
+     * maintenance.
+     * 
+ * + * bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00001000); + reconciling_ = false; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1beta.EncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionConfig, + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder> + encryptionConfigBuilder_; + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + public com.google.cloud.alloydb.v1beta.EncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig(com.google.cloud.alloydb.v1beta.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + } else { + encryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig( + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1beta.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); + } else { + encryptionConfig_ = value; + } + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEncryptionConfig() { + bitField0_ = (bitField0_ & ~0x00002000); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder getEncryptionConfigBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getEncryptionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the
+     * backup with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionConfig, + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder> + getEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionConfig, + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + + private com.google.cloud.alloydb.v1beta.EncryptionInfo encryptionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionInfo, + com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder> + encryptionInfoBuilder_; + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + public boolean hasEncryptionInfo() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + public com.google.cloud.alloydb.v1beta.EncryptionInfo getEncryptionInfo() { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } else { + return encryptionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo(com.google.cloud.alloydb.v1beta.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionInfo_ = value; + } else { + encryptionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo( + com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = builderForValue.build(); + } else { + encryptionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEncryptionInfo(com.google.cloud.alloydb.v1beta.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0) + && encryptionInfo_ != null + && encryptionInfo_ + != com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance()) { + getEncryptionInfoBuilder().mergeFrom(value); + } else { + encryptionInfo_ = value; + } + } else { + encryptionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEncryptionInfo() { + bitField0_ = (bitField0_ & ~0x00004000); + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder getEncryptionInfoBuilder() { + bitField0_ |= 0x00004000; + onChanged(); + return getEncryptionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + if (encryptionInfoBuilder_ != null) { + return encryptionInfoBuilder_.getMessageOrBuilder(); + } else { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionInfo, + com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder> + getEncryptionInfoFieldBuilder() { + if (encryptionInfoBuilder_ == null) { + encryptionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionInfo, + com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder>( + getEncryptionInfo(), getParentForChildren(), isClean()); + encryptionInfo_ = null; + } + return encryptionInfoBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 14; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 14; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 14; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 14; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 14; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00010000; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00010000); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00010000; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00010000; + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 16; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00010000; + return this; + } + + private long sizeBytes_; + /** + * + * + *
+     * Output only. The size of the backup in bytes.
+     * 
+ * + * int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + @java.lang.Override + public long getSizeBytes() { + return sizeBytes_; + } + /** + * + * + *
+     * Output only. The size of the backup in bytes.
+     * 
+ * + * int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sizeBytes to set. + * @return This builder for chaining. + */ + public Builder setSizeBytes(long value) { + + sizeBytes_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The size of the backup in bytes.
+     * 
+ * + * int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSizeBytes() { + bitField0_ = (bitField0_ & ~0x00020000); + sizeBytes_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expiryTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expiryTimeBuilder_; + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expiryTime field is set. + */ + public boolean hasExpiryTime() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expiryTime. + */ + public com.google.protobuf.Timestamp getExpiryTime() { + if (expiryTimeBuilder_ == null) { + return expiryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expiryTime_; + } else { + return expiryTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpiryTime(com.google.protobuf.Timestamp value) { + if (expiryTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiryTime_ = value; + } else { + expiryTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpiryTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expiryTimeBuilder_ == null) { + expiryTime_ = builderForValue.build(); + } else { + expiryTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeExpiryTime(com.google.protobuf.Timestamp value) { + if (expiryTimeBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) + && expiryTime_ != null + && expiryTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpiryTimeBuilder().mergeFrom(value); + } else { + expiryTime_ = value; + } + } else { + expiryTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearExpiryTime() { + bitField0_ = (bitField0_ & ~0x00040000); + expiryTime_ = null; + if (expiryTimeBuilder_ != null) { + expiryTimeBuilder_.dispose(); + expiryTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getExpiryTimeBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return getExpiryTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder() { + if (expiryTimeBuilder_ != null) { + return expiryTimeBuilder_.getMessageOrBuilder(); + } else { + return expiryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expiryTime_; + } + } + /** + * + * + *
+     * Output only. The time at which after the backup is eligible to be garbage
+     * collected. It is the duration specified by the backup's retention policy,
+     * added to the backup's create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpiryTimeFieldBuilder() { + if (expiryTimeBuilder_ == null) { + expiryTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpiryTime(), getParentForChildren(), isClean()); + expiryTime_ = null; + } + return expiryTimeBuilder_; + } + + @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.alloydb.v1beta.Backup) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.Backup) + private static final com.google.cloud.alloydb.v1beta.Backup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.Backup(); + } + + public static com.google.cloud.alloydb.v1beta.Backup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Backup 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.alloydb.v1beta.Backup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupName.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupName.java new file mode 100644 index 000000000000..bdf982d33ac0 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupName.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.alloydb.v1beta; + +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 BackupName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_BACKUP = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/backups/{backup}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String backup; + + @Deprecated + protected BackupName() { + project = null; + location = null; + backup = null; + } + + private BackupName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + backup = Preconditions.checkNotNull(builder.getBackup()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBackup() { + return backup; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BackupName of(String project, String location, String backup) { + return newBuilder().setProject(project).setLocation(location).setBackup(backup).build(); + } + + public static String format(String project, String location, String backup) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBackup(backup) + .build() + .toString(); + } + + public static BackupName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_BACKUP.validatedMatch( + formattedString, "BackupName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("backup")); + } + + 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 (BackupName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_BACKUP.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 (backup != null) { + fieldMapBuilder.put("backup", backup); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_BACKUP.instantiate( + "project", project, "location", location, "backup", backup); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + BackupName that = ((BackupName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.backup, that.backup); + } + 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(backup); + return h; + } + + /** Builder for projects/{project}/locations/{location}/backups/{backup}. */ + public static class Builder { + private String project; + private String location; + private String backup; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBackup() { + return backup; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setBackup(String backup) { + this.backup = backup; + return this; + } + + private Builder(BackupName backupName) { + this.project = backupName.project; + this.location = backupName.location; + this.backup = backupName.backup; + } + + public BackupName build() { + return new BackupName(this); + } + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupOrBuilder.java new file mode 100644 index 000000000000..1b547fd1b157 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupOrBuilder.java @@ -0,0 +1,684 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface BackupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.Backup) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * where the cluster and backup ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the backup resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * where the cluster and backup ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the backup resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * User-settable and human-readable display name for the Backup.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * User-settable and human-readable display name for the Backup.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 6; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.alloydb.v1beta.Backup.State getState(); + + /** + * + * + *
+   * The backup type, which suggests the trigger for the backup.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup.Type type = 8; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * The backup type, which suggests the trigger for the backup.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup.Type type = 8; + * + * @return The type. + */ + com.google.cloud.alloydb.v1beta.Backup.Type getType(); + + /** + * + * + *
+   * User-provided description of the backup.
+   * 
+ * + * string description = 9; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * User-provided description of the backup.
+   * 
+ * + * string description = 9; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The system-generated UID of the cluster which was used to
+   * create this resource.
+   * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clusterUid. + */ + java.lang.String getClusterUid(); + /** + * + * + *
+   * Output only. The system-generated UID of the cluster which was used to
+   * create this resource.
+   * 
+ * + * string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clusterUid. + */ + com.google.protobuf.ByteString getClusterUidBytes(); + + /** + * + * + *
+   * Required. The full resource name of the backup source cluster
+   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The clusterName. + */ + java.lang.String getClusterName(); + /** + * + * + *
+   * Required. The full resource name of the backup source cluster
+   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * 
+ * + * + * string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for clusterName. + */ + com.google.protobuf.ByteString getClusterNameBytes(); + + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
+   * true, indicates that the service is actively updating the resource. This
+   * can happen due to user-triggered updates or system actions like failover or
+   * maintenance.
+   * 
+ * + * bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + com.google.cloud.alloydb.v1beta.EncryptionConfig getEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the
+   * backup with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); + + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + boolean hasEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + com.google.cloud.alloydb.v1beta.EncryptionInfo getEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(); + + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 14; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 14; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 16; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The size of the backup in bytes.
+   * 
+ * + * int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + long getSizeBytes(); + + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expiryTime field is set. + */ + boolean hasExpiryTime(); + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expiryTime. + */ + com.google.protobuf.Timestamp getExpiryTime(); + /** + * + * + *
+   * Output only. The time at which after the backup is eligible to be garbage
+   * collected. It is the duration specified by the backup's retention policy,
+   * added to the backup's create_time.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupSource.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupSource.java new file mode 100644 index 000000000000..e843a96234b5 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupSource.java @@ -0,0 +1,845 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message describing a BackupSource.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.BackupSource} + */ +public final class BackupSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.BackupSource) + BackupSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use BackupSource.newBuilder() to construct. + private BackupSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BackupSource() { + backupUid_ = ""; + backupName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BackupSource(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_BackupSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_BackupSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.BackupSource.class, + com.google.cloud.alloydb.v1beta.BackupSource.Builder.class); + } + + public static final int BACKUP_UID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupUid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UID of the backup which was used to
+   * create this resource. The UID is generated when the backup is created, and
+   * it is retained until the backup is deleted.
+   * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backupUid. + */ + @java.lang.Override + public java.lang.String getBackupUid() { + java.lang.Object ref = backupUid_; + 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(); + backupUid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UID of the backup which was used to
+   * create this resource. The UID is generated when the backup is created, and
+   * it is retained until the backup is deleted.
+   * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backupUid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupUidBytes() { + java.lang.Object ref = backupUid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupName_ = ""; + /** + * + * + *
+   * Required. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The backupName. + */ + @java.lang.Override + public java.lang.String getBackupName() { + java.lang.Object ref = backupName_; + 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(); + backupName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for backupName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupNameBytes() { + java.lang.Object ref = backupName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupName_ = 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(backupName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, backupName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupUid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, backupUid_); + } + 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(backupName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, backupName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupUid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, backupUid_); + } + 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.alloydb.v1beta.BackupSource)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.BackupSource other = + (com.google.cloud.alloydb.v1beta.BackupSource) obj; + + if (!getBackupUid().equals(other.getBackupUid())) return false; + if (!getBackupName().equals(other.getBackupName())) 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) + BACKUP_UID_FIELD_NUMBER; + hash = (53 * hash) + getBackupUid().hashCode(); + hash = (37 * hash) + BACKUP_NAME_FIELD_NUMBER; + hash = (53 * hash) + getBackupName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.BackupSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.BackupSource 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.alloydb.v1beta.BackupSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.BackupSource 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.alloydb.v1beta.BackupSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.BackupSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.BackupSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.BackupSource 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.alloydb.v1beta.BackupSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.BackupSource 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.alloydb.v1beta.BackupSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.BackupSource 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.alloydb.v1beta.BackupSource 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; + } + /** + * + * + *
+   * Message describing a BackupSource.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.BackupSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.BackupSource) + com.google.cloud.alloydb.v1beta.BackupSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_BackupSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_BackupSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.BackupSource.class, + com.google.cloud.alloydb.v1beta.BackupSource.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.BackupSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backupUid_ = ""; + backupName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_BackupSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BackupSource getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BackupSource build() { + com.google.cloud.alloydb.v1beta.BackupSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BackupSource buildPartial() { + com.google.cloud.alloydb.v1beta.BackupSource result = + new com.google.cloud.alloydb.v1beta.BackupSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.BackupSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backupUid_ = backupUid_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backupName_ = backupName_; + } + } + + @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.alloydb.v1beta.BackupSource) { + return mergeFrom((com.google.cloud.alloydb.v1beta.BackupSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.BackupSource other) { + if (other == com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance()) return this; + if (!other.getBackupUid().isEmpty()) { + backupUid_ = other.backupUid_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getBackupName().isEmpty()) { + backupName_ = other.backupName_; + bitField0_ |= 0x00000002; + 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: + { + backupName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + backupUid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + 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 backupUid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UID of the backup which was used to
+     * create this resource. The UID is generated when the backup is created, and
+     * it is retained until the backup is deleted.
+     * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backupUid. + */ + public java.lang.String getBackupUid() { + java.lang.Object ref = backupUid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupUid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the backup which was used to
+     * create this resource. The UID is generated when the backup is created, and
+     * it is retained until the backup is deleted.
+     * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backupUid. + */ + public com.google.protobuf.ByteString getBackupUidBytes() { + java.lang.Object ref = backupUid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the backup which was used to
+     * create this resource. The UID is generated when the backup is created, and
+     * it is retained until the backup is deleted.
+     * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The backupUid to set. + * @return This builder for chaining. + */ + public Builder setBackupUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupUid_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the backup which was used to
+     * create this resource. The UID is generated when the backup is created, and
+     * it is retained until the backup is deleted.
+     * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearBackupUid() { + backupUid_ = getDefaultInstance().getBackupUid(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the backup which was used to
+     * create this resource. The UID is generated when the backup is created, and
+     * it is retained until the backup is deleted.
+     * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for backupUid to set. + * @return This builder for chaining. + */ + public Builder setBackupUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupUid_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object backupName_ = ""; + /** + * + * + *
+     * Required. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The backupName. + */ + public java.lang.String getBackupName() { + java.lang.Object ref = backupName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for backupName. + */ + public com.google.protobuf.ByteString getBackupNameBytes() { + java.lang.Object ref = backupName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The backupName to set. + * @return This builder for chaining. + */ + public Builder setBackupName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearBackupName() { + backupName_ = getDefaultInstance().getBackupName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the backup resource with the format:
+     *  * projects/{project}/locations/{region}/backups/{backup_id}
+     * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for backupName to set. + * @return This builder for chaining. + */ + public Builder setBackupNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupName_ = value; + bitField0_ |= 0x00000002; + 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.alloydb.v1beta.BackupSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.BackupSource) + private static final com.google.cloud.alloydb.v1beta.BackupSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.BackupSource(); + } + + public static com.google.cloud.alloydb.v1beta.BackupSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupSource 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.alloydb.v1beta.BackupSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupSourceOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupSourceOrBuilder.java new file mode 100644 index 000000000000..c648471fc13c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupSourceOrBuilder.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/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface BackupSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.BackupSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The system-generated UID of the backup which was used to
+   * create this resource. The UID is generated when the backup is created, and
+   * it is retained until the backup is deleted.
+   * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backupUid. + */ + java.lang.String getBackupUid(); + /** + * + * + *
+   * Output only. The system-generated UID of the backup which was used to
+   * create this resource. The UID is generated when the backup is created, and
+   * it is retained until the backup is deleted.
+   * 
+ * + * string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backupUid. + */ + com.google.protobuf.ByteString getBackupUidBytes(); + + /** + * + * + *
+   * Required. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The backupName. + */ + java.lang.String getBackupName(); + /** + * + * + *
+   * Required. The name of the backup resource with the format:
+   *  * projects/{project}/locations/{region}/backups/{backup_id}
+   * 
+ * + * + * string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for backupName. + */ + com.google.protobuf.ByteString getBackupNameBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstanceStatus.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstanceStatus.java new file mode 100644 index 000000000000..6becce1bd3d4 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstanceStatus.java @@ -0,0 +1,1500 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for current status of an instance in the BatchCreateInstances
+ * operation.
+ * For example, lets say a BatchCreateInstances workflow has 4 instances,
+ * Instance1 through Instance4. Lets also assume that 2 instances succeeded
+ * but the third failed to create and the 4th was never picked up for creation
+ * because of failure of the previous one. Then, resulting states would look
+ * something like:
+ *   1. Instance1 = ROLLED_BACK
+ *   2. Instance2 = ROLLED_BACK
+ *   3. Instance3 = FAILED
+ *   4. Instance4 = FAILED
+ * However, while the operation is running, the instance might be in other
+ * states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states
+ * / do not get further updated once the operation is done.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} + */ +public final class BatchCreateInstanceStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.BatchCreateInstanceStatus) + BatchCreateInstanceStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchCreateInstanceStatus.newBuilder() to construct. + private BatchCreateInstanceStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchCreateInstanceStatus() { + state_ = 0; + errorMsg_ = ""; + type_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateInstanceStatus(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstanceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstanceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.class, + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.Builder.class); + } + + /** + * + * + *
+   * State contains all valid instance states for the BatchCreateInstances
+   * operation. This is mainly used for status reporting through the LRO
+   * metadata.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Instance is pending creation and has not yet been picked up for
+     * processsing in the backend.
+     * 
+ * + * PENDING_CREATE = 1; + */ + PENDING_CREATE(1), + /** + * + * + *
+     * The instance is active and running.
+     * 
+ * + * READY = 2; + */ + READY(2), + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 3; + */ + CREATING(3), + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * an operation on the instance or a batch of instances.
+     * 
+ * + * FAILED = 5; + */ + FAILED(5), + /** + * + * + *
+     * The instance was created successfully, but was rolled back and deleted
+     * due to some other failure during BatchCreateInstances operation.
+     * 
+ * + * ROLLED_BACK = 6; + */ + ROLLED_BACK(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Instance is pending creation and has not yet been picked up for
+     * processsing in the backend.
+     * 
+ * + * PENDING_CREATE = 1; + */ + public static final int PENDING_CREATE_VALUE = 1; + /** + * + * + *
+     * The instance is active and running.
+     * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 3; + */ + public static final int CREATING_VALUE = 3; + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * an operation on the instance or a batch of instances.
+     * 
+ * + * FAILED = 5; + */ + public static final int FAILED_VALUE = 5; + /** + * + * + *
+     * The instance was created successfully, but was rolled back and deleted
+     * due to some other failure during BatchCreateInstances operation.
+     * 
+ * + * ROLLED_BACK = 6; + */ + public static final int ROLLED_BACK_VALUE = 6; + + 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 PENDING_CREATE; + case 2: + return READY; + case 3: + return CREATING; + case 4: + return DELETING; + case 5: + return FAILED; + case 6: + return ROLLED_BACK; + 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.alloydb.v1beta.BatchCreateInstanceStatus.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.alloydb.v1beta.BatchCreateInstanceStatus.State) + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_ = 0; + /** + * + * + *
+   * The current state of an instance involved in the batch create operation.
+   * Once the operation is complete, the final state of the instances in the
+   * LRO can be one of:
+   *   1. ACTIVE, indicating that instances were created successfully
+   *   2. FAILED, indicating that a particular instance failed creation
+   *   3. ROLLED_BACK indicating that although the instance was created
+   *      successfully, it had to be rolled back and deleted due to failure in
+   *      other steps of the workflow.
+   * 
+ * + * .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The current state of an instance involved in the batch create operation.
+   * Once the operation is complete, the final state of the instances in the
+   * LRO can be one of:
+   *   1. ACTIVE, indicating that instances were created successfully
+   *   2. FAILED, indicating that a particular instance failed creation
+   *   3. ROLLED_BACK indicating that although the instance was created
+   *      successfully, it had to be rolled back and deleted due to failure in
+   *      other steps of the workflow.
+   * 
+ * + * .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State getState() { + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State result = + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State.forNumber(state_); + return result == null + ? com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State.UNRECOGNIZED + : result; + } + + public static final int ERROR_MSG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object errorMsg_ = ""; + /** + * + * + *
+   * DEPRECATED - Use the error field instead.
+   * Error, if any error occurred and is available, during instance creation.
+   * 
+ * + * string error_msg = 2; + * + * @return The errorMsg. + */ + @java.lang.Override + public java.lang.String getErrorMsg() { + java.lang.Object ref = errorMsg_; + 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(); + errorMsg_ = s; + return s; + } + } + /** + * + * + *
+   * DEPRECATED - Use the error field instead.
+   * Error, if any error occurred and is available, during instance creation.
+   * 
+ * + * string error_msg = 2; + * + * @return The bytes for errorMsg. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorMsgBytes() { + java.lang.Object ref = errorMsg_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMsg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_FIELD_NUMBER = 4; + private com.google.rpc.Status error_; + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + + public static final int TYPE_FIELD_NUMBER = 3; + private int type_ = 0; + /** + * .google.cloud.alloydb.v1beta.Instance.InstanceType type = 3; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * .google.cloud.alloydb.v1beta.Instance.InstanceType type = 3; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.InstanceType getType() { + com.google.cloud.alloydb.v1beta.Instance.InstanceType result = + com.google.cloud.alloydb.v1beta.Instance.InstanceType.forNumber(type_); + return result == null + ? com.google.cloud.alloydb.v1beta.Instance.InstanceType.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 (state_ + != com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMsg_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errorMsg_); + } + if (type_ + != com.google.cloud.alloydb.v1beta.Instance.InstanceType.INSTANCE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, type_); + } + if (error_ != null) { + output.writeMessage(4, getError()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ + != com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMsg_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errorMsg_); + } + if (type_ + != com.google.cloud.alloydb.v1beta.Instance.InstanceType.INSTANCE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_); + } + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getError()); + } + 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.alloydb.v1beta.BatchCreateInstanceStatus)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus other = + (com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus) obj; + + if (state_ != other.state_) return false; + if (!getErrorMsg().equals(other.getErrorMsg())) return false; + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (type_ != other.type_) 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) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + ERROR_MSG_FIELD_NUMBER; + hash = (53 * hash) + getErrorMsg().hashCode(); + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus 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.alloydb.v1beta.BatchCreateInstanceStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus 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.alloydb.v1beta.BatchCreateInstanceStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus 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.alloydb.v1beta.BatchCreateInstanceStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus 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.alloydb.v1beta.BatchCreateInstanceStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus 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.alloydb.v1beta.BatchCreateInstanceStatus 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; + } + /** + * + * + *
+   * Message for current status of an instance in the BatchCreateInstances
+   * operation.
+   * For example, lets say a BatchCreateInstances workflow has 4 instances,
+   * Instance1 through Instance4. Lets also assume that 2 instances succeeded
+   * but the third failed to create and the 4th was never picked up for creation
+   * because of failure of the previous one. Then, resulting states would look
+   * something like:
+   *   1. Instance1 = ROLLED_BACK
+   *   2. Instance2 = ROLLED_BACK
+   *   3. Instance3 = FAILED
+   *   4. Instance4 = FAILED
+   * However, while the operation is running, the instance might be in other
+   * states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states
+   * / do not get further updated once the operation is done.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.BatchCreateInstanceStatus) + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstanceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstanceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.class, + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + state_ = 0; + errorMsg_ = ""; + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + type_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstanceStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus build() { + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus buildPartial() { + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus result = + new com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.errorMsg_ = errorMsg_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.type_ = type_; + } + } + + @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.alloydb.v1beta.BatchCreateInstanceStatus) { + return mergeFrom((com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus other) { + if (other == com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.getDefaultInstance()) + return this; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getErrorMsg().isEmpty()) { + errorMsg_ = other.errorMsg_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasError()) { + mergeError(other.getError()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + 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: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + errorMsg_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 24 + case 34: + { + input.readMessage(getErrorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + 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 int bitField0_; + + private int state_ = 0; + /** + * + * + *
+     * The current state of an instance involved in the batch create operation.
+     * Once the operation is complete, the final state of the instances in the
+     * LRO can be one of:
+     *   1. ACTIVE, indicating that instances were created successfully
+     *   2. FAILED, indicating that a particular instance failed creation
+     *   3. ROLLED_BACK indicating that although the instance was created
+     *      successfully, it had to be rolled back and deleted due to failure in
+     *      other steps of the workflow.
+     * 
+ * + * .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The current state of an instance involved in the batch create operation.
+     * Once the operation is complete, the final state of the instances in the
+     * LRO can be one of:
+     *   1. ACTIVE, indicating that instances were created successfully
+     *   2. FAILED, indicating that a particular instance failed creation
+     *   3. ROLLED_BACK indicating that although the instance was created
+     *      successfully, it had to be rolled back and deleted due to failure in
+     *      other steps of the workflow.
+     * 
+ * + * .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State state = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The current state of an instance involved in the batch create operation.
+     * Once the operation is complete, the final state of the instances in the
+     * LRO can be one of:
+     *   1. ACTIVE, indicating that instances were created successfully
+     *   2. FAILED, indicating that a particular instance failed creation
+     *   3. ROLLED_BACK indicating that although the instance was created
+     *      successfully, it had to be rolled back and deleted due to failure in
+     *      other steps of the workflow.
+     * 
+ * + * .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State getState() { + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State result = + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State.forNumber(state_); + return result == null + ? com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The current state of an instance involved in the batch create operation.
+     * Once the operation is complete, the final state of the instances in the
+     * LRO can be one of:
+     *   1. ACTIVE, indicating that instances were created successfully
+     *   2. FAILED, indicating that a particular instance failed creation
+     *   3. ROLLED_BACK indicating that although the instance was created
+     *      successfully, it had to be rolled back and deleted due to failure in
+     *      other steps of the workflow.
+     * 
+ * + * .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State state = 1; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The current state of an instance involved in the batch create operation.
+     * Once the operation is complete, the final state of the instances in the
+     * LRO can be one of:
+     *   1. ACTIVE, indicating that instances were created successfully
+     *   2. FAILED, indicating that a particular instance failed creation
+     *   3. ROLLED_BACK indicating that although the instance was created
+     *      successfully, it had to be rolled back and deleted due to failure in
+     *      other steps of the workflow.
+     * 
+ * + * .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State state = 1; + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000001); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object errorMsg_ = ""; + /** + * + * + *
+     * DEPRECATED - Use the error field instead.
+     * Error, if any error occurred and is available, during instance creation.
+     * 
+ * + * string error_msg = 2; + * + * @return The errorMsg. + */ + public java.lang.String getErrorMsg() { + java.lang.Object ref = errorMsg_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMsg_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * DEPRECATED - Use the error field instead.
+     * Error, if any error occurred and is available, during instance creation.
+     * 
+ * + * string error_msg = 2; + * + * @return The bytes for errorMsg. + */ + public com.google.protobuf.ByteString getErrorMsgBytes() { + java.lang.Object ref = errorMsg_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMsg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * DEPRECATED - Use the error field instead.
+     * Error, if any error occurred and is available, during instance creation.
+     * 
+ * + * string error_msg = 2; + * + * @param value The errorMsg to set. + * @return This builder for chaining. + */ + public Builder setErrorMsg(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + errorMsg_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * DEPRECATED - Use the error field instead.
+     * Error, if any error occurred and is available, during instance creation.
+     * 
+ * + * string error_msg = 2; + * + * @return This builder for chaining. + */ + public Builder clearErrorMsg() { + errorMsg_ = getDefaultInstance().getErrorMsg(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * DEPRECATED - Use the error field instead.
+     * Error, if any error occurred and is available, during instance creation.
+     * 
+ * + * string error_msg = 2; + * + * @param value The bytes for errorMsg to set. + * @return This builder for chaining. + */ + public Builder setErrorMsgBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + errorMsg_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.rpc.Status error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + * + * @return The error. + */ + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } else { + return errorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && error_ != null + && error_ != com.google.rpc.Status.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000004); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + } + /** + * + * + *
+     * The RPC status of the instance creation operation. This field will be
+     * present if an error happened during the instance creation.
+     * 
+ * + * .google.rpc.Status error = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + private int type_ = 0; + /** + * .google.cloud.alloydb.v1beta.Instance.InstanceType type = 3; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * .google.cloud.alloydb.v1beta.Instance.InstanceType type = 3; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .google.cloud.alloydb.v1beta.Instance.InstanceType type = 3; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.InstanceType getType() { + com.google.cloud.alloydb.v1beta.Instance.InstanceType result = + com.google.cloud.alloydb.v1beta.Instance.InstanceType.forNumber(type_); + return result == null + ? com.google.cloud.alloydb.v1beta.Instance.InstanceType.UNRECOGNIZED + : result; + } + /** + * .google.cloud.alloydb.v1beta.Instance.InstanceType type = 3; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.alloydb.v1beta.Instance.InstanceType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .google.cloud.alloydb.v1beta.Instance.InstanceType type = 3; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000008); + type_ = 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.alloydb.v1beta.BatchCreateInstanceStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.BatchCreateInstanceStatus) + private static final com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus(); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateInstanceStatus 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.alloydb.v1beta.BatchCreateInstanceStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstanceStatusOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstanceStatusOrBuilder.java new file mode 100644 index 000000000000..932f08bb18f4 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstanceStatusOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface BatchCreateInstanceStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.BatchCreateInstanceStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The current state of an instance involved in the batch create operation.
+   * Once the operation is complete, the final state of the instances in the
+   * LRO can be one of:
+   *   1. ACTIVE, indicating that instances were created successfully
+   *   2. FAILED, indicating that a particular instance failed creation
+   *   3. ROLLED_BACK indicating that although the instance was created
+   *      successfully, it had to be rolled back and deleted due to failure in
+   *      other steps of the workflow.
+   * 
+ * + * .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The current state of an instance involved in the batch create operation.
+   * Once the operation is complete, the final state of the instances in the
+   * LRO can be one of:
+   *   1. ACTIVE, indicating that instances were created successfully
+   *   2. FAILED, indicating that a particular instance failed creation
+   *   3. ROLLED_BACK indicating that although the instance was created
+   *      successfully, it had to be rolled back and deleted due to failure in
+   *      other steps of the workflow.
+   * 
+ * + * .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State state = 1; + * + * @return The state. + */ + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State getState(); + + /** + * + * + *
+   * DEPRECATED - Use the error field instead.
+   * Error, if any error occurred and is available, during instance creation.
+   * 
+ * + * string error_msg = 2; + * + * @return The errorMsg. + */ + java.lang.String getErrorMsg(); + /** + * + * + *
+   * DEPRECATED - Use the error field instead.
+   * Error, if any error occurred and is available, during instance creation.
+   * 
+ * + * string error_msg = 2; + * + * @return The bytes for errorMsg. + */ + com.google.protobuf.ByteString getErrorMsgBytes(); + + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + * + * @return Whether the error field is set. + */ + boolean hasError(); + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + * + * @return The error. + */ + com.google.rpc.Status getError(); + /** + * + * + *
+   * The RPC status of the instance creation operation. This field will be
+   * present if an error happened during the instance creation.
+   * 
+ * + * .google.rpc.Status error = 4; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + * .google.cloud.alloydb.v1beta.Instance.InstanceType type = 3; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * .google.cloud.alloydb.v1beta.Instance.InstanceType type = 3; + * + * @return The type. + */ + com.google.cloud.alloydb.v1beta.Instance.InstanceType getType(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesMetadata.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesMetadata.java new file mode 100644 index 000000000000..54adc9d4fc8c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesMetadata.java @@ -0,0 +1,1219 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for metadata that is specific to BatchCreateInstances API.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} + */ +public final class BatchCreateInstancesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) + BatchCreateInstancesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchCreateInstancesMetadata.newBuilder() to construct. + private BatchCreateInstancesMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchCreateInstancesMetadata() { + instanceTargets_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateInstancesMetadata(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetInstanceStatuses(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.class, + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.Builder.class); + } + + public static final int INSTANCE_TARGETS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList instanceTargets_; + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @return A list containing the instanceTargets. + */ + public com.google.protobuf.ProtocolStringList getInstanceTargetsList() { + return instanceTargets_; + } + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @return The count of instanceTargets. + */ + public int getInstanceTargetsCount() { + return instanceTargets_.size(); + } + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the element to return. + * @return The instanceTargets at the given index. + */ + public java.lang.String getInstanceTargets(int index) { + return instanceTargets_.get(index); + } + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the value to return. + * @return The bytes of the instanceTargets at the given index. + */ + public com.google.protobuf.ByteString getInstanceTargetsBytes(int index) { + return instanceTargets_.getByteString(index); + } + + public static final int INSTANCE_STATUSES_FIELD_NUMBER = 2; + + private static final class InstanceStatusesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_InstanceStatusesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + .getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> + instanceStatuses_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> + internalGetInstanceStatuses() { + if (instanceStatuses_ == null) { + return com.google.protobuf.MapField.emptyMapField( + InstanceStatusesDefaultEntryHolder.defaultEntry); + } + return instanceStatuses_; + } + + public int getInstanceStatusesCount() { + return internalGetInstanceStatuses().getMap().size(); + } + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public boolean containsInstanceStatuses(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetInstanceStatuses().getMap().containsKey(key); + } + /** Use {@link #getInstanceStatusesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getInstanceStatuses() { + return getInstanceStatusesMap(); + } + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public java.util.Map + getInstanceStatusesMap() { + return internalGetInstanceStatuses().getMap(); + } + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + getInstanceStatusesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetInstanceStatuses().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus getInstanceStatusesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetInstanceStatuses().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 { + for (int i = 0; i < instanceTargets_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, instanceTargets_.getRaw(i)); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetInstanceStatuses(), InstanceStatusesDefaultEntryHolder.defaultEntry, 2); + 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 < instanceTargets_.size(); i++) { + dataSize += computeStringSizeNoTag(instanceTargets_.getRaw(i)); + } + size += dataSize; + size += 1 * getInstanceTargetsList().size(); + } + for (java.util.Map.Entry< + java.lang.String, com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> + entry : internalGetInstanceStatuses().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> + instanceStatuses__ = + InstanceStatusesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, instanceStatuses__); + } + 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.alloydb.v1beta.BatchCreateInstancesMetadata)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata other = + (com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) obj; + + if (!getInstanceTargetsList().equals(other.getInstanceTargetsList())) return false; + if (!internalGetInstanceStatuses().equals(other.internalGetInstanceStatuses())) 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 (getInstanceTargetsCount() > 0) { + hash = (37 * hash) + INSTANCE_TARGETS_FIELD_NUMBER; + hash = (53 * hash) + getInstanceTargetsList().hashCode(); + } + if (!internalGetInstanceStatuses().getMap().isEmpty()) { + hash = (37 * hash) + INSTANCE_STATUSES_FIELD_NUMBER; + hash = (53 * hash) + internalGetInstanceStatuses().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata 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.alloydb.v1beta.BatchCreateInstancesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata 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.alloydb.v1beta.BatchCreateInstancesMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata 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.alloydb.v1beta.BatchCreateInstancesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata 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.alloydb.v1beta.BatchCreateInstancesMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata 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.alloydb.v1beta.BatchCreateInstancesMetadata 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; + } + /** + * + * + *
+   * Message for metadata that is specific to BatchCreateInstances API.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetInstanceStatuses(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableInstanceStatuses(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.class, + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instanceTargets_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableInstanceStatuses().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata build() { + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata buildPartial() { + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata result = + new com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata result) { + if (((bitField0_ & 0x00000001) != 0)) { + instanceTargets_ = instanceTargets_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instanceTargets_ = instanceTargets_; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceStatuses_ = internalGetInstanceStatuses(); + result.instanceStatuses_.makeImmutable(); + } + } + + @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.alloydb.v1beta.BatchCreateInstancesMetadata) { + return mergeFrom((com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata other) { + if (other + == com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.getDefaultInstance()) + return this; + if (!other.instanceTargets_.isEmpty()) { + if (instanceTargets_.isEmpty()) { + instanceTargets_ = other.instanceTargets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstanceTargetsIsMutable(); + instanceTargets_.addAll(other.instanceTargets_); + } + onChanged(); + } + internalGetMutableInstanceStatuses().mergeFrom(other.internalGetInstanceStatuses()); + bitField0_ |= 0x00000002; + 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(); + ensureInstanceTargetsIsMutable(); + instanceTargets_.add(s); + break; + } // case 10 + case 18: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> + instanceStatuses__ = + input.readMessage( + InstanceStatusesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableInstanceStatuses() + .getMutableMap() + .put(instanceStatuses__.getKey(), instanceStatuses__.getValue()); + bitField0_ |= 0x00000002; + 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.protobuf.LazyStringList instanceTargets_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureInstanceTargetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instanceTargets_ = new com.google.protobuf.LazyStringArrayList(instanceTargets_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @return A list containing the instanceTargets. + */ + public com.google.protobuf.ProtocolStringList getInstanceTargetsList() { + return instanceTargets_.getUnmodifiableView(); + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @return The count of instanceTargets. + */ + public int getInstanceTargetsCount() { + return instanceTargets_.size(); + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the element to return. + * @return The instanceTargets at the given index. + */ + public java.lang.String getInstanceTargets(int index) { + return instanceTargets_.get(index); + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the value to return. + * @return The bytes of the instanceTargets at the given index. + */ + public com.google.protobuf.ByteString getInstanceTargetsBytes(int index) { + return instanceTargets_.getByteString(index); + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index to set the value at. + * @param value The instanceTargets to set. + * @return This builder for chaining. + */ + public Builder setInstanceTargets(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstanceTargetsIsMutable(); + instanceTargets_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param value The instanceTargets to add. + * @return This builder for chaining. + */ + public Builder addInstanceTargets(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstanceTargetsIsMutable(); + instanceTargets_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param values The instanceTargets to add. + * @return This builder for chaining. + */ + public Builder addAllInstanceTargets(java.lang.Iterable values) { + ensureInstanceTargetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instanceTargets_); + onChanged(); + return this; + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstanceTargets() { + instanceTargets_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The instances being created in the API call. Each string in this list
+     * is the server defined resource path for target instances in the request
+     * and for the format of each string, see the comment on the Instance.name
+     * field.
+     * 
+ * + * repeated string instance_targets = 1; + * + * @param value The bytes of the instanceTargets to add. + * @return This builder for chaining. + */ + public Builder addInstanceTargetsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureInstanceTargetsIsMutable(); + instanceTargets_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> + instanceStatuses_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> + internalGetInstanceStatuses() { + if (instanceStatuses_ == null) { + return com.google.protobuf.MapField.emptyMapField( + InstanceStatusesDefaultEntryHolder.defaultEntry); + } + return instanceStatuses_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> + internalGetMutableInstanceStatuses() { + if (instanceStatuses_ == null) { + instanceStatuses_ = + com.google.protobuf.MapField.newMapField( + InstanceStatusesDefaultEntryHolder.defaultEntry); + } + if (!instanceStatuses_.isMutable()) { + instanceStatuses_ = instanceStatuses_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + return instanceStatuses_; + } + + public int getInstanceStatusesCount() { + return internalGetInstanceStatuses().getMap().size(); + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public boolean containsInstanceStatuses(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetInstanceStatuses().getMap().containsKey(key); + } + /** Use {@link #getInstanceStatusesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> + getInstanceStatuses() { + return getInstanceStatusesMap(); + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> + getInstanceStatusesMap() { + return internalGetInstanceStatuses().getMap(); + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + getInstanceStatusesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetInstanceStatuses().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus getInstanceStatusesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetInstanceStatuses().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearInstanceStatuses() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableInstanceStatuses().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + public Builder removeInstanceStatuses(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableInstanceStatuses().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> + getMutableInstanceStatuses() { + bitField0_ |= 0x00000002; + return internalGetMutableInstanceStatuses().getMutableMap(); + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + public Builder putInstanceStatuses( + java.lang.String key, com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableInstanceStatuses().getMutableMap().put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+     * A map representing state of the instances involved in the
+     * BatchCreateInstances operation during the operation execution.
+     * The instance state will be in STATE_UNSPECIFIED state if the instance has
+     * not yet been picked up for processing.
+     * The key of the map is the name of the instance resource.
+     * For the format, see the comment on the Instance.name field.
+     * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + public Builder putAllInstanceStatuses( + java.util.Map + values) { + internalGetMutableInstanceStatuses().getMutableMap().putAll(values); + bitField0_ |= 0x00000002; + 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.alloydb.v1beta.BatchCreateInstancesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) + private static final com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata(); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateInstancesMetadata 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.alloydb.v1beta.BatchCreateInstancesMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesMetadataOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesMetadataOrBuilder.java new file mode 100644 index 000000000000..8bcf200dd8b1 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesMetadataOrBuilder.java @@ -0,0 +1,184 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface BatchCreateInstancesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @return A list containing the instanceTargets. + */ + java.util.List getInstanceTargetsList(); + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @return The count of instanceTargets. + */ + int getInstanceTargetsCount(); + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the element to return. + * @return The instanceTargets at the given index. + */ + java.lang.String getInstanceTargets(int index); + /** + * + * + *
+   * The instances being created in the API call. Each string in this list
+   * is the server defined resource path for target instances in the request
+   * and for the format of each string, see the comment on the Instance.name
+   * field.
+   * 
+ * + * repeated string instance_targets = 1; + * + * @param index The index of the value to return. + * @return The bytes of the instanceTargets at the given index. + */ + com.google.protobuf.ByteString getInstanceTargetsBytes(int index); + + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + int getInstanceStatusesCount(); + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + boolean containsInstanceStatuses(java.lang.String key); + /** Use {@link #getInstanceStatusesMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getInstanceStatuses(); + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + java.util.Map + getInstanceStatusesMap(); + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + /* nullable */ + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus getInstanceStatusesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus defaultValue); + /** + * + * + *
+   * A map representing state of the instances involved in the
+   * BatchCreateInstances operation during the operation execution.
+   * The instance state will be in STATE_UNSPECIFIED state if the instance has
+   * not yet been picked up for processing.
+   * The key of the map is the name of the instance resource.
+   * For the format, see the comment on the Instance.name field.
+   * 
+ * + * + * map<string, .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus> instance_statuses = 2; + * + */ + com.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus getInstanceStatusesOrThrow( + java.lang.String key); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesRequest.java new file mode 100644 index 000000000000..c810e7262b0f --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesRequest.java @@ -0,0 +1,1186 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for creating a batch of instances under the specified cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} + */ +public final class BatchCreateInstancesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.BatchCreateInstancesRequest) + BatchCreateInstancesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchCreateInstancesRequest.newBuilder() to construct. + private BatchCreateInstancesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchCreateInstancesRequest() { + parent_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateInstancesRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.class, + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource.
+   * 
+ * + * + * 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 parent resource.
+   * 
+ * + * + * 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 REQUESTS_FIELD_NUMBER = 2; + private com.google.cloud.alloydb.v1beta.CreateInstanceRequests requests_; + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the requests field is set. + */ + @java.lang.Override + public boolean hasRequests() { + return requests_ != null; + } + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The requests. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateInstanceRequests getRequests() { + return requests_ == null + ? com.google.cloud.alloydb.v1beta.CreateInstanceRequests.getDefaultInstance() + : requests_; + } + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateInstanceRequestsOrBuilder getRequestsOrBuilder() { + return requests_ == null + ? com.google.cloud.alloydb.v1beta.CreateInstanceRequests.getDefaultInstance() + : requests_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (requests_ != null) { + output.writeMessage(2, getRequests()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, 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(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (requests_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequests()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, 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.alloydb.v1beta.BatchCreateInstancesRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest other = + (com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasRequests() != other.hasRequests()) return false; + if (hasRequests()) { + if (!getRequests().equals(other.getRequests())) return false; + } + 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasRequests()) { + hash = (37 * hash) + REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getRequests().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.alloydb.v1beta.BatchCreateInstancesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest 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.alloydb.v1beta.BatchCreateInstancesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest 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.alloydb.v1beta.BatchCreateInstancesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest 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.alloydb.v1beta.BatchCreateInstancesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest 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.alloydb.v1beta.BatchCreateInstancesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest 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.alloydb.v1beta.BatchCreateInstancesRequest 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; + } + /** + * + * + *
+   * Message for creating a batch of instances under the specified cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.BatchCreateInstancesRequest) + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.class, + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + requests_ = null; + if (requestsBuilder_ != null) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + } + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest build() { + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest buildPartial() { + com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest result = + new com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requests_ = requestsBuilder_ == null ? requests_ : requestsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + } + + @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.alloydb.v1beta.BatchCreateInstancesRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest other) { + if (other == com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasRequests()) { + mergeRequests(other.getRequests()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getRequestsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + 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 parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource.
+     * 
+ * + * + * 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 parent resource.
+     * 
+ * + * + * 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 parent resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1beta.CreateInstanceRequests requests_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.CreateInstanceRequests, + com.google.cloud.alloydb.v1beta.CreateInstanceRequests.Builder, + com.google.cloud.alloydb.v1beta.CreateInstanceRequestsOrBuilder> + requestsBuilder_; + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the requests field is set. + */ + public boolean hasRequests() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The requests. + */ + public com.google.cloud.alloydb.v1beta.CreateInstanceRequests getRequests() { + if (requestsBuilder_ == null) { + return requests_ == null + ? com.google.cloud.alloydb.v1beta.CreateInstanceRequests.getDefaultInstance() + : requests_; + } else { + return requestsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRequests(com.google.cloud.alloydb.v1beta.CreateInstanceRequests value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requests_ = value; + } else { + requestsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRequests( + com.google.cloud.alloydb.v1beta.CreateInstanceRequests.Builder builderForValue) { + if (requestsBuilder_ == null) { + requests_ = builderForValue.build(); + } else { + requestsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeRequests(com.google.cloud.alloydb.v1beta.CreateInstanceRequests value) { + if (requestsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && requests_ != null + && requests_ + != com.google.cloud.alloydb.v1beta.CreateInstanceRequests.getDefaultInstance()) { + getRequestsBuilder().mergeFrom(value); + } else { + requests_ = value; + } + } else { + requestsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRequests() { + bitField0_ = (bitField0_ & ~0x00000002); + requests_ = null; + if (requestsBuilder_ != null) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.CreateInstanceRequests.Builder getRequestsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getRequestsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.CreateInstanceRequestsOrBuilder getRequestsOrBuilder() { + if (requestsBuilder_ != null) { + return requestsBuilder_.getMessageOrBuilder(); + } else { + return requests_ == null + ? com.google.cloud.alloydb.v1beta.CreateInstanceRequests.getDefaultInstance() + : requests_; + } + } + /** + * + * + *
+     * Required. Resources being created.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.CreateInstanceRequests, + com.google.cloud.alloydb.v1beta.CreateInstanceRequests.Builder, + com.google.cloud.alloydb.v1beta.CreateInstanceRequestsOrBuilder> + getRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.CreateInstanceRequests, + com.google.cloud.alloydb.v1beta.CreateInstanceRequests.Builder, + com.google.cloud.alloydb.v1beta.CreateInstanceRequestsOrBuilder>( + getRequests(), getParentForChildren(), isClean()); + requests_ = null; + } + return requestsBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + 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.alloydb.v1beta.BatchCreateInstancesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.BatchCreateInstancesRequest) + private static final com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest(); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateInstancesRequest 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.alloydb.v1beta.BatchCreateInstancesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesRequestOrBuilder.java new file mode 100644 index 000000000000..394b79e4c816 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesRequestOrBuilder.java @@ -0,0 +1,140 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface BatchCreateInstancesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.BatchCreateInstancesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the requests field is set. + */ + boolean hasRequests(); + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The requests. + */ + com.google.cloud.alloydb.v1beta.CreateInstanceRequests getRequests(); + /** + * + * + *
+   * Required. Resources being created.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1beta.CreateInstanceRequestsOrBuilder getRequestsOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesResponse.java new file mode 100644 index 000000000000..f8404071f522 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesResponse.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/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for creating batches of instances in a cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} + */ +public final class BatchCreateInstancesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.BatchCreateInstancesResponse) + BatchCreateInstancesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchCreateInstancesResponse.newBuilder() to construct. + private BatchCreateInstancesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchCreateInstancesResponse() { + instances_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateInstancesResponse(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.class, + com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.Builder.class); + } + + public static final int INSTANCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List instances_; + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + @java.lang.Override + public java.util.List getInstancesList() { + return instances_; + } + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + @java.lang.Override + public java.util.List + getInstancesOrBuilderList() { + return instances_; + } + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance getInstances(int index) { + return instances_.get(index); + } + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.InstanceOrBuilder getInstancesOrBuilder(int index) { + return instances_.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 < instances_.size(); i++) { + output.writeMessage(1, instances_.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 < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, instances_.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.alloydb.v1beta.BatchCreateInstancesResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse other = + (com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse) obj; + + if (!getInstancesList().equals(other.getInstancesList())) 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 (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse 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.alloydb.v1beta.BatchCreateInstancesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse 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.alloydb.v1beta.BatchCreateInstancesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse 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.alloydb.v1beta.BatchCreateInstancesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse 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.alloydb.v1beta.BatchCreateInstancesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse 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.alloydb.v1beta.BatchCreateInstancesResponse 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; + } + /** + * + * + *
+   * Message for creating batches of instances in a cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.BatchCreateInstancesResponse) + com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.class, + com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + } else { + instances_ = null; + instancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse build() { + com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse buildPartial() { + com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse result = + new com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse result) { + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse result) { + int from_bitField0_ = bitField0_; + } + + @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.alloydb.v1beta.BatchCreateInstancesResponse) { + return mergeFrom((com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse other) { + if (other + == com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.getDefaultInstance()) + return this; + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + 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.alloydb.v1beta.Instance m = + input.readMessage( + com.google.cloud.alloydb.v1beta.Instance.parser(), extensionRegistry); + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(m); + } else { + instancesBuilder_.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 instances_ = + java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instances_ = new java.util.ArrayList(instances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance, + com.google.cloud.alloydb.v1beta.Instance.Builder, + com.google.cloud.alloydb.v1beta.InstanceOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public java.util.List getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1beta.Instance getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder setInstances(int index, com.google.cloud.alloydb.v1beta.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder setInstances( + int index, com.google.cloud.alloydb.v1beta.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.alloydb.v1beta.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder addInstances(int index, com.google.cloud.alloydb.v1beta.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.alloydb.v1beta.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder addInstances( + int index, com.google.cloud.alloydb.v1beta.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder addAllInstances( + java.lang.Iterable values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1beta.Instance.Builder getInstancesBuilder(int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1beta.InstanceOrBuilder getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public java.util.List + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1beta.Instance.Builder addInstancesBuilder() { + return getInstancesFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1beta.Instance.Builder addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * Created instances.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public java.util.List + getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance, + com.google.cloud.alloydb.v1beta.Instance.Builder, + com.google.cloud.alloydb.v1beta.InstanceOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance, + com.google.cloud.alloydb.v1beta.Instance.Builder, + com.google.cloud.alloydb.v1beta.InstanceOrBuilder>( + instances_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + @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.alloydb.v1beta.BatchCreateInstancesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.BatchCreateInstancesResponse) + private static final com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse(); + } + + public static com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateInstancesResponse 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.alloydb.v1beta.BatchCreateInstancesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesResponseOrBuilder.java new file mode 100644 index 000000000000..48fcd94f6a6c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesResponseOrBuilder.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/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface BatchCreateInstancesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.BatchCreateInstancesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + java.util.List getInstancesList(); + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + com.google.cloud.alloydb.v1beta.Instance getInstances(int index); + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + int getInstancesCount(); + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + java.util.List + getInstancesOrBuilderList(); + /** + * + * + *
+   * Created instances.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + com.google.cloud.alloydb.v1beta.InstanceOrBuilder getInstancesOrBuilder(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Cluster.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Cluster.java new file mode 100644 index 000000000000..e592cf252c7d --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Cluster.java @@ -0,0 +1,8978 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * A cluster is a collection of regional AlloyDB resources. It can include a
+ * primary instance and one or more read pool instances.
+ * All cluster resources share a storage layer, which scales as needed.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Cluster} + */ +public final class Cluster extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.Cluster) + ClusterOrBuilder { + private static final long serialVersionUID = 0L; + // Use Cluster.newBuilder() to construct. + private Cluster(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Cluster() { + name_ = ""; + displayName_ = ""; + uid_ = ""; + state_ = 0; + clusterType_ = 0; + databaseVersion_ = 0; + network_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Cluster(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + case 12: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Cluster.class, + com.google.cloud.alloydb.v1beta.Cluster.Builder.class); + } + + /** + * + * + *
+   * Cluster State
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.Cluster.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the cluster is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The cluster is active and running.
+     * 
+ * + * READY = 1; + */ + READY(1), + /** + * + * + *
+     * The cluster is stopped. All instances in the cluster are stopped.
+     * Customers can start a stopped cluster at any point and all their
+     * instances will come back to life with same names and IP resources. In
+     * this state, customer pays for storage.
+     * Associated backups could also be present in a stopped cluster.
+     * 
+ * + * STOPPED = 2; + */ + STOPPED(2), + /** + * + * + *
+     * The cluster is empty and has no associated resources.
+     * All instances, associated storage and backups have been deleted.
+     * 
+ * + * EMPTY = 3; + */ + EMPTY(3), + /** + * + * + *
+     * The cluster is being created.
+     * 
+ * + * CREATING = 4; + */ + CREATING(4), + /** + * + * + *
+     * The cluster is being deleted.
+     * 
+ * + * DELETING = 5; + */ + DELETING(5), + /** + * + * + *
+     * The creation of the cluster failed.
+     * 
+ * + * FAILED = 6; + */ + FAILED(6), + /** + * + * + *
+     * The cluster is bootstrapping with data from some other source.
+     * Direct mutations to the cluster (e.g. adding read pool) are not allowed.
+     * 
+ * + * BOOTSTRAPPING = 7; + */ + BOOTSTRAPPING(7), + /** + * + * + *
+     * The cluster is under maintenance. AlloyDB regularly performs maintenance
+     * and upgrades on customer clusters. Updates on the cluster are
+     * not allowed while the cluster is in this state.
+     * 
+ * + * MAINTENANCE = 8; + */ + MAINTENANCE(8), + /** + * + * + *
+     * The cluster is being promoted.
+     * 
+ * + * PROMOTING = 9; + */ + PROMOTING(9), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The state of the cluster is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The cluster is active and running.
+     * 
+ * + * READY = 1; + */ + public static final int READY_VALUE = 1; + /** + * + * + *
+     * The cluster is stopped. All instances in the cluster are stopped.
+     * Customers can start a stopped cluster at any point and all their
+     * instances will come back to life with same names and IP resources. In
+     * this state, customer pays for storage.
+     * Associated backups could also be present in a stopped cluster.
+     * 
+ * + * STOPPED = 2; + */ + public static final int STOPPED_VALUE = 2; + /** + * + * + *
+     * The cluster is empty and has no associated resources.
+     * All instances, associated storage and backups have been deleted.
+     * 
+ * + * EMPTY = 3; + */ + public static final int EMPTY_VALUE = 3; + /** + * + * + *
+     * The cluster is being created.
+     * 
+ * + * CREATING = 4; + */ + public static final int CREATING_VALUE = 4; + /** + * + * + *
+     * The cluster is being deleted.
+     * 
+ * + * DELETING = 5; + */ + public static final int DELETING_VALUE = 5; + /** + * + * + *
+     * The creation of the cluster failed.
+     * 
+ * + * FAILED = 6; + */ + public static final int FAILED_VALUE = 6; + /** + * + * + *
+     * The cluster is bootstrapping with data from some other source.
+     * Direct mutations to the cluster (e.g. adding read pool) are not allowed.
+     * 
+ * + * BOOTSTRAPPING = 7; + */ + public static final int BOOTSTRAPPING_VALUE = 7; + /** + * + * + *
+     * The cluster is under maintenance. AlloyDB regularly performs maintenance
+     * and upgrades on customer clusters. Updates on the cluster are
+     * not allowed while the cluster is in this state.
+     * 
+ * + * MAINTENANCE = 8; + */ + public static final int MAINTENANCE_VALUE = 8; + /** + * + * + *
+     * The cluster is being promoted.
+     * 
+ * + * PROMOTING = 9; + */ + public static final int PROMOTING_VALUE = 9; + + 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 READY; + case 2: + return STOPPED; + case 3: + return EMPTY; + case 4: + return CREATING; + case 5: + return DELETING; + case 6: + return FAILED; + case 7: + return BOOTSTRAPPING; + case 8: + return MAINTENANCE; + case 9: + return PROMOTING; + 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.alloydb.v1beta.Cluster.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.alloydb.v1beta.Cluster.State) + } + + /** + * + * + *
+   * Type of Cluster
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.Cluster.ClusterType} + */ + public enum ClusterType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The type of the cluster is unknown.
+     * 
+ * + * CLUSTER_TYPE_UNSPECIFIED = 0; + */ + CLUSTER_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Primary cluster that support read and write operations.
+     * 
+ * + * PRIMARY = 1; + */ + PRIMARY(1), + /** + * + * + *
+     * Secondary cluster that is replicating from another region.
+     * This only supports read.
+     * 
+ * + * SECONDARY = 2; + */ + SECONDARY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The type of the cluster is unknown.
+     * 
+ * + * CLUSTER_TYPE_UNSPECIFIED = 0; + */ + public static final int CLUSTER_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Primary cluster that support read and write operations.
+     * 
+ * + * PRIMARY = 1; + */ + public static final int PRIMARY_VALUE = 1; + /** + * + * + *
+     * Secondary cluster that is replicating from another region.
+     * This only supports read.
+     * 
+ * + * SECONDARY = 2; + */ + public static final int SECONDARY_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 ClusterType 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 ClusterType forNumber(int value) { + switch (value) { + case 0: + return CLUSTER_TYPE_UNSPECIFIED; + case 1: + return PRIMARY; + case 2: + return SECONDARY; + 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 ClusterType findValueByNumber(int number) { + return ClusterType.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.alloydb.v1beta.Cluster.getDescriptor().getEnumTypes().get(1); + } + + private static final ClusterType[] VALUES = values(); + + public static ClusterType 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 ClusterType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.Cluster.ClusterType) + } + + public interface SecondaryConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.Cluster.SecondaryConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the primary cluster name with the format:
+     * * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string primary_cluster_name = 1; + * + * @return The primaryClusterName. + */ + java.lang.String getPrimaryClusterName(); + /** + * + * + *
+     * The name of the primary cluster name with the format:
+     * * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string primary_cluster_name = 1; + * + * @return The bytes for primaryClusterName. + */ + com.google.protobuf.ByteString getPrimaryClusterNameBytes(); + } + /** + * + * + *
+   * Configuration information for the secondary cluster. This should be set
+   * if and only if the cluster is of type SECONDARY.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} + */ + public static final class SecondaryConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.Cluster.SecondaryConfig) + SecondaryConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecondaryConfig.newBuilder() to construct. + private SecondaryConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecondaryConfig() { + primaryClusterName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecondaryConfig(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_SecondaryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_SecondaryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.class, + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.Builder.class); + } + + public static final int PRIMARY_CLUSTER_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object primaryClusterName_ = ""; + /** + * + * + *
+     * The name of the primary cluster name with the format:
+     * * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string primary_cluster_name = 1; + * + * @return The primaryClusterName. + */ + @java.lang.Override + public java.lang.String getPrimaryClusterName() { + java.lang.Object ref = primaryClusterName_; + 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(); + primaryClusterName_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the primary cluster name with the format:
+     * * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string primary_cluster_name = 1; + * + * @return The bytes for primaryClusterName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrimaryClusterNameBytes() { + java.lang.Object ref = primaryClusterName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryClusterName_ = 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(primaryClusterName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, primaryClusterName_); + } + 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(primaryClusterName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, primaryClusterName_); + } + 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.alloydb.v1beta.Cluster.SecondaryConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig other = + (com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig) obj; + + if (!getPrimaryClusterName().equals(other.getPrimaryClusterName())) 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) + PRIMARY_CLUSTER_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryClusterName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig 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.alloydb.v1beta.Cluster.SecondaryConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig 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.alloydb.v1beta.Cluster.SecondaryConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig 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.alloydb.v1beta.Cluster.SecondaryConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig 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.alloydb.v1beta.Cluster.SecondaryConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig 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.alloydb.v1beta.Cluster.SecondaryConfig 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; + } + /** + * + * + *
+     * Configuration information for the secondary cluster. This should be set
+     * if and only if the cluster is of type SECONDARY.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.Cluster.SecondaryConfig) + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_SecondaryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_SecondaryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.class, + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + primaryClusterName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_SecondaryConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig build() { + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig buildPartial() { + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig result = + new com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.primaryClusterName_ = primaryClusterName_; + } + } + + @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.alloydb.v1beta.Cluster.SecondaryConfig) { + return mergeFrom((com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig other) { + if (other == com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.getDefaultInstance()) + return this; + if (!other.getPrimaryClusterName().isEmpty()) { + primaryClusterName_ = other.primaryClusterName_; + bitField0_ |= 0x00000001; + 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: + { + primaryClusterName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + 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.lang.Object primaryClusterName_ = ""; + /** + * + * + *
+       * The name of the primary cluster name with the format:
+       * * projects/{project}/locations/{region}/clusters/{cluster_id}
+       * 
+ * + * string primary_cluster_name = 1; + * + * @return The primaryClusterName. + */ + public java.lang.String getPrimaryClusterName() { + java.lang.Object ref = primaryClusterName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryClusterName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the primary cluster name with the format:
+       * * projects/{project}/locations/{region}/clusters/{cluster_id}
+       * 
+ * + * string primary_cluster_name = 1; + * + * @return The bytes for primaryClusterName. + */ + public com.google.protobuf.ByteString getPrimaryClusterNameBytes() { + java.lang.Object ref = primaryClusterName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryClusterName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the primary cluster name with the format:
+       * * projects/{project}/locations/{region}/clusters/{cluster_id}
+       * 
+ * + * string primary_cluster_name = 1; + * + * @param value The primaryClusterName to set. + * @return This builder for chaining. + */ + public Builder setPrimaryClusterName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + primaryClusterName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the primary cluster name with the format:
+       * * projects/{project}/locations/{region}/clusters/{cluster_id}
+       * 
+ * + * string primary_cluster_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearPrimaryClusterName() { + primaryClusterName_ = getDefaultInstance().getPrimaryClusterName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the primary cluster name with the format:
+       * * projects/{project}/locations/{region}/clusters/{cluster_id}
+       * 
+ * + * string primary_cluster_name = 1; + * + * @param value The bytes for primaryClusterName to set. + * @return This builder for chaining. + */ + public Builder setPrimaryClusterNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + primaryClusterName_ = value; + 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.alloydb.v1beta.Cluster.SecondaryConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.Cluster.SecondaryConfig) + private static final com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig(); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecondaryConfig 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.alloydb.v1beta.Cluster.SecondaryConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PrimaryConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.Cluster.PrimaryConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the secondaryClusterNames. + */ + java.util.List getSecondaryClusterNamesList(); + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of secondaryClusterNames. + */ + int getSecondaryClusterNamesCount(); + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The secondaryClusterNames at the given index. + */ + java.lang.String getSecondaryClusterNames(int index); + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the secondaryClusterNames at the given index. + */ + com.google.protobuf.ByteString getSecondaryClusterNamesBytes(int index); + } + /** + * + * + *
+   * Configuration for the primary cluster. It has the list of clusters that are
+   * replicating from this cluster. This should be set if and only if the
+   * cluster is of type PRIMARY.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} + */ + public static final class PrimaryConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.Cluster.PrimaryConfig) + PrimaryConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use PrimaryConfig.newBuilder() to construct. + private PrimaryConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PrimaryConfig() { + secondaryClusterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PrimaryConfig(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_PrimaryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_PrimaryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.class, + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.Builder.class); + } + + public static final int SECONDARY_CLUSTER_NAMES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList secondaryClusterNames_; + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the secondaryClusterNames. + */ + public com.google.protobuf.ProtocolStringList getSecondaryClusterNamesList() { + return secondaryClusterNames_; + } + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of secondaryClusterNames. + */ + public int getSecondaryClusterNamesCount() { + return secondaryClusterNames_.size(); + } + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The secondaryClusterNames at the given index. + */ + public java.lang.String getSecondaryClusterNames(int index) { + return secondaryClusterNames_.get(index); + } + /** + * + * + *
+     * Output only. Names of the clusters that are replicating from this
+     * cluster.
+     * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the secondaryClusterNames at the given index. + */ + public com.google.protobuf.ByteString getSecondaryClusterNamesBytes(int index) { + return secondaryClusterNames_.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 < secondaryClusterNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 1, secondaryClusterNames_.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 < secondaryClusterNames_.size(); i++) { + dataSize += computeStringSizeNoTag(secondaryClusterNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getSecondaryClusterNamesList().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.alloydb.v1beta.Cluster.PrimaryConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig other = + (com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig) obj; + + if (!getSecondaryClusterNamesList().equals(other.getSecondaryClusterNamesList())) + 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 (getSecondaryClusterNamesCount() > 0) { + hash = (37 * hash) + SECONDARY_CLUSTER_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getSecondaryClusterNamesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig 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.alloydb.v1beta.Cluster.PrimaryConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig 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.alloydb.v1beta.Cluster.PrimaryConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig 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.alloydb.v1beta.Cluster.PrimaryConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig 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.alloydb.v1beta.Cluster.PrimaryConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig 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.alloydb.v1beta.Cluster.PrimaryConfig 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; + } + /** + * + * + *
+     * Configuration for the primary cluster. It has the list of clusters that are
+     * replicating from this cluster. This should be set if and only if the
+     * cluster is of type PRIMARY.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.Cluster.PrimaryConfig) + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_PrimaryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_PrimaryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.class, + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + secondaryClusterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_PrimaryConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig build() { + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig buildPartial() { + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig result = + new com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig result) { + if (((bitField0_ & 0x00000001) != 0)) { + secondaryClusterNames_ = secondaryClusterNames_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.secondaryClusterNames_ = secondaryClusterNames_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig result) { + int from_bitField0_ = bitField0_; + } + + @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.alloydb.v1beta.Cluster.PrimaryConfig) { + return mergeFrom((com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig other) { + if (other == com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.getDefaultInstance()) + return this; + if (!other.secondaryClusterNames_.isEmpty()) { + if (secondaryClusterNames_.isEmpty()) { + secondaryClusterNames_ = other.secondaryClusterNames_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSecondaryClusterNamesIsMutable(); + secondaryClusterNames_.addAll(other.secondaryClusterNames_); + } + 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(); + ensureSecondaryClusterNamesIsMutable(); + secondaryClusterNames_.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 secondaryClusterNames_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureSecondaryClusterNamesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + secondaryClusterNames_ = + new com.google.protobuf.LazyStringArrayList(secondaryClusterNames_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the secondaryClusterNames. + */ + public com.google.protobuf.ProtocolStringList getSecondaryClusterNamesList() { + return secondaryClusterNames_.getUnmodifiableView(); + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of secondaryClusterNames. + */ + public int getSecondaryClusterNamesCount() { + return secondaryClusterNames_.size(); + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The secondaryClusterNames at the given index. + */ + public java.lang.String getSecondaryClusterNames(int index) { + return secondaryClusterNames_.get(index); + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the secondaryClusterNames at the given index. + */ + public com.google.protobuf.ByteString getSecondaryClusterNamesBytes(int index) { + return secondaryClusterNames_.getByteString(index); + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The secondaryClusterNames to set. + * @return This builder for chaining. + */ + public Builder setSecondaryClusterNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecondaryClusterNamesIsMutable(); + secondaryClusterNames_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The secondaryClusterNames to add. + * @return This builder for chaining. + */ + public Builder addSecondaryClusterNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecondaryClusterNamesIsMutable(); + secondaryClusterNames_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The secondaryClusterNames to add. + * @return This builder for chaining. + */ + public Builder addAllSecondaryClusterNames(java.lang.Iterable values) { + ensureSecondaryClusterNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, secondaryClusterNames_); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSecondaryClusterNames() { + secondaryClusterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Names of the clusters that are replicating from this
+       * cluster.
+       * 
+ * + * + * repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes of the secondaryClusterNames to add. + * @return This builder for chaining. + */ + public Builder addSecondaryClusterNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSecondaryClusterNamesIsMutable(); + secondaryClusterNames_.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.alloydb.v1beta.Cluster.PrimaryConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.Cluster.PrimaryConfig) + private static final com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig(); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PrimaryConfig 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.alloydb.v1beta.Cluster.PrimaryConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BACKUP_SOURCE(15), + MIGRATION_SOURCE(16), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 15: + return BACKUP_SOURCE; + case 16: + return MIGRATION_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int BACKUP_SOURCE_FIELD_NUMBER = 15; + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupSource field is set. + */ + @java.lang.Override + public boolean hasBackupSource() { + return sourceCase_ == 15; + } + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BackupSource getBackupSource() { + if (sourceCase_ == 15) { + return (com.google.cloud.alloydb.v1beta.BackupSource) source_; + } + return com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance(); + } + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BackupSourceOrBuilder getBackupSourceOrBuilder() { + if (sourceCase_ == 15) { + return (com.google.cloud.alloydb.v1beta.BackupSource) source_; + } + return com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance(); + } + + public static final int MIGRATION_SOURCE_FIELD_NUMBER = 16; + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the migrationSource field is set. + */ + @java.lang.Override + public boolean hasMigrationSource() { + return sourceCase_ == 16; + } + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The migrationSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.MigrationSource getMigrationSource() { + if (sourceCase_ == 16) { + return (com.google.cloud.alloydb.v1beta.MigrationSource) source_; + } + return com.google.cloud.alloydb.v1beta.MigrationSource.getDefaultInstance(); + } + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.MigrationSourceOrBuilder getMigrationSourceOrBuilder() { + if (sourceCase_ == 16) { + return (com.google.cloud.alloydb.v1beta.MigrationSource) source_; + } + return com.google.cloud.alloydb.v1beta.MigrationSource.getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The name of the cluster resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * where the cluster ID segment should satisfy the regex expression
+   * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+   * The prefix of the cluster resource name is the name of the parent resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The name of the cluster resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * where the cluster ID segment should satisfy the regex expression
+   * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+   * The prefix of the cluster resource name is the name of the parent resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * User-settable and human-readable display name for the Cluster.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * User-settable and human-readable display name for the Cluster.
+   * 
+ * + * 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 UID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + 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(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int DELETE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + + public static final int LABELS_FIELD_NUMBER = 7; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATE_FIELD_NUMBER = 8; + private int state_ = 0; + /** + * + * + *
+   * Output only. The current serving state of the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current serving state of the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.State getState() { + com.google.cloud.alloydb.v1beta.Cluster.State result = + com.google.cloud.alloydb.v1beta.Cluster.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1beta.Cluster.State.UNRECOGNIZED : result; + } + + public static final int CLUSTER_TYPE_FIELD_NUMBER = 24; + private int clusterType_ = 0; + /** + * + * + *
+   * Output only. The type of the cluster. This is an output-only field and it's
+   * populated at the Cluster creation time or the Cluster promotion
+   * time. The cluster type is determined by which RPC was used to create
+   * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for clusterType. + */ + @java.lang.Override + public int getClusterTypeValue() { + return clusterType_; + } + /** + * + * + *
+   * Output only. The type of the cluster. This is an output-only field and it's
+   * populated at the Cluster creation time or the Cluster promotion
+   * time. The cluster type is determined by which RPC was used to create
+   * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The clusterType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.ClusterType getClusterType() { + com.google.cloud.alloydb.v1beta.Cluster.ClusterType result = + com.google.cloud.alloydb.v1beta.Cluster.ClusterType.forNumber(clusterType_); + return result == null + ? com.google.cloud.alloydb.v1beta.Cluster.ClusterType.UNRECOGNIZED + : result; + } + + public static final int DATABASE_VERSION_FIELD_NUMBER = 9; + private int databaseVersion_ = 0; + /** + * + * + *
+   * Output only. The database engine major version. This is an output-only
+   * field and it's populated at the Cluster creation time. This field cannot be
+   * changed after cluster creation.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + /** + * + * + *
+   * Output only. The database engine major version. This is an output-only
+   * field and it's populated at the Cluster creation time. This field cannot be
+   * changed after cluster creation.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DatabaseVersion getDatabaseVersion() { + com.google.cloud.alloydb.v1beta.DatabaseVersion result = + com.google.cloud.alloydb.v1beta.DatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.alloydb.v1beta.DatabaseVersion.UNRECOGNIZED : result; + } + + public static final int NETWORK_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object network_ = ""; + /** + * + * + *
+   * Required. The resource link for the VPC network in which cluster resources
+   * are created and from which they are accessible via Private IP. The network
+   * must belong to the same project as the cluster. It is specified in the
+   * form: "projects/{project_number}/global/networks/{network_id}". This is
+   * required to create a cluster. It can be updated, but it cannot be removed.
+   * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + 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(); + network_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource link for the VPC network in which cluster resources
+   * are created and from which they are accessible via Private IP. The network
+   * must belong to the same project as the cluster. It is specified in the
+   * form: "projects/{project_number}/global/networks/{network_id}". This is
+   * required to create a cluster. It can be updated, but it cannot be removed.
+   * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 11; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 11; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 12; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int RECONCILING_FIELD_NUMBER = 13; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+   * Set to true if the current state of Cluster does not match the user's
+   * intended state, and the service is actively updating the resource to
+   * reconcile them. This can happen due to user-triggered updates or
+   * system actions like failover or maintenance.
+   * 
+ * + * bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int INITIAL_USER_FIELD_NUMBER = 14; + private com.google.cloud.alloydb.v1beta.UserPassword initialUser_; + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the initialUser field is set. + */ + @java.lang.Override + public boolean hasInitialUser() { + return initialUser_ != null; + } + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The initialUser. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UserPassword getInitialUser() { + return initialUser_ == null + ? com.google.cloud.alloydb.v1beta.UserPassword.getDefaultInstance() + : initialUser_; + } + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UserPasswordOrBuilder getInitialUserOrBuilder() { + return initialUser_ == null + ? com.google.cloud.alloydb.v1beta.UserPassword.getDefaultInstance() + : initialUser_; + } + + public static final int AUTOMATED_BACKUP_POLICY_FIELD_NUMBER = 17; + private com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy automatedBackupPolicy_; + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return Whether the automatedBackupPolicy field is set. + */ + @java.lang.Override + public boolean hasAutomatedBackupPolicy() { + return automatedBackupPolicy_ != null; + } + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return The automatedBackupPolicy. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy getAutomatedBackupPolicy() { + return automatedBackupPolicy_ == null + ? com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.getDefaultInstance() + : automatedBackupPolicy_; + } + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicyOrBuilder + getAutomatedBackupPolicyOrBuilder() { + return automatedBackupPolicy_ == null + ? com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.getDefaultInstance() + : automatedBackupPolicy_; + } + + public static final int SSL_CONFIG_FIELD_NUMBER = 18; + private com.google.cloud.alloydb.v1beta.SslConfig sslConfig_; + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * + * @return Whether the sslConfig field is set. + */ + @java.lang.Override + public boolean hasSslConfig() { + return sslConfig_ != null; + } + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * + * @return The sslConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SslConfig getSslConfig() { + return sslConfig_ == null + ? com.google.cloud.alloydb.v1beta.SslConfig.getDefaultInstance() + : sslConfig_; + } + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SslConfigOrBuilder getSslConfigOrBuilder() { + return sslConfig_ == null + ? com.google.cloud.alloydb.v1beta.SslConfig.getDefaultInstance() + : sslConfig_; + } + + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 19; + private com.google.cloud.alloydb.v1beta.EncryptionConfig encryptionConfig_; + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return encryptionConfig_ != null; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + public static final int ENCRYPTION_INFO_FIELD_NUMBER = 20; + private com.google.cloud.alloydb.v1beta.EncryptionInfo encryptionInfo_; + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + @java.lang.Override + public boolean hasEncryptionInfo() { + return encryptionInfo_ != null; + } + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionInfo getEncryptionInfo() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + + public static final int CONTINUOUS_BACKUP_CONFIG_FIELD_NUMBER = 27; + private com.google.cloud.alloydb.v1beta.ContinuousBackupConfig continuousBackupConfig_; + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the continuousBackupConfig field is set. + */ + @java.lang.Override + public boolean hasContinuousBackupConfig() { + return continuousBackupConfig_ != null; + } + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The continuousBackupConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupConfig getContinuousBackupConfig() { + return continuousBackupConfig_ == null + ? com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.getDefaultInstance() + : continuousBackupConfig_; + } + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupConfigOrBuilder + getContinuousBackupConfigOrBuilder() { + return continuousBackupConfig_ == null + ? com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.getDefaultInstance() + : continuousBackupConfig_; + } + + public static final int CONTINUOUS_BACKUP_INFO_FIELD_NUMBER = 28; + private com.google.cloud.alloydb.v1beta.ContinuousBackupInfo continuousBackupInfo_; + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the continuousBackupInfo field is set. + */ + @java.lang.Override + public boolean hasContinuousBackupInfo() { + return continuousBackupInfo_ != null; + } + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The continuousBackupInfo. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupInfo getContinuousBackupInfo() { + return continuousBackupInfo_ == null + ? com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.getDefaultInstance() + : continuousBackupInfo_; + } + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupInfoOrBuilder + getContinuousBackupInfoOrBuilder() { + return continuousBackupInfo_ == null + ? com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.getDefaultInstance() + : continuousBackupInfo_; + } + + public static final int SECONDARY_CONFIG_FIELD_NUMBER = 22; + private com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondaryConfig_; + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + * + * @return Whether the secondaryConfig field is set. + */ + @java.lang.Override + public boolean hasSecondaryConfig() { + return secondaryConfig_ != null; + } + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + * + * @return The secondaryConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig getSecondaryConfig() { + return secondaryConfig_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.getDefaultInstance() + : secondaryConfig_; + } + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfigOrBuilder + getSecondaryConfigOrBuilder() { + return secondaryConfig_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.getDefaultInstance() + : secondaryConfig_; + } + + public static final int PRIMARY_CONFIG_FIELD_NUMBER = 23; + private com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primaryConfig_; + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the primaryConfig field is set. + */ + @java.lang.Override + public boolean hasPrimaryConfig() { + return primaryConfig_ != null; + } + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The primaryConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig getPrimaryConfig() { + return primaryConfig_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.getDefaultInstance() + : primaryConfig_; + } + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfigOrBuilder + getPrimaryConfigOrBuilder() { + return primaryConfig_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.getDefaultInstance() + : primaryConfig_; + } + + 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(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uid_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (deleteTime_ != null) { + output.writeMessage(6, getDeleteTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 7); + if (state_ != com.google.cloud.alloydb.v1beta.Cluster.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, state_); + } + if (databaseVersion_ + != com.google.cloud.alloydb.v1beta.DatabaseVersion.DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, databaseVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, etag_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 12); + if (reconciling_ != false) { + output.writeBool(13, reconciling_); + } + if (initialUser_ != null) { + output.writeMessage(14, getInitialUser()); + } + if (sourceCase_ == 15) { + output.writeMessage(15, (com.google.cloud.alloydb.v1beta.BackupSource) source_); + } + if (sourceCase_ == 16) { + output.writeMessage(16, (com.google.cloud.alloydb.v1beta.MigrationSource) source_); + } + if (automatedBackupPolicy_ != null) { + output.writeMessage(17, getAutomatedBackupPolicy()); + } + if (sslConfig_ != null) { + output.writeMessage(18, getSslConfig()); + } + if (encryptionConfig_ != null) { + output.writeMessage(19, getEncryptionConfig()); + } + if (encryptionInfo_ != null) { + output.writeMessage(20, getEncryptionInfo()); + } + if (secondaryConfig_ != null) { + output.writeMessage(22, getSecondaryConfig()); + } + if (primaryConfig_ != null) { + output.writeMessage(23, getPrimaryConfig()); + } + if (clusterType_ + != com.google.cloud.alloydb.v1beta.Cluster.ClusterType.CLUSTER_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(24, clusterType_); + } + if (continuousBackupConfig_ != null) { + output.writeMessage(27, getContinuousBackupConfig()); + } + if (continuousBackupInfo_ != null) { + output.writeMessage(28, getContinuousBackupInfo()); + } + 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(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uid_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDeleteTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, labels__); + } + if (state_ != com.google.cloud.alloydb.v1beta.Cluster.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, state_); + } + if (databaseVersion_ + != com.google.cloud.alloydb.v1beta.DatabaseVersion.DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, databaseVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, etag_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, annotations__); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, reconciling_); + } + if (initialUser_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getInitialUser()); + } + if (sourceCase_ == 15) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 15, (com.google.cloud.alloydb.v1beta.BackupSource) source_); + } + if (sourceCase_ == 16) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 16, (com.google.cloud.alloydb.v1beta.MigrationSource) source_); + } + if (automatedBackupPolicy_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(17, getAutomatedBackupPolicy()); + } + if (sslConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getSslConfig()); + } + if (encryptionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getEncryptionConfig()); + } + if (encryptionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getEncryptionInfo()); + } + if (secondaryConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, getSecondaryConfig()); + } + if (primaryConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, getPrimaryConfig()); + } + if (clusterType_ + != com.google.cloud.alloydb.v1beta.Cluster.ClusterType.CLUSTER_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(24, clusterType_); + } + if (continuousBackupConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(27, getContinuousBackupConfig()); + } + if (continuousBackupInfo_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(28, getContinuousBackupInfo()); + } + 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.alloydb.v1beta.Cluster)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.Cluster other = (com.google.cloud.alloydb.v1beta.Cluster) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (state_ != other.state_) return false; + if (clusterType_ != other.clusterType_) return false; + if (databaseVersion_ != other.databaseVersion_) return false; + if (!getNetwork().equals(other.getNetwork())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (getReconciling() != other.getReconciling()) return false; + if (hasInitialUser() != other.hasInitialUser()) return false; + if (hasInitialUser()) { + if (!getInitialUser().equals(other.getInitialUser())) return false; + } + if (hasAutomatedBackupPolicy() != other.hasAutomatedBackupPolicy()) return false; + if (hasAutomatedBackupPolicy()) { + if (!getAutomatedBackupPolicy().equals(other.getAutomatedBackupPolicy())) return false; + } + if (hasSslConfig() != other.hasSslConfig()) return false; + if (hasSslConfig()) { + if (!getSslConfig().equals(other.getSslConfig())) return false; + } + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) return false; + } + if (hasEncryptionInfo() != other.hasEncryptionInfo()) return false; + if (hasEncryptionInfo()) { + if (!getEncryptionInfo().equals(other.getEncryptionInfo())) return false; + } + if (hasContinuousBackupConfig() != other.hasContinuousBackupConfig()) return false; + if (hasContinuousBackupConfig()) { + if (!getContinuousBackupConfig().equals(other.getContinuousBackupConfig())) return false; + } + if (hasContinuousBackupInfo() != other.hasContinuousBackupInfo()) return false; + if (hasContinuousBackupInfo()) { + if (!getContinuousBackupInfo().equals(other.getContinuousBackupInfo())) return false; + } + if (hasSecondaryConfig() != other.hasSecondaryConfig()) return false; + if (hasSecondaryConfig()) { + if (!getSecondaryConfig().equals(other.getSecondaryConfig())) return false; + } + if (hasPrimaryConfig() != other.hasPrimaryConfig()) return false; + if (hasPrimaryConfig()) { + if (!getPrimaryConfig().equals(other.getPrimaryConfig())) return false; + } + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 15: + if (!getBackupSource().equals(other.getBackupSource())) return false; + break; + case 16: + if (!getMigrationSource().equals(other.getMigrationSource())) 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) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + CLUSTER_TYPE_FIELD_NUMBER; + hash = (53 * hash) + clusterType_; + hash = (37 * hash) + DATABASE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + databaseVersion_; + hash = (37 * hash) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + if (hasInitialUser()) { + hash = (37 * hash) + INITIAL_USER_FIELD_NUMBER; + hash = (53 * hash) + getInitialUser().hashCode(); + } + if (hasAutomatedBackupPolicy()) { + hash = (37 * hash) + AUTOMATED_BACKUP_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getAutomatedBackupPolicy().hashCode(); + } + if (hasSslConfig()) { + hash = (37 * hash) + SSL_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSslConfig().hashCode(); + } + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } + if (hasEncryptionInfo()) { + hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionInfo().hashCode(); + } + if (hasContinuousBackupConfig()) { + hash = (37 * hash) + CONTINUOUS_BACKUP_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getContinuousBackupConfig().hashCode(); + } + if (hasContinuousBackupInfo()) { + hash = (37 * hash) + CONTINUOUS_BACKUP_INFO_FIELD_NUMBER; + hash = (53 * hash) + getContinuousBackupInfo().hashCode(); + } + if (hasSecondaryConfig()) { + hash = (37 * hash) + SECONDARY_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSecondaryConfig().hashCode(); + } + if (hasPrimaryConfig()) { + hash = (37 * hash) + PRIMARY_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryConfig().hashCode(); + } + switch (sourceCase_) { + case 15: + hash = (37 * hash) + BACKUP_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getBackupSource().hashCode(); + break; + case 16: + hash = (37 * hash) + MIGRATION_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getMigrationSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.Cluster parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Cluster 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.alloydb.v1beta.Cluster parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Cluster 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.alloydb.v1beta.Cluster parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Cluster parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Cluster parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Cluster 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.alloydb.v1beta.Cluster parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Cluster 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.alloydb.v1beta.Cluster parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Cluster 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.alloydb.v1beta.Cluster 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 cluster is a collection of regional AlloyDB resources. It can include a
+   * primary instance and one or more read pool instances.
+   * All cluster resources share a storage layer, which scales as needed.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Cluster} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.Cluster) + com.google.cloud.alloydb.v1beta.ClusterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + case 12: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableLabels(); + case 12: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Cluster.class, + com.google.cloud.alloydb.v1beta.Cluster.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.Cluster.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (backupSourceBuilder_ != null) { + backupSourceBuilder_.clear(); + } + if (migrationSourceBuilder_ != null) { + migrationSourceBuilder_.clear(); + } + name_ = ""; + displayName_ = ""; + uid_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + state_ = 0; + clusterType_ = 0; + databaseVersion_ = 0; + network_ = ""; + etag_ = ""; + internalGetMutableAnnotations().clear(); + reconciling_ = false; + initialUser_ = null; + if (initialUserBuilder_ != null) { + initialUserBuilder_.dispose(); + initialUserBuilder_ = null; + } + automatedBackupPolicy_ = null; + if (automatedBackupPolicyBuilder_ != null) { + automatedBackupPolicyBuilder_.dispose(); + automatedBackupPolicyBuilder_ = null; + } + sslConfig_ = null; + if (sslConfigBuilder_ != null) { + sslConfigBuilder_.dispose(); + sslConfigBuilder_ = null; + } + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + continuousBackupConfig_ = null; + if (continuousBackupConfigBuilder_ != null) { + continuousBackupConfigBuilder_.dispose(); + continuousBackupConfigBuilder_ = null; + } + continuousBackupInfo_ = null; + if (continuousBackupInfoBuilder_ != null) { + continuousBackupInfoBuilder_.dispose(); + continuousBackupInfoBuilder_ = null; + } + secondaryConfig_ = null; + if (secondaryConfigBuilder_ != null) { + secondaryConfigBuilder_.dispose(); + secondaryConfigBuilder_ = null; + } + primaryConfig_ = null; + if (primaryConfigBuilder_ != null) { + primaryConfigBuilder_.dispose(); + primaryConfigBuilder_ = null; + } + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster build() { + com.google.cloud.alloydb.v1beta.Cluster result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster buildPartial() { + com.google.cloud.alloydb.v1beta.Cluster result = + new com.google.cloud.alloydb.v1beta.Cluster(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.Cluster result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.clusterType_ = clusterType_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.databaseVersion_ = databaseVersion_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.network_ = network_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.initialUser_ = + initialUserBuilder_ == null ? initialUser_ : initialUserBuilder_.build(); + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.automatedBackupPolicy_ = + automatedBackupPolicyBuilder_ == null + ? automatedBackupPolicy_ + : automatedBackupPolicyBuilder_.build(); + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.sslConfig_ = sslConfigBuilder_ == null ? sslConfig_ : sslConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.encryptionConfig_ = + encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.encryptionInfo_ = + encryptionInfoBuilder_ == null ? encryptionInfo_ : encryptionInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.continuousBackupConfig_ = + continuousBackupConfigBuilder_ == null + ? continuousBackupConfig_ + : continuousBackupConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.continuousBackupInfo_ = + continuousBackupInfoBuilder_ == null + ? continuousBackupInfo_ + : continuousBackupInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.secondaryConfig_ = + secondaryConfigBuilder_ == null ? secondaryConfig_ : secondaryConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.primaryConfig_ = + primaryConfigBuilder_ == null ? primaryConfig_ : primaryConfigBuilder_.build(); + } + } + + private void buildPartialOneofs(com.google.cloud.alloydb.v1beta.Cluster result) { + result.sourceCase_ = sourceCase_; + result.source_ = this.source_; + if (sourceCase_ == 15 && backupSourceBuilder_ != null) { + result.source_ = backupSourceBuilder_.build(); + } + if (sourceCase_ == 16 && migrationSourceBuilder_ != null) { + result.source_ = migrationSourceBuilder_.build(); + } + } + + @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.alloydb.v1beta.Cluster) { + return mergeFrom((com.google.cloud.alloydb.v1beta.Cluster) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.Cluster other) { + if (other == com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000100; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.clusterType_ != 0) { + setClusterTypeValue(other.getClusterTypeValue()); + } + if (other.databaseVersion_ != 0) { + setDatabaseVersionValue(other.getDatabaseVersionValue()); + } + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + bitField0_ |= 0x00001000; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00002000; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00004000; + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + if (other.hasInitialUser()) { + mergeInitialUser(other.getInitialUser()); + } + if (other.hasAutomatedBackupPolicy()) { + mergeAutomatedBackupPolicy(other.getAutomatedBackupPolicy()); + } + if (other.hasSslConfig()) { + mergeSslConfig(other.getSslConfig()); + } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } + if (other.hasEncryptionInfo()) { + mergeEncryptionInfo(other.getEncryptionInfo()); + } + if (other.hasContinuousBackupConfig()) { + mergeContinuousBackupConfig(other.getContinuousBackupConfig()); + } + if (other.hasContinuousBackupInfo()) { + mergeContinuousBackupInfo(other.getContinuousBackupInfo()); + } + if (other.hasSecondaryConfig()) { + mergeSecondaryConfig(other.getSecondaryConfig()); + } + if (other.hasPrimaryConfig()) { + mergePrimaryConfig(other.getPrimaryConfig()); + } + switch (other.getSourceCase()) { + case BACKUP_SOURCE: + { + mergeBackupSource(other.getBackupSource()); + break; + } + case MIGRATION_SOURCE: + { + mergeMigrationSource(other.getMigrationSource()); + break; + } + case SOURCE_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(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 26: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 26 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 42 + case 50: + { + input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 50 + case 58: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000100; + break; + } // case 58 + case 64: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 64 + case 72: + { + databaseVersion_ = input.readEnum(); + bitField0_ |= 0x00000800; + break; + } // case 72 + case 82: + { + network_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 82 + case 90: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00002000; + break; + } // case 90 + case 98: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00004000; + break; + } // case 98 + case 104: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00008000; + break; + } // case 104 + case 114: + { + input.readMessage(getInitialUserFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 114 + case 122: + { + input.readMessage(getBackupSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 15; + break; + } // case 122 + case 130: + { + input.readMessage(getMigrationSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 16; + break; + } // case 130 + case 138: + { + input.readMessage( + getAutomatedBackupPolicyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 138 + case 146: + { + input.readMessage(getSslConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 146 + case 154: + { + input.readMessage( + getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 154 + case 162: + { + input.readMessage(getEncryptionInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00100000; + break; + } // case 162 + case 178: + { + input.readMessage(getSecondaryConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00800000; + break; + } // case 178 + case 186: + { + input.readMessage(getPrimaryConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x01000000; + break; + } // case 186 + case 192: + { + clusterType_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 192 + case 218: + { + input.readMessage( + getContinuousBackupConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00200000; + break; + } // case 218 + case 226: + { + input.readMessage( + getContinuousBackupInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00400000; + break; + } // case 226 + 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 sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.BackupSource, + com.google.cloud.alloydb.v1beta.BackupSource.Builder, + com.google.cloud.alloydb.v1beta.BackupSourceOrBuilder> + backupSourceBuilder_; + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupSource field is set. + */ + @java.lang.Override + public boolean hasBackupSource() { + return sourceCase_ == 15; + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BackupSource getBackupSource() { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 15) { + return (com.google.cloud.alloydb.v1beta.BackupSource) source_; + } + return com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance(); + } else { + if (sourceCase_ == 15) { + return backupSourceBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBackupSource(com.google.cloud.alloydb.v1beta.BackupSource value) { + if (backupSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + backupSourceBuilder_.setMessage(value); + } + sourceCase_ = 15; + return this; + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBackupSource( + com.google.cloud.alloydb.v1beta.BackupSource.Builder builderForValue) { + if (backupSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + backupSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 15; + return this; + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeBackupSource(com.google.cloud.alloydb.v1beta.BackupSource value) { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 15 + && source_ != com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance()) { + source_ = + com.google.cloud.alloydb.v1beta.BackupSource.newBuilder( + (com.google.cloud.alloydb.v1beta.BackupSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 15) { + backupSourceBuilder_.mergeFrom(value); + } else { + backupSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 15; + return this; + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearBackupSource() { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 15) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 15) { + sourceCase_ = 0; + source_ = null; + } + backupSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.BackupSource.Builder getBackupSourceBuilder() { + return getBackupSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BackupSourceOrBuilder getBackupSourceOrBuilder() { + if ((sourceCase_ == 15) && (backupSourceBuilder_ != null)) { + return backupSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 15) { + return (com.google.cloud.alloydb.v1beta.BackupSource) source_; + } + return com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Cluster created from backup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.BackupSource, + com.google.cloud.alloydb.v1beta.BackupSource.Builder, + com.google.cloud.alloydb.v1beta.BackupSourceOrBuilder> + getBackupSourceFieldBuilder() { + if (backupSourceBuilder_ == null) { + if (!(sourceCase_ == 15)) { + source_ = com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance(); + } + backupSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.BackupSource, + com.google.cloud.alloydb.v1beta.BackupSource.Builder, + com.google.cloud.alloydb.v1beta.BackupSourceOrBuilder>( + (com.google.cloud.alloydb.v1beta.BackupSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 15; + onChanged(); + return backupSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.MigrationSource, + com.google.cloud.alloydb.v1beta.MigrationSource.Builder, + com.google.cloud.alloydb.v1beta.MigrationSourceOrBuilder> + migrationSourceBuilder_; + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the migrationSource field is set. + */ + @java.lang.Override + public boolean hasMigrationSource() { + return sourceCase_ == 16; + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The migrationSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.MigrationSource getMigrationSource() { + if (migrationSourceBuilder_ == null) { + if (sourceCase_ == 16) { + return (com.google.cloud.alloydb.v1beta.MigrationSource) source_; + } + return com.google.cloud.alloydb.v1beta.MigrationSource.getDefaultInstance(); + } else { + if (sourceCase_ == 16) { + return migrationSourceBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1beta.MigrationSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMigrationSource(com.google.cloud.alloydb.v1beta.MigrationSource value) { + if (migrationSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + migrationSourceBuilder_.setMessage(value); + } + sourceCase_ = 16; + return this; + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMigrationSource( + com.google.cloud.alloydb.v1beta.MigrationSource.Builder builderForValue) { + if (migrationSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + migrationSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 16; + return this; + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeMigrationSource(com.google.cloud.alloydb.v1beta.MigrationSource value) { + if (migrationSourceBuilder_ == null) { + if (sourceCase_ == 16 + && source_ != com.google.cloud.alloydb.v1beta.MigrationSource.getDefaultInstance()) { + source_ = + com.google.cloud.alloydb.v1beta.MigrationSource.newBuilder( + (com.google.cloud.alloydb.v1beta.MigrationSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 16) { + migrationSourceBuilder_.mergeFrom(value); + } else { + migrationSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 16; + return this; + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMigrationSource() { + if (migrationSourceBuilder_ == null) { + if (sourceCase_ == 16) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 16) { + sourceCase_ = 0; + source_ = null; + } + migrationSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.MigrationSource.Builder getMigrationSourceBuilder() { + return getMigrationSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.MigrationSourceOrBuilder getMigrationSourceOrBuilder() { + if ((sourceCase_ == 16) && (migrationSourceBuilder_ != null)) { + return migrationSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 16) { + return (com.google.cloud.alloydb.v1beta.MigrationSource) source_; + } + return com.google.cloud.alloydb.v1beta.MigrationSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Cluster created via DMS migration.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.MigrationSource, + com.google.cloud.alloydb.v1beta.MigrationSource.Builder, + com.google.cloud.alloydb.v1beta.MigrationSourceOrBuilder> + getMigrationSourceFieldBuilder() { + if (migrationSourceBuilder_ == null) { + if (!(sourceCase_ == 16)) { + source_ = com.google.cloud.alloydb.v1beta.MigrationSource.getDefaultInstance(); + } + migrationSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.MigrationSource, + com.google.cloud.alloydb.v1beta.MigrationSource.Builder, + com.google.cloud.alloydb.v1beta.MigrationSourceOrBuilder>( + (com.google.cloud.alloydb.v1beta.MigrationSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 16; + onChanged(); + return migrationSourceBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The name of the cluster resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * where the cluster ID segment should satisfy the regex expression
+     * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+     * The prefix of the cluster resource name is the name of the parent resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the cluster resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * where the cluster ID segment should satisfy the regex expression
+     * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+     * The prefix of the cluster resource name is the name of the parent resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the cluster resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * where the cluster ID segment should satisfy the regex expression
+     * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+     * The prefix of the cluster resource name is the name of the parent resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the cluster resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * where the cluster ID segment should satisfy the regex expression
+     * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+     * The prefix of the cluster resource name is the name of the parent resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the cluster resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * where the cluster ID segment should satisfy the regex expression
+     * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+     * The prefix of the cluster resource name is the name of the parent resource:
+     *  * projects/{project}/locations/{region}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * User-settable and human-readable display name for the Cluster.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Cluster.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Cluster.
+     * 
+ * + * 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Cluster.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Cluster.
+     * 
+ * + * 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + 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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000020); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000040); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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 deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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; + } else { + deleteTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); + } else { + deleteTime_ = value; + } + } else { + deleteTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + bitField0_ = (bitField0_ & ~0x00000080); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_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> + 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_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000100; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000100); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000100; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000100; + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000100; + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current serving state of the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current serving state of the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current serving state of the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.State getState() { + com.google.cloud.alloydb.v1beta.Cluster.State result = + com.google.cloud.alloydb.v1beta.Cluster.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1beta.Cluster.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current serving state of the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.alloydb.v1beta.Cluster.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current serving state of the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000200); + state_ = 0; + onChanged(); + return this; + } + + private int clusterType_ = 0; + /** + * + * + *
+     * Output only. The type of the cluster. This is an output-only field and it's
+     * populated at the Cluster creation time or the Cluster promotion
+     * time. The cluster type is determined by which RPC was used to create
+     * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for clusterType. + */ + @java.lang.Override + public int getClusterTypeValue() { + return clusterType_; + } + /** + * + * + *
+     * Output only. The type of the cluster. This is an output-only field and it's
+     * populated at the Cluster creation time or the Cluster promotion
+     * time. The cluster type is determined by which RPC was used to create
+     * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for clusterType to set. + * @return This builder for chaining. + */ + public Builder setClusterTypeValue(int value) { + clusterType_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of the cluster. This is an output-only field and it's
+     * populated at the Cluster creation time or the Cluster promotion
+     * time. The cluster type is determined by which RPC was used to create
+     * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The clusterType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.ClusterType getClusterType() { + com.google.cloud.alloydb.v1beta.Cluster.ClusterType result = + com.google.cloud.alloydb.v1beta.Cluster.ClusterType.forNumber(clusterType_); + return result == null + ? com.google.cloud.alloydb.v1beta.Cluster.ClusterType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The type of the cluster. This is an output-only field and it's
+     * populated at the Cluster creation time or the Cluster promotion
+     * time. The cluster type is determined by which RPC was used to create
+     * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The clusterType to set. + * @return This builder for chaining. + */ + public Builder setClusterType(com.google.cloud.alloydb.v1beta.Cluster.ClusterType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + clusterType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of the cluster. This is an output-only field and it's
+     * populated at the Cluster creation time or the Cluster promotion
+     * time. The cluster type is determined by which RPC was used to create
+     * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearClusterType() { + bitField0_ = (bitField0_ & ~0x00000400); + clusterType_ = 0; + onChanged(); + return this; + } + + private int databaseVersion_ = 0; + /** + * + * + *
+     * Output only. The database engine major version. This is an output-only
+     * field and it's populated at the Cluster creation time. This field cannot be
+     * changed after cluster creation.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + /** + * + * + *
+     * Output only. The database engine major version. This is an output-only
+     * field and it's populated at the Cluster creation time. This field cannot be
+     * changed after cluster creation.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersionValue(int value) { + databaseVersion_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The database engine major version. This is an output-only
+     * field and it's populated at the Cluster creation time. This field cannot be
+     * changed after cluster creation.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DatabaseVersion getDatabaseVersion() { + com.google.cloud.alloydb.v1beta.DatabaseVersion result = + com.google.cloud.alloydb.v1beta.DatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.alloydb.v1beta.DatabaseVersion.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The database engine major version. This is an output-only
+     * field and it's populated at the Cluster creation time. This field cannot be
+     * changed after cluster creation.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersion(com.google.cloud.alloydb.v1beta.DatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000800; + databaseVersion_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The database engine major version. This is an output-only
+     * field and it's populated at the Cluster creation time. This field cannot be
+     * changed after cluster creation.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDatabaseVersion() { + bitField0_ = (bitField0_ & ~0x00000800); + databaseVersion_ = 0; + onChanged(); + return this; + } + + private java.lang.Object network_ = ""; + /** + * + * + *
+     * Required. The resource link for the VPC network in which cluster resources
+     * are created and from which they are accessible via Private IP. The network
+     * must belong to the same project as the cluster. It is specified in the
+     * form: "projects/{project_number}/global/networks/{network_id}". This is
+     * required to create a cluster. It can be updated, but it cannot be removed.
+     * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource link for the VPC network in which cluster resources
+     * are created and from which they are accessible via Private IP. The network
+     * must belong to the same project as the cluster. It is specified in the
+     * form: "projects/{project_number}/global/networks/{network_id}". This is
+     * required to create a cluster. It can be updated, but it cannot be removed.
+     * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource link for the VPC network in which cluster resources
+     * are created and from which they are accessible via Private IP. The network
+     * must belong to the same project as the cluster. It is specified in the
+     * form: "projects/{project_number}/global/networks/{network_id}". This is
+     * required to create a cluster. It can be updated, but it cannot be removed.
+     * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + network_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource link for the VPC network in which cluster resources
+     * are created and from which they are accessible via Private IP. The network
+     * must belong to the same project as the cluster. It is specified in the
+     * form: "projects/{project_number}/global/networks/{network_id}". This is
+     * required to create a cluster. It can be updated, but it cannot be removed.
+     * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource link for the VPC network in which cluster resources
+     * are created and from which they are accessible via Private IP. The network
+     * must belong to the same project as the cluster. It is specified in the
+     * form: "projects/{project_number}/global/networks/{network_id}". This is
+     * required to create a cluster. It can be updated, but it cannot be removed.
+     * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + network_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 11; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 11; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 11; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 11; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 11; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00004000; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00004000); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00004000; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00004000; + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 12; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00004000; + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Cluster does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Cluster does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Cluster does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00008000); + reconciling_ = false; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1beta.UserPassword initialUser_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.UserPassword, + com.google.cloud.alloydb.v1beta.UserPassword.Builder, + com.google.cloud.alloydb.v1beta.UserPasswordOrBuilder> + initialUserBuilder_; + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the initialUser field is set. + */ + public boolean hasInitialUser() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The initialUser. + */ + public com.google.cloud.alloydb.v1beta.UserPassword getInitialUser() { + if (initialUserBuilder_ == null) { + return initialUser_ == null + ? com.google.cloud.alloydb.v1beta.UserPassword.getDefaultInstance() + : initialUser_; + } else { + return initialUserBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setInitialUser(com.google.cloud.alloydb.v1beta.UserPassword value) { + if (initialUserBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + initialUser_ = value; + } else { + initialUserBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setInitialUser( + com.google.cloud.alloydb.v1beta.UserPassword.Builder builderForValue) { + if (initialUserBuilder_ == null) { + initialUser_ = builderForValue.build(); + } else { + initialUserBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder mergeInitialUser(com.google.cloud.alloydb.v1beta.UserPassword value) { + if (initialUserBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && initialUser_ != null + && initialUser_ != com.google.cloud.alloydb.v1beta.UserPassword.getDefaultInstance()) { + getInitialUserBuilder().mergeFrom(value); + } else { + initialUser_ = value; + } + } else { + initialUserBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder clearInitialUser() { + bitField0_ = (bitField0_ & ~0x00010000); + initialUser_ = null; + if (initialUserBuilder_ != null) { + initialUserBuilder_.dispose(); + initialUserBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.UserPassword.Builder getInitialUserBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return getInitialUserFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.UserPasswordOrBuilder getInitialUserOrBuilder() { + if (initialUserBuilder_ != null) { + return initialUserBuilder_.getMessageOrBuilder(); + } else { + return initialUser_ == null + ? com.google.cloud.alloydb.v1beta.UserPassword.getDefaultInstance() + : initialUser_; + } + } + /** + * + * + *
+     * Input only. Initial user to setup during cluster creation. Required.
+     * If used in `RestoreCluster` this is ignored.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.UserPassword, + com.google.cloud.alloydb.v1beta.UserPassword.Builder, + com.google.cloud.alloydb.v1beta.UserPasswordOrBuilder> + getInitialUserFieldBuilder() { + if (initialUserBuilder_ == null) { + initialUserBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.UserPassword, + com.google.cloud.alloydb.v1beta.UserPassword.Builder, + com.google.cloud.alloydb.v1beta.UserPasswordOrBuilder>( + getInitialUser(), getParentForChildren(), isClean()); + initialUser_ = null; + } + return initialUserBuilder_; + } + + private com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy automatedBackupPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.Builder, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicyOrBuilder> + automatedBackupPolicyBuilder_; + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return Whether the automatedBackupPolicy field is set. + */ + public boolean hasAutomatedBackupPolicy() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return The automatedBackupPolicy. + */ + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy getAutomatedBackupPolicy() { + if (automatedBackupPolicyBuilder_ == null) { + return automatedBackupPolicy_ == null + ? com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.getDefaultInstance() + : automatedBackupPolicy_; + } else { + return automatedBackupPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + */ + public Builder setAutomatedBackupPolicy( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy value) { + if (automatedBackupPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + automatedBackupPolicy_ = value; + } else { + automatedBackupPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + */ + public Builder setAutomatedBackupPolicy( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.Builder builderForValue) { + if (automatedBackupPolicyBuilder_ == null) { + automatedBackupPolicy_ = builderForValue.build(); + } else { + automatedBackupPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + */ + public Builder mergeAutomatedBackupPolicy( + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy value) { + if (automatedBackupPolicyBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) + && automatedBackupPolicy_ != null + && automatedBackupPolicy_ + != com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.getDefaultInstance()) { + getAutomatedBackupPolicyBuilder().mergeFrom(value); + } else { + automatedBackupPolicy_ = value; + } + } else { + automatedBackupPolicyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + */ + public Builder clearAutomatedBackupPolicy() { + bitField0_ = (bitField0_ & ~0x00020000); + automatedBackupPolicy_ = null; + if (automatedBackupPolicyBuilder_ != null) { + automatedBackupPolicyBuilder_.dispose(); + automatedBackupPolicyBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + */ + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.Builder + getAutomatedBackupPolicyBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return getAutomatedBackupPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + */ + public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicyOrBuilder + getAutomatedBackupPolicyOrBuilder() { + if (automatedBackupPolicyBuilder_ != null) { + return automatedBackupPolicyBuilder_.getMessageOrBuilder(); + } else { + return automatedBackupPolicy_ == null + ? com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.getDefaultInstance() + : automatedBackupPolicy_; + } + } + /** + * + * + *
+     * The automated backup policy for this cluster.
+     * If no policy is provided then the default policy will be used. If backups
+     * are supported for the cluster, the default policy takes one backup a day,
+     * has a backup window of 1 hour, and retains backups for 14 days.
+     * For more information on the defaults, consult the
+     * documentation for the message type.
+     * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.Builder, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicyOrBuilder> + getAutomatedBackupPolicyFieldBuilder() { + if (automatedBackupPolicyBuilder_ == null) { + automatedBackupPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.Builder, + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicyOrBuilder>( + getAutomatedBackupPolicy(), getParentForChildren(), isClean()); + automatedBackupPolicy_ = null; + } + return automatedBackupPolicyBuilder_; + } + + private com.google.cloud.alloydb.v1beta.SslConfig sslConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.SslConfig, + com.google.cloud.alloydb.v1beta.SslConfig.Builder, + com.google.cloud.alloydb.v1beta.SslConfigOrBuilder> + sslConfigBuilder_; + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * + * @return Whether the sslConfig field is set. + */ + public boolean hasSslConfig() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * + * @return The sslConfig. + */ + public com.google.cloud.alloydb.v1beta.SslConfig getSslConfig() { + if (sslConfigBuilder_ == null) { + return sslConfig_ == null + ? com.google.cloud.alloydb.v1beta.SslConfig.getDefaultInstance() + : sslConfig_; + } else { + return sslConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + */ + public Builder setSslConfig(com.google.cloud.alloydb.v1beta.SslConfig value) { + if (sslConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sslConfig_ = value; + } else { + sslConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + */ + public Builder setSslConfig(com.google.cloud.alloydb.v1beta.SslConfig.Builder builderForValue) { + if (sslConfigBuilder_ == null) { + sslConfig_ = builderForValue.build(); + } else { + sslConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + */ + public Builder mergeSslConfig(com.google.cloud.alloydb.v1beta.SslConfig value) { + if (sslConfigBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) + && sslConfig_ != null + && sslConfig_ != com.google.cloud.alloydb.v1beta.SslConfig.getDefaultInstance()) { + getSslConfigBuilder().mergeFrom(value); + } else { + sslConfig_ = value; + } + } else { + sslConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + */ + public Builder clearSslConfig() { + bitField0_ = (bitField0_ & ~0x00040000); + sslConfig_ = null; + if (sslConfigBuilder_ != null) { + sslConfigBuilder_.dispose(); + sslConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + */ + public com.google.cloud.alloydb.v1beta.SslConfig.Builder getSslConfigBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return getSslConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + */ + public com.google.cloud.alloydb.v1beta.SslConfigOrBuilder getSslConfigOrBuilder() { + if (sslConfigBuilder_ != null) { + return sslConfigBuilder_.getMessageOrBuilder(); + } else { + return sslConfig_ == null + ? com.google.cloud.alloydb.v1beta.SslConfig.getDefaultInstance() + : sslConfig_; + } + } + /** + * + * + *
+     * SSL configuration for this AlloyDB Cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.SslConfig, + com.google.cloud.alloydb.v1beta.SslConfig.Builder, + com.google.cloud.alloydb.v1beta.SslConfigOrBuilder> + getSslConfigFieldBuilder() { + if (sslConfigBuilder_ == null) { + sslConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.SslConfig, + com.google.cloud.alloydb.v1beta.SslConfig.Builder, + com.google.cloud.alloydb.v1beta.SslConfigOrBuilder>( + getSslConfig(), getParentForChildren(), isClean()); + sslConfig_ = null; + } + return sslConfigBuilder_; + } + + private com.google.cloud.alloydb.v1beta.EncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionConfig, + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder> + encryptionConfigBuilder_; + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00080000) != 0); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + public com.google.cloud.alloydb.v1beta.EncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig(com.google.cloud.alloydb.v1beta.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + } else { + encryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig( + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1beta.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); + } else { + encryptionConfig_ = value; + } + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEncryptionConfig() { + bitField0_ = (bitField0_ & ~0x00080000); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder getEncryptionConfigBuilder() { + bitField0_ |= 0x00080000; + onChanged(); + return getEncryptionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + /** + * + * + *
+     * Optional. The encryption config can be specified to encrypt the data disks
+     * and other persistent data resources of a cluster with a
+     * customer-managed encryption key (CMEK). When this field is not
+     * specified, the cluster will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionConfig, + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder> + getEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionConfig, + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + + private com.google.cloud.alloydb.v1beta.EncryptionInfo encryptionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionInfo, + com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder> + encryptionInfoBuilder_; + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + public boolean hasEncryptionInfo() { + return ((bitField0_ & 0x00100000) != 0); + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + public com.google.cloud.alloydb.v1beta.EncryptionInfo getEncryptionInfo() { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } else { + return encryptionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo(com.google.cloud.alloydb.v1beta.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionInfo_ = value; + } else { + encryptionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo( + com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = builderForValue.build(); + } else { + encryptionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEncryptionInfo(com.google.cloud.alloydb.v1beta.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (((bitField0_ & 0x00100000) != 0) + && encryptionInfo_ != null + && encryptionInfo_ + != com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance()) { + getEncryptionInfoBuilder().mergeFrom(value); + } else { + encryptionInfo_ = value; + } + } else { + encryptionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEncryptionInfo() { + bitField0_ = (bitField0_ & ~0x00100000); + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder getEncryptionInfoBuilder() { + bitField0_ |= 0x00100000; + onChanged(); + return getEncryptionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + if (encryptionInfoBuilder_ != null) { + return encryptionInfoBuilder_.getMessageOrBuilder(); + } else { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + } + /** + * + * + *
+     * Output only. The encryption information for the cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionInfo, + com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder> + getEncryptionInfoFieldBuilder() { + if (encryptionInfoBuilder_ == null) { + encryptionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionInfo, + com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder>( + getEncryptionInfo(), getParentForChildren(), isClean()); + encryptionInfo_ = null; + } + return encryptionInfoBuilder_; + } + + private com.google.cloud.alloydb.v1beta.ContinuousBackupConfig continuousBackupConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig, + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.Builder, + com.google.cloud.alloydb.v1beta.ContinuousBackupConfigOrBuilder> + continuousBackupConfigBuilder_; + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the continuousBackupConfig field is set. + */ + public boolean hasContinuousBackupConfig() { + return ((bitField0_ & 0x00200000) != 0); + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The continuousBackupConfig. + */ + public com.google.cloud.alloydb.v1beta.ContinuousBackupConfig getContinuousBackupConfig() { + if (continuousBackupConfigBuilder_ == null) { + return continuousBackupConfig_ == null + ? com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.getDefaultInstance() + : continuousBackupConfig_; + } else { + return continuousBackupConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setContinuousBackupConfig( + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig value) { + if (continuousBackupConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + continuousBackupConfig_ = value; + } else { + continuousBackupConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setContinuousBackupConfig( + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.Builder builderForValue) { + if (continuousBackupConfigBuilder_ == null) { + continuousBackupConfig_ = builderForValue.build(); + } else { + continuousBackupConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeContinuousBackupConfig( + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig value) { + if (continuousBackupConfigBuilder_ == null) { + if (((bitField0_ & 0x00200000) != 0) + && continuousBackupConfig_ != null + && continuousBackupConfig_ + != com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.getDefaultInstance()) { + getContinuousBackupConfigBuilder().mergeFrom(value); + } else { + continuousBackupConfig_ = value; + } + } else { + continuousBackupConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearContinuousBackupConfig() { + bitField0_ = (bitField0_ & ~0x00200000); + continuousBackupConfig_ = null; + if (continuousBackupConfigBuilder_ != null) { + continuousBackupConfigBuilder_.dispose(); + continuousBackupConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.Builder + getContinuousBackupConfigBuilder() { + bitField0_ |= 0x00200000; + onChanged(); + return getContinuousBackupConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1beta.ContinuousBackupConfigOrBuilder + getContinuousBackupConfigOrBuilder() { + if (continuousBackupConfigBuilder_ != null) { + return continuousBackupConfigBuilder_.getMessageOrBuilder(); + } else { + return continuousBackupConfig_ == null + ? com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.getDefaultInstance() + : continuousBackupConfig_; + } + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig, + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.Builder, + com.google.cloud.alloydb.v1beta.ContinuousBackupConfigOrBuilder> + getContinuousBackupConfigFieldBuilder() { + if (continuousBackupConfigBuilder_ == null) { + continuousBackupConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig, + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.Builder, + com.google.cloud.alloydb.v1beta.ContinuousBackupConfigOrBuilder>( + getContinuousBackupConfig(), getParentForChildren(), isClean()); + continuousBackupConfig_ = null; + } + return continuousBackupConfigBuilder_; + } + + private com.google.cloud.alloydb.v1beta.ContinuousBackupInfo continuousBackupInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo, + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.Builder, + com.google.cloud.alloydb.v1beta.ContinuousBackupInfoOrBuilder> + continuousBackupInfoBuilder_; + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the continuousBackupInfo field is set. + */ + public boolean hasContinuousBackupInfo() { + return ((bitField0_ & 0x00400000) != 0); + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The continuousBackupInfo. + */ + public com.google.cloud.alloydb.v1beta.ContinuousBackupInfo getContinuousBackupInfo() { + if (continuousBackupInfoBuilder_ == null) { + return continuousBackupInfo_ == null + ? com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.getDefaultInstance() + : continuousBackupInfo_; + } else { + return continuousBackupInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setContinuousBackupInfo( + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo value) { + if (continuousBackupInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + continuousBackupInfo_ = value; + } else { + continuousBackupInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setContinuousBackupInfo( + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.Builder builderForValue) { + if (continuousBackupInfoBuilder_ == null) { + continuousBackupInfo_ = builderForValue.build(); + } else { + continuousBackupInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeContinuousBackupInfo( + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo value) { + if (continuousBackupInfoBuilder_ == null) { + if (((bitField0_ & 0x00400000) != 0) + && continuousBackupInfo_ != null + && continuousBackupInfo_ + != com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.getDefaultInstance()) { + getContinuousBackupInfoBuilder().mergeFrom(value); + } else { + continuousBackupInfo_ = value; + } + } else { + continuousBackupInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearContinuousBackupInfo() { + bitField0_ = (bitField0_ & ~0x00400000); + continuousBackupInfo_ = null; + if (continuousBackupInfoBuilder_ != null) { + continuousBackupInfoBuilder_.dispose(); + continuousBackupInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.Builder + getContinuousBackupInfoBuilder() { + bitField0_ |= 0x00400000; + onChanged(); + return getContinuousBackupInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.ContinuousBackupInfoOrBuilder + getContinuousBackupInfoOrBuilder() { + if (continuousBackupInfoBuilder_ != null) { + return continuousBackupInfoBuilder_.getMessageOrBuilder(); + } else { + return continuousBackupInfo_ == null + ? com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.getDefaultInstance() + : continuousBackupInfo_; + } + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo, + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.Builder, + com.google.cloud.alloydb.v1beta.ContinuousBackupInfoOrBuilder> + getContinuousBackupInfoFieldBuilder() { + if (continuousBackupInfoBuilder_ == null) { + continuousBackupInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo, + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.Builder, + com.google.cloud.alloydb.v1beta.ContinuousBackupInfoOrBuilder>( + getContinuousBackupInfo(), getParentForChildren(), isClean()); + continuousBackupInfo_ = null; + } + return continuousBackupInfoBuilder_; + } + + private com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondaryConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig, + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.Builder, + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfigOrBuilder> + secondaryConfigBuilder_; + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + * + * @return Whether the secondaryConfig field is set. + */ + public boolean hasSecondaryConfig() { + return ((bitField0_ & 0x00800000) != 0); + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + * + * @return The secondaryConfig. + */ + public com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig getSecondaryConfig() { + if (secondaryConfigBuilder_ == null) { + return secondaryConfig_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.getDefaultInstance() + : secondaryConfig_; + } else { + return secondaryConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + */ + public Builder setSecondaryConfig( + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig value) { + if (secondaryConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + secondaryConfig_ = value; + } else { + secondaryConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + */ + public Builder setSecondaryConfig( + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.Builder builderForValue) { + if (secondaryConfigBuilder_ == null) { + secondaryConfig_ = builderForValue.build(); + } else { + secondaryConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + */ + public Builder mergeSecondaryConfig( + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig value) { + if (secondaryConfigBuilder_ == null) { + if (((bitField0_ & 0x00800000) != 0) + && secondaryConfig_ != null + && secondaryConfig_ + != com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.getDefaultInstance()) { + getSecondaryConfigBuilder().mergeFrom(value); + } else { + secondaryConfig_ = value; + } + } else { + secondaryConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + */ + public Builder clearSecondaryConfig() { + bitField0_ = (bitField0_ & ~0x00800000); + secondaryConfig_ = null; + if (secondaryConfigBuilder_ != null) { + secondaryConfigBuilder_.dispose(); + secondaryConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + */ + public com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.Builder + getSecondaryConfigBuilder() { + bitField0_ |= 0x00800000; + onChanged(); + return getSecondaryConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + */ + public com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfigOrBuilder + getSecondaryConfigOrBuilder() { + if (secondaryConfigBuilder_ != null) { + return secondaryConfigBuilder_.getMessageOrBuilder(); + } else { + return secondaryConfig_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.getDefaultInstance() + : secondaryConfig_; + } + } + /** + * + * + *
+     * Cross Region replication config specific to SECONDARY cluster.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig, + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.Builder, + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfigOrBuilder> + getSecondaryConfigFieldBuilder() { + if (secondaryConfigBuilder_ == null) { + secondaryConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig, + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.Builder, + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfigOrBuilder>( + getSecondaryConfig(), getParentForChildren(), isClean()); + secondaryConfig_ = null; + } + return secondaryConfigBuilder_; + } + + private com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primaryConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig, + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.Builder, + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfigOrBuilder> + primaryConfigBuilder_; + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the primaryConfig field is set. + */ + public boolean hasPrimaryConfig() { + return ((bitField0_ & 0x01000000) != 0); + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The primaryConfig. + */ + public com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig getPrimaryConfig() { + if (primaryConfigBuilder_ == null) { + return primaryConfig_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.getDefaultInstance() + : primaryConfig_; + } else { + return primaryConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPrimaryConfig(com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig value) { + if (primaryConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + primaryConfig_ = value; + } else { + primaryConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPrimaryConfig( + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.Builder builderForValue) { + if (primaryConfigBuilder_ == null) { + primaryConfig_ = builderForValue.build(); + } else { + primaryConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergePrimaryConfig(com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig value) { + if (primaryConfigBuilder_ == null) { + if (((bitField0_ & 0x01000000) != 0) + && primaryConfig_ != null + && primaryConfig_ + != com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.getDefaultInstance()) { + getPrimaryConfigBuilder().mergeFrom(value); + } else { + primaryConfig_ = value; + } + } else { + primaryConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPrimaryConfig() { + bitField0_ = (bitField0_ & ~0x01000000); + primaryConfig_ = null; + if (primaryConfigBuilder_ != null) { + primaryConfigBuilder_.dispose(); + primaryConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.Builder getPrimaryConfigBuilder() { + bitField0_ |= 0x01000000; + onChanged(); + return getPrimaryConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfigOrBuilder + getPrimaryConfigOrBuilder() { + if (primaryConfigBuilder_ != null) { + return primaryConfigBuilder_.getMessageOrBuilder(); + } else { + return primaryConfig_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.getDefaultInstance() + : primaryConfig_; + } + } + /** + * + * + *
+     * Output only. Cross Region replication config specific to PRIMARY cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig, + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.Builder, + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfigOrBuilder> + getPrimaryConfigFieldBuilder() { + if (primaryConfigBuilder_ == null) { + primaryConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig, + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.Builder, + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfigOrBuilder>( + getPrimaryConfig(), getParentForChildren(), isClean()); + primaryConfig_ = null; + } + return primaryConfigBuilder_; + } + + @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.alloydb.v1beta.Cluster) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.Cluster) + private static final com.google.cloud.alloydb.v1beta.Cluster DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.Cluster(); + } + + public static com.google.cloud.alloydb.v1beta.Cluster getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Cluster 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.alloydb.v1beta.Cluster getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ClusterName.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ClusterName.java new file mode 100644 index 000000000000..55ca440b6c0f --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ClusterName.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.alloydb.v1beta; + +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 ClusterName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CLUSTER = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/clusters/{cluster}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String cluster; + + @Deprecated + protected ClusterName() { + project = null; + location = null; + cluster = null; + } + + private ClusterName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + cluster = Preconditions.checkNotNull(builder.getCluster()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ClusterName of(String project, String location, String cluster) { + return newBuilder().setProject(project).setLocation(location).setCluster(cluster).build(); + } + + public static String format(String project, String location, String cluster) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCluster(cluster) + .build() + .toString(); + } + + public static ClusterName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CLUSTER.validatedMatch( + formattedString, "ClusterName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("cluster")); + } + + 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 (ClusterName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CLUSTER.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 (cluster != null) { + fieldMapBuilder.put("cluster", cluster); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CLUSTER.instantiate( + "project", project, "location", location, "cluster", cluster); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ClusterName that = ((ClusterName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.cluster, that.cluster); + } + 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(cluster); + return h; + } + + /** Builder for projects/{project}/locations/{location}/clusters/{cluster}. */ + public static class Builder { + private String project; + private String location; + private String cluster; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCluster(String cluster) { + this.cluster = cluster; + return this; + } + + private Builder(ClusterName clusterName) { + this.project = clusterName.project; + this.location = clusterName.location; + this.cluster = clusterName.cluster; + } + + public ClusterName build() { + return new ClusterName(this); + } + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ClusterOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ClusterOrBuilder.java new file mode 100644 index 000000000000..88e099a9b20b --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ClusterOrBuilder.java @@ -0,0 +1,995 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface ClusterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.Cluster) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupSource field is set. + */ + boolean hasBackupSource(); + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupSource. + */ + com.google.cloud.alloydb.v1beta.BackupSource getBackupSource(); + /** + * + * + *
+   * Output only. Cluster created from backup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1beta.BackupSourceOrBuilder getBackupSourceOrBuilder(); + + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the migrationSource field is set. + */ + boolean hasMigrationSource(); + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The migrationSource. + */ + com.google.cloud.alloydb.v1beta.MigrationSource getMigrationSource(); + /** + * + * + *
+   * Output only. Cluster created via DMS migration.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1beta.MigrationSourceOrBuilder getMigrationSourceOrBuilder(); + + /** + * + * + *
+   * Output only. The name of the cluster resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * where the cluster ID segment should satisfy the regex expression
+   * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+   * The prefix of the cluster resource name is the name of the parent resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The name of the cluster resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * where the cluster ID segment should satisfy the regex expression
+   * `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
+   * The prefix of the cluster resource name is the name of the parent resource:
+   *  * projects/{project}/locations/{region}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * User-settable and human-readable display name for the Cluster.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * User-settable and human-readable display name for the Cluster.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The current serving state of the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current serving state of the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.alloydb.v1beta.Cluster.State getState(); + + /** + * + * + *
+   * Output only. The type of the cluster. This is an output-only field and it's
+   * populated at the Cluster creation time or the Cluster promotion
+   * time. The cluster type is determined by which RPC was used to create
+   * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for clusterType. + */ + int getClusterTypeValue(); + /** + * + * + *
+   * Output only. The type of the cluster. This is an output-only field and it's
+   * populated at the Cluster creation time or the Cluster promotion
+   * time. The cluster type is determined by which RPC was used to create
+   * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The clusterType. + */ + com.google.cloud.alloydb.v1beta.Cluster.ClusterType getClusterType(); + + /** + * + * + *
+   * Output only. The database engine major version. This is an output-only
+   * field and it's populated at the Cluster creation time. This field cannot be
+   * changed after cluster creation.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + int getDatabaseVersionValue(); + /** + * + * + *
+   * Output only. The database engine major version. This is an output-only
+   * field and it's populated at the Cluster creation time. This field cannot be
+   * changed after cluster creation.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + com.google.cloud.alloydb.v1beta.DatabaseVersion getDatabaseVersion(); + + /** + * + * + *
+   * Required. The resource link for the VPC network in which cluster resources
+   * are created and from which they are accessible via Private IP. The network
+   * must belong to the same project as the cluster. It is specified in the
+   * form: "projects/{project_number}/global/networks/{network_id}". This is
+   * required to create a cluster. It can be updated, but it cannot be removed.
+   * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * Required. The resource link for the VPC network in which cluster resources
+   * are created and from which they are accessible via Private IP. The network
+   * must belong to the same project as the cluster. It is specified in the
+   * form: "projects/{project_number}/global/networks/{network_id}". This is
+   * required to create a cluster. It can be updated, but it cannot be removed.
+   * 
+ * + * + * string network = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 11; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 11; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 12; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+   * Set to true if the current state of Cluster does not match the user's
+   * intended state, and the service is actively updating the resource to
+   * reconcile them. This can happen due to user-triggered updates or
+   * system actions like failover or maintenance.
+   * 
+ * + * bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the initialUser field is set. + */ + boolean hasInitialUser(); + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The initialUser. + */ + com.google.cloud.alloydb.v1beta.UserPassword getInitialUser(); + /** + * + * + *
+   * Input only. Initial user to setup during cluster creation. Required.
+   * If used in `RestoreCluster` this is ignored.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1beta.UserPasswordOrBuilder getInitialUserOrBuilder(); + + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return Whether the automatedBackupPolicy field is set. + */ + boolean hasAutomatedBackupPolicy(); + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + * + * @return The automatedBackupPolicy. + */ + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy getAutomatedBackupPolicy(); + /** + * + * + *
+   * The automated backup policy for this cluster.
+   * If no policy is provided then the default policy will be used. If backups
+   * are supported for the cluster, the default policy takes one backup a day,
+   * has a backup window of 1 hour, and retains backups for 14 days.
+   * For more information on the defaults, consult the
+   * documentation for the message type.
+   * 
+ * + * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + */ + com.google.cloud.alloydb.v1beta.AutomatedBackupPolicyOrBuilder + getAutomatedBackupPolicyOrBuilder(); + + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * + * @return Whether the sslConfig field is set. + */ + boolean hasSslConfig(); + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * + * @return The sslConfig. + */ + com.google.cloud.alloydb.v1beta.SslConfig getSslConfig(); + /** + * + * + *
+   * SSL configuration for this AlloyDB Cluster.
+   * 
+ * + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + */ + com.google.cloud.alloydb.v1beta.SslConfigOrBuilder getSslConfigOrBuilder(); + + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + com.google.cloud.alloydb.v1beta.EncryptionConfig getEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption config can be specified to encrypt the data disks
+   * and other persistent data resources of a cluster with a
+   * customer-managed encryption key (CMEK). When this field is not
+   * specified, the cluster will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); + + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + boolean hasEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + com.google.cloud.alloydb.v1beta.EncryptionInfo getEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(); + + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the continuousBackupConfig field is set. + */ + boolean hasContinuousBackupConfig(); + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The continuousBackupConfig. + */ + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig getContinuousBackupConfig(); + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.alloydb.v1beta.ContinuousBackupConfigOrBuilder + getContinuousBackupConfigOrBuilder(); + + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the continuousBackupInfo field is set. + */ + boolean hasContinuousBackupInfo(); + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The continuousBackupInfo. + */ + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo getContinuousBackupInfo(); + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1beta.ContinuousBackupInfoOrBuilder getContinuousBackupInfoOrBuilder(); + + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + * + * @return Whether the secondaryConfig field is set. + */ + boolean hasSecondaryConfig(); + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + * + * @return The secondaryConfig. + */ + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig getSecondaryConfig(); + /** + * + * + *
+   * Cross Region replication config specific to SECONDARY cluster.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + */ + com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfigOrBuilder getSecondaryConfigOrBuilder(); + + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the primaryConfig field is set. + */ + boolean hasPrimaryConfig(); + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The primaryConfig. + */ + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig getPrimaryConfig(); + /** + * + * + *
+   * Output only. Cross Region replication config specific to PRIMARY cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfigOrBuilder getPrimaryConfigOrBuilder(); + + public com.google.cloud.alloydb.v1beta.Cluster.SourceCase getSourceCase(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ConnectionInfo.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ConnectionInfo.java new file mode 100644 index 000000000000..eca7c8afaaa3 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ConnectionInfo.java @@ -0,0 +1,1317 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * ConnectionInfo singleton resource.
+ * https://google.aip.dev/156
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ConnectionInfo} + */ +public final class ConnectionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.ConnectionInfo) + ConnectionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConnectionInfo.newBuilder() to construct. + private ConnectionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConnectionInfo() { + name_ = ""; + ipAddress_ = ""; + pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.EMPTY; + instanceUid_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConnectionInfo(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ConnectionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ConnectionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ConnectionInfo.class, + com.google.cloud.alloydb.v1beta.ConnectionInfo.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * The name of the ConnectionInfo singleton resource, e.g.:
+   * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+   * This field currently has no semantic meaning.
+   * 
+ * + * 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 name of the ConnectionInfo singleton resource, e.g.:
+   * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+   * This field currently has no semantic meaning.
+   * 
+ * + * 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 IP_ADDRESS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object ipAddress_ = ""; + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ipAddress. + */ + @java.lang.Override + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + 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(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for ipAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PEM_CERTIFICATE_CHAIN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList pemCertificateChain_; + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the pemCertificateChain. + */ + public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { + return pemCertificateChain_; + } + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of pemCertificateChain. + */ + public int getPemCertificateChainCount() { + return pemCertificateChain_.size(); + } + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The pemCertificateChain at the given index. + */ + public java.lang.String getPemCertificateChain(int index) { + return pemCertificateChain_.get(index); + } + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the pemCertificateChain at the given index. + */ + public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { + return pemCertificateChain_.getByteString(index); + } + + public static final int INSTANCE_UID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceUid_ = ""; + /** + * + * + *
+   * Output only. The unique ID of the Instance.
+   * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The instanceUid. + */ + @java.lang.Override + public java.lang.String getInstanceUid() { + java.lang.Object ref = instanceUid_; + 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(); + instanceUid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The unique ID of the Instance.
+   * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for instanceUid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceUidBytes() { + java.lang.Object ref = instanceUid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceUid_ = 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(ipAddress_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ipAddress_); + } + for (int i = 0; i < pemCertificateChain_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pemCertificateChain_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceUid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, instanceUid_); + } + 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(ipAddress_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ipAddress_); + } + { + int dataSize = 0; + for (int i = 0; i < pemCertificateChain_.size(); i++) { + dataSize += computeStringSizeNoTag(pemCertificateChain_.getRaw(i)); + } + size += dataSize; + size += 1 * getPemCertificateChainList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceUid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, instanceUid_); + } + 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.alloydb.v1beta.ConnectionInfo)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.ConnectionInfo other = + (com.google.cloud.alloydb.v1beta.ConnectionInfo) obj; + + if (!getName().equals(other.getName())) return false; + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (!getPemCertificateChainList().equals(other.getPemCertificateChainList())) return false; + if (!getInstanceUid().equals(other.getInstanceUid())) 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) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + if (getPemCertificateChainCount() > 0) { + hash = (37 * hash) + PEM_CERTIFICATE_CHAIN_FIELD_NUMBER; + hash = (53 * hash) + getPemCertificateChainList().hashCode(); + } + hash = (37 * hash) + INSTANCE_UID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceUid().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.ConnectionInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ConnectionInfo 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.alloydb.v1beta.ConnectionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ConnectionInfo 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.alloydb.v1beta.ConnectionInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ConnectionInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ConnectionInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ConnectionInfo 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.alloydb.v1beta.ConnectionInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ConnectionInfo 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.alloydb.v1beta.ConnectionInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ConnectionInfo 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.alloydb.v1beta.ConnectionInfo 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; + } + /** + * + * + *
+   * ConnectionInfo singleton resource.
+   * https://google.aip.dev/156
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ConnectionInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.ConnectionInfo) + com.google.cloud.alloydb.v1beta.ConnectionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ConnectionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ConnectionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ConnectionInfo.class, + com.google.cloud.alloydb.v1beta.ConnectionInfo.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.ConnectionInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + ipAddress_ = ""; + pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + instanceUid_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ConnectionInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ConnectionInfo getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.ConnectionInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ConnectionInfo build() { + com.google.cloud.alloydb.v1beta.ConnectionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ConnectionInfo buildPartial() { + com.google.cloud.alloydb.v1beta.ConnectionInfo result = + new com.google.cloud.alloydb.v1beta.ConnectionInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.alloydb.v1beta.ConnectionInfo result) { + if (((bitField0_ & 0x00000004) != 0)) { + pemCertificateChain_ = pemCertificateChain_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.pemCertificateChain_ = pemCertificateChain_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.ConnectionInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ipAddress_ = ipAddress_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.instanceUid_ = instanceUid_; + } + } + + @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.alloydb.v1beta.ConnectionInfo) { + return mergeFrom((com.google.cloud.alloydb.v1beta.ConnectionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.ConnectionInfo other) { + if (other == com.google.cloud.alloydb.v1beta.ConnectionInfo.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.pemCertificateChain_.isEmpty()) { + if (pemCertificateChain_.isEmpty()) { + pemCertificateChain_ = other.pemCertificateChain_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.addAll(other.pemCertificateChain_); + } + onChanged(); + } + if (!other.getInstanceUid().isEmpty()) { + instanceUid_ = other.instanceUid_; + bitField0_ |= 0x00000008; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + ipAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.add(s); + break; + } // case 26 + case 34: + { + instanceUid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the ConnectionInfo singleton resource, e.g.:
+     * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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 name of the ConnectionInfo singleton resource, e.g.:
+     * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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 name of the ConnectionInfo singleton resource, e.g.:
+     * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the ConnectionInfo singleton resource, e.g.:
+     * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+     * This field currently has no semantic meaning.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the ConnectionInfo singleton resource, e.g.:
+     * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object ipAddress_ = ""; + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ipAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + ipAddress_ = getDefaultInstance().getIpAddress(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ipAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList pemCertificateChain_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePemCertificateChainIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + pemCertificateChain_ = new com.google.protobuf.LazyStringArrayList(pemCertificateChain_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the pemCertificateChain. + */ + public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { + return pemCertificateChain_.getUnmodifiableView(); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of pemCertificateChain. + */ + public int getPemCertificateChainCount() { + return pemCertificateChain_.size(); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The pemCertificateChain at the given index. + */ + public java.lang.String getPemCertificateChain(int index) { + return pemCertificateChain_.get(index); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the pemCertificateChain at the given index. + */ + public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { + return pemCertificateChain_.getByteString(index); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The pemCertificateChain to set. + * @return This builder for chaining. + */ + public Builder setPemCertificateChain(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The pemCertificateChain to add. + * @return This builder for chaining. + */ + public Builder addPemCertificateChain(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The pemCertificateChain to add. + * @return This builder for chaining. + */ + public Builder addAllPemCertificateChain(java.lang.Iterable values) { + ensurePemCertificateChainIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pemCertificateChain_); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearPemCertificateChain() { + pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes of the pemCertificateChain to add. + * @return This builder for chaining. + */ + public Builder addPemCertificateChainBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.add(value); + onChanged(); + return this; + } + + private java.lang.Object instanceUid_ = ""; + /** + * + * + *
+     * Output only. The unique ID of the Instance.
+     * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The instanceUid. + */ + public java.lang.String getInstanceUid() { + java.lang.Object ref = instanceUid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceUid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The unique ID of the Instance.
+     * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for instanceUid. + */ + public com.google.protobuf.ByteString getInstanceUidBytes() { + java.lang.Object ref = instanceUid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The unique ID of the Instance.
+     * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The instanceUid to set. + * @return This builder for chaining. + */ + public Builder setInstanceUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instanceUid_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique ID of the Instance.
+     * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearInstanceUid() { + instanceUid_ = getDefaultInstance().getInstanceUid(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique ID of the Instance.
+     * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for instanceUid to set. + * @return This builder for chaining. + */ + public Builder setInstanceUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instanceUid_ = value; + bitField0_ |= 0x00000008; + 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.alloydb.v1beta.ConnectionInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.ConnectionInfo) + private static final com.google.cloud.alloydb.v1beta.ConnectionInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.ConnectionInfo(); + } + + public static com.google.cloud.alloydb.v1beta.ConnectionInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionInfo 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.alloydb.v1beta.ConnectionInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ConnectionInfoOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ConnectionInfoOrBuilder.java new file mode 100644 index 000000000000..0c5d1b941639 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ConnectionInfoOrBuilder.java @@ -0,0 +1,165 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface ConnectionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.ConnectionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the ConnectionInfo singleton resource, e.g.:
+   * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+   * This field currently has no semantic meaning.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the ConnectionInfo singleton resource, e.g.:
+   * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
+   * This field currently has no semantic meaning.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the pemCertificateChain. + */ + java.util.List getPemCertificateChainList(); + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of pemCertificateChain. + */ + int getPemCertificateChainCount(); + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The pemCertificateChain at the given index. + */ + java.lang.String getPemCertificateChain(int index); + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the pemCertificateChain at the given index. + */ + com.google.protobuf.ByteString getPemCertificateChainBytes(int index); + + /** + * + * + *
+   * Output only. The unique ID of the Instance.
+   * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The instanceUid. + */ + java.lang.String getInstanceUid(); + /** + * + * + *
+   * Output only. The unique ID of the Instance.
+   * 
+ * + * string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for instanceUid. + */ + com.google.protobuf.ByteString getInstanceUidBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupConfig.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupConfig.java new file mode 100644 index 000000000000..d99d63890401 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupConfig.java @@ -0,0 +1,987 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * ContinuousBackupConfig describes the continuous backups recovery
+ * configurations of a cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ContinuousBackupConfig} + */ +public final class ContinuousBackupConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.ContinuousBackupConfig) + ContinuousBackupConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContinuousBackupConfig.newBuilder() to construct. + private ContinuousBackupConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ContinuousBackupConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ContinuousBackupConfig(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ContinuousBackupConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ContinuousBackupConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.class, + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.Builder.class); + } + + private int bitField0_; + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_ = false; + /** + * + * + *
+   * Whether ContinuousBackup is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Whether ContinuousBackup is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + public static final int RECOVERY_WINDOW_DAYS_FIELD_NUMBER = 4; + private int recoveryWindowDays_ = 0; + /** + * + * + *
+   * The number of days backups and logs will be retained, which determines the
+   * window of time that data is recoverable for. If not set, it defaults to 14
+   * days.
+   * 
+ * + * int32 recovery_window_days = 4; + * + * @return The recoveryWindowDays. + */ + @java.lang.Override + public int getRecoveryWindowDays() { + return recoveryWindowDays_; + } + + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1beta.EncryptionConfig encryptionConfig_; + /** + * + * + *
+   * The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return encryptionConfig_ != null; + } + /** + * + * + *
+   * The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + /** + * + * + *
+   * The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + 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, enabled_); + } + if (encryptionConfig_ != null) { + output.writeMessage(3, getEncryptionConfig()); + } + if (recoveryWindowDays_ != 0) { + output.writeInt32(4, recoveryWindowDays_); + } + 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, enabled_); + } + if (encryptionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEncryptionConfig()); + } + if (recoveryWindowDays_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, recoveryWindowDays_); + } + 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.alloydb.v1beta.ContinuousBackupConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig other = + (com.google.cloud.alloydb.v1beta.ContinuousBackupConfig) obj; + + if (hasEnabled() != other.hasEnabled()) return false; + if (hasEnabled()) { + if (getEnabled() != other.getEnabled()) return false; + } + if (getRecoveryWindowDays() != other.getRecoveryWindowDays()) return false; + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) 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 (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); + } + hash = (37 * hash) + RECOVERY_WINDOW_DAYS_FIELD_NUMBER; + hash = (53 * hash) + getRecoveryWindowDays(); + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupConfig 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.alloydb.v1beta.ContinuousBackupConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupConfig 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.alloydb.v1beta.ContinuousBackupConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupConfig 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.alloydb.v1beta.ContinuousBackupConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupConfig 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.alloydb.v1beta.ContinuousBackupConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupConfig 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.alloydb.v1beta.ContinuousBackupConfig 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; + } + /** + * + * + *
+   * ContinuousBackupConfig describes the continuous backups recovery
+   * configurations of a cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ContinuousBackupConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.ContinuousBackupConfig) + com.google.cloud.alloydb.v1beta.ContinuousBackupConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ContinuousBackupConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ContinuousBackupConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.class, + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enabled_ = false; + recoveryWindowDays_ = 0; + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ContinuousBackupConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupConfig build() { + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupConfig buildPartial() { + com.google.cloud.alloydb.v1beta.ContinuousBackupConfig result = + new com.google.cloud.alloydb.v1beta.ContinuousBackupConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.ContinuousBackupConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enabled_ = enabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.recoveryWindowDays_ = recoveryWindowDays_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.encryptionConfig_ = + encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); + } + result.bitField0_ |= to_bitField0_; + } + + @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.alloydb.v1beta.ContinuousBackupConfig) { + return mergeFrom((com.google.cloud.alloydb.v1beta.ContinuousBackupConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.ContinuousBackupConfig other) { + if (other == com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.getDefaultInstance()) + return this; + if (other.hasEnabled()) { + setEnabled(other.getEnabled()); + } + if (other.getRecoveryWindowDays() != 0) { + setRecoveryWindowDays(other.getRecoveryWindowDays()); + } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } + 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: + { + enabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 26: + { + input.readMessage( + getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + recoveryWindowDays_ = input.readInt32(); + bitField0_ |= 0x00000002; + 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 int bitField0_; + + private boolean enabled_; + /** + * + * + *
+     * Whether ContinuousBackup is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Whether ContinuousBackup is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + /** + * + * + *
+     * Whether ContinuousBackup is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether ContinuousBackup is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + enabled_ = false; + onChanged(); + return this; + } + + private int recoveryWindowDays_; + /** + * + * + *
+     * The number of days backups and logs will be retained, which determines the
+     * window of time that data is recoverable for. If not set, it defaults to 14
+     * days.
+     * 
+ * + * int32 recovery_window_days = 4; + * + * @return The recoveryWindowDays. + */ + @java.lang.Override + public int getRecoveryWindowDays() { + return recoveryWindowDays_; + } + /** + * + * + *
+     * The number of days backups and logs will be retained, which determines the
+     * window of time that data is recoverable for. If not set, it defaults to 14
+     * days.
+     * 
+ * + * int32 recovery_window_days = 4; + * + * @param value The recoveryWindowDays to set. + * @return This builder for chaining. + */ + public Builder setRecoveryWindowDays(int value) { + + recoveryWindowDays_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of days backups and logs will be retained, which determines the
+     * window of time that data is recoverable for. If not set, it defaults to 14
+     * days.
+     * 
+ * + * int32 recovery_window_days = 4; + * + * @return This builder for chaining. + */ + public Builder clearRecoveryWindowDays() { + bitField0_ = (bitField0_ & ~0x00000002); + recoveryWindowDays_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1beta.EncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionConfig, + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder> + encryptionConfigBuilder_; + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + * + * @return The encryptionConfig. + */ + public com.google.cloud.alloydb.v1beta.EncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + */ + public Builder setEncryptionConfig(com.google.cloud.alloydb.v1beta.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + } else { + encryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + */ + public Builder setEncryptionConfig( + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + */ + public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1beta.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); + } else { + encryptionConfig_ = value; + } + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + */ + public Builder clearEncryptionConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + */ + public com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder getEncryptionConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getEncryptionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + */ + public com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + /** + * + * + *
+     * The encryption config can be specified to encrypt the
+     * backups with a customer-managed encryption key (CMEK). When this field is
+     * not specified, the backup will then use default encryption scheme to
+     * protect the user data.
+     * 
+ * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionConfig, + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder> + getEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionConfig, + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + + @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.alloydb.v1beta.ContinuousBackupConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.ContinuousBackupConfig) + private static final com.google.cloud.alloydb.v1beta.ContinuousBackupConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.ContinuousBackupConfig(); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContinuousBackupConfig 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.alloydb.v1beta.ContinuousBackupConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupConfigOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupConfigOrBuilder.java new file mode 100644 index 000000000000..260778e6a0aa --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupConfigOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface ContinuousBackupConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.ContinuousBackupConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether ContinuousBackup is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + boolean hasEnabled(); + /** + * + * + *
+   * Whether ContinuousBackup is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + boolean getEnabled(); + + /** + * + * + *
+   * The number of days backups and logs will be retained, which determines the
+   * window of time that data is recoverable for. If not set, it defaults to 14
+   * days.
+   * 
+ * + * int32 recovery_window_days = 4; + * + * @return The recoveryWindowDays. + */ + int getRecoveryWindowDays(); + + /** + * + * + *
+   * The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + /** + * + * + *
+   * The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + * + * @return The encryptionConfig. + */ + com.google.cloud.alloydb.v1beta.EncryptionConfig getEncryptionConfig(); + /** + * + * + *
+   * The encryption config can be specified to encrypt the
+   * backups with a customer-managed encryption key (CMEK). When this field is
+   * not specified, the backup will then use default encryption scheme to
+   * protect the user data.
+   * 
+ * + * .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + */ + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupInfo.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupInfo.java new file mode 100644 index 000000000000..90c15bc60de1 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupInfo.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/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * ContinuousBackupInfo describes the continuous backup properties of a
+ * cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ContinuousBackupInfo} + */ +public final class ContinuousBackupInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.ContinuousBackupInfo) + ContinuousBackupInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContinuousBackupInfo.newBuilder() to construct. + private ContinuousBackupInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ContinuousBackupInfo() { + schedule_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ContinuousBackupInfo(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ContinuousBackupInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ContinuousBackupInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.class, + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.Builder.class); + } + + public static final int ENCRYPTION_INFO_FIELD_NUMBER = 1; + private com.google.cloud.alloydb.v1beta.EncryptionInfo encryptionInfo_; + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + @java.lang.Override + public boolean hasEncryptionInfo() { + return encryptionInfo_ != null; + } + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionInfo getEncryptionInfo() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + + public static final int ENABLED_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp enabledTime_; + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the enabledTime field is set. + */ + @java.lang.Override + public boolean hasEnabledTime() { + return enabledTime_ != null; + } + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enabledTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEnabledTime() { + return enabledTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : enabledTime_; + } + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEnabledTimeOrBuilder() { + return enabledTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : enabledTime_; + } + + public static final int SCHEDULE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List schedule_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.type.DayOfWeek> + schedule_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.type.DayOfWeek>() { + public com.google.type.DayOfWeek convert(java.lang.Integer from) { + com.google.type.DayOfWeek result = com.google.type.DayOfWeek.forNumber(from); + return result == null ? com.google.type.DayOfWeek.UNRECOGNIZED : result; + } + }; + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the schedule. + */ + @java.lang.Override + public java.util.List getScheduleList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.type.DayOfWeek>(schedule_, schedule_converter_); + } + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of schedule. + */ + @java.lang.Override + public int getScheduleCount() { + return schedule_.size(); + } + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The schedule at the given index. + */ + @java.lang.Override + public com.google.type.DayOfWeek getSchedule(int index) { + return schedule_converter_.convert(schedule_.get(index)); + } + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the enum numeric values on the wire for schedule. + */ + @java.lang.Override + public java.util.List getScheduleValueList() { + return schedule_; + } + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of schedule at the given index. + */ + @java.lang.Override + public int getScheduleValue(int index) { + return schedule_.get(index); + } + + private int scheduleMemoizedSerializedSize; + + 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 (encryptionInfo_ != null) { + output.writeMessage(1, getEncryptionInfo()); + } + if (enabledTime_ != null) { + output.writeMessage(2, getEnabledTime()); + } + if (getScheduleList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(scheduleMemoizedSerializedSize); + } + for (int i = 0; i < schedule_.size(); i++) { + output.writeEnumNoTag(schedule_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encryptionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEncryptionInfo()); + } + if (enabledTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEnabledTime()); + } + { + int dataSize = 0; + for (int i = 0; i < schedule_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(schedule_.get(i)); + } + size += dataSize; + if (!getScheduleList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + scheduleMemoizedSerializedSize = 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.alloydb.v1beta.ContinuousBackupInfo)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo other = + (com.google.cloud.alloydb.v1beta.ContinuousBackupInfo) obj; + + if (hasEncryptionInfo() != other.hasEncryptionInfo()) return false; + if (hasEncryptionInfo()) { + if (!getEncryptionInfo().equals(other.getEncryptionInfo())) return false; + } + if (hasEnabledTime() != other.hasEnabledTime()) return false; + if (hasEnabledTime()) { + if (!getEnabledTime().equals(other.getEnabledTime())) return false; + } + if (!schedule_.equals(other.schedule_)) 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 (hasEncryptionInfo()) { + hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionInfo().hashCode(); + } + if (hasEnabledTime()) { + hash = (37 * hash) + ENABLED_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEnabledTime().hashCode(); + } + if (getScheduleCount() > 0) { + hash = (37 * hash) + SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + schedule_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupInfo 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.alloydb.v1beta.ContinuousBackupInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupInfo 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.alloydb.v1beta.ContinuousBackupInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupInfo 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.alloydb.v1beta.ContinuousBackupInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupInfo 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.alloydb.v1beta.ContinuousBackupInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupInfo 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.alloydb.v1beta.ContinuousBackupInfo 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; + } + /** + * + * + *
+   * ContinuousBackupInfo describes the continuous backup properties of a
+   * cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ContinuousBackupInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.ContinuousBackupInfo) + com.google.cloud.alloydb.v1beta.ContinuousBackupInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ContinuousBackupInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ContinuousBackupInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.class, + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + enabledTime_ = null; + if (enabledTimeBuilder_ != null) { + enabledTimeBuilder_.dispose(); + enabledTimeBuilder_ = null; + } + schedule_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ContinuousBackupInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupInfo getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupInfo build() { + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupInfo buildPartial() { + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo result = + new com.google.cloud.alloydb.v1beta.ContinuousBackupInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1beta.ContinuousBackupInfo result) { + if (((bitField0_ & 0x00000004) != 0)) { + schedule_ = java.util.Collections.unmodifiableList(schedule_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.schedule_ = schedule_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.ContinuousBackupInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encryptionInfo_ = + encryptionInfoBuilder_ == null ? encryptionInfo_ : encryptionInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.enabledTime_ = + enabledTimeBuilder_ == null ? enabledTime_ : enabledTimeBuilder_.build(); + } + } + + @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.alloydb.v1beta.ContinuousBackupInfo) { + return mergeFrom((com.google.cloud.alloydb.v1beta.ContinuousBackupInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.ContinuousBackupInfo other) { + if (other == com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.getDefaultInstance()) + return this; + if (other.hasEncryptionInfo()) { + mergeEncryptionInfo(other.getEncryptionInfo()); + } + if (other.hasEnabledTime()) { + mergeEnabledTime(other.getEnabledTime()); + } + if (!other.schedule_.isEmpty()) { + if (schedule_.isEmpty()) { + schedule_ = other.schedule_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureScheduleIsMutable(); + schedule_.addAll(other.schedule_); + } + 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(getEncryptionInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEnabledTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + int tmpRaw = input.readEnum(); + ensureScheduleIsMutable(); + schedule_.add(tmpRaw); + break; + } // case 24 + case 26: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureScheduleIsMutable(); + schedule_.add(tmpRaw); + } + input.popLimit(oldLimit); + 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 com.google.cloud.alloydb.v1beta.EncryptionInfo encryptionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionInfo, + com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder> + encryptionInfoBuilder_; + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + public boolean hasEncryptionInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + public com.google.cloud.alloydb.v1beta.EncryptionInfo getEncryptionInfo() { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } else { + return encryptionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo(com.google.cloud.alloydb.v1beta.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionInfo_ = value; + } else { + encryptionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo( + com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = builderForValue.build(); + } else { + encryptionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEncryptionInfo(com.google.cloud.alloydb.v1beta.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && encryptionInfo_ != null + && encryptionInfo_ + != com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance()) { + getEncryptionInfoBuilder().mergeFrom(value); + } else { + encryptionInfo_ = value; + } + } else { + encryptionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEncryptionInfo() { + bitField0_ = (bitField0_ & ~0x00000001); + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder getEncryptionInfoBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getEncryptionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + if (encryptionInfoBuilder_ != null) { + return encryptionInfoBuilder_.getMessageOrBuilder(); + } else { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionInfo, + com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder> + getEncryptionInfoFieldBuilder() { + if (encryptionInfoBuilder_ == null) { + encryptionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.EncryptionInfo, + com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder>( + getEncryptionInfo(), getParentForChildren(), isClean()); + encryptionInfo_ = null; + } + return encryptionInfoBuilder_; + } + + private com.google.protobuf.Timestamp enabledTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + enabledTimeBuilder_; + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the enabledTime field is set. + */ + public boolean hasEnabledTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enabledTime. + */ + public com.google.protobuf.Timestamp getEnabledTime() { + if (enabledTimeBuilder_ == null) { + return enabledTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : enabledTime_; + } else { + return enabledTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEnabledTime(com.google.protobuf.Timestamp value) { + if (enabledTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enabledTime_ = value; + } else { + enabledTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEnabledTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (enabledTimeBuilder_ == null) { + enabledTime_ = builderForValue.build(); + } else { + enabledTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEnabledTime(com.google.protobuf.Timestamp value) { + if (enabledTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && enabledTime_ != null + && enabledTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEnabledTimeBuilder().mergeFrom(value); + } else { + enabledTime_ = value; + } + } else { + enabledTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEnabledTime() { + bitField0_ = (bitField0_ & ~0x00000002); + enabledTime_ = null; + if (enabledTimeBuilder_ != null) { + enabledTimeBuilder_.dispose(); + enabledTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEnabledTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEnabledTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEnabledTimeOrBuilder() { + if (enabledTimeBuilder_ != null) { + return enabledTimeBuilder_.getMessageOrBuilder(); + } else { + return enabledTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : enabledTime_; + } + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEnabledTimeFieldBuilder() { + if (enabledTimeBuilder_ == null) { + enabledTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEnabledTime(), getParentForChildren(), isClean()); + enabledTime_ = null; + } + return enabledTimeBuilder_; + } + + private java.util.List schedule_ = java.util.Collections.emptyList(); + + private void ensureScheduleIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + schedule_ = new java.util.ArrayList(schedule_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the schedule. + */ + public java.util.List getScheduleList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.type.DayOfWeek>(schedule_, schedule_converter_); + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of schedule. + */ + public int getScheduleCount() { + return schedule_.size(); + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The schedule at the given index. + */ + public com.google.type.DayOfWeek getSchedule(int index) { + return schedule_converter_.convert(schedule_.get(index)); + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The schedule to set. + * @return This builder for chaining. + */ + public Builder setSchedule(int index, com.google.type.DayOfWeek value) { + if (value == null) { + throw new NullPointerException(); + } + ensureScheduleIsMutable(); + schedule_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The schedule to add. + * @return This builder for chaining. + */ + public Builder addSchedule(com.google.type.DayOfWeek value) { + if (value == null) { + throw new NullPointerException(); + } + ensureScheduleIsMutable(); + schedule_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The schedule to add. + * @return This builder for chaining. + */ + public Builder addAllSchedule(java.lang.Iterable values) { + ensureScheduleIsMutable(); + for (com.google.type.DayOfWeek value : values) { + schedule_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSchedule() { + schedule_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the enum numeric values on the wire for schedule. + */ + public java.util.List getScheduleValueList() { + return java.util.Collections.unmodifiableList(schedule_); + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of schedule at the given index. + */ + public int getScheduleValue(int index) { + return schedule_.get(index); + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for schedule to set. + * @return This builder for chaining. + */ + public Builder setScheduleValue(int index, int value) { + ensureScheduleIsMutable(); + schedule_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for schedule to add. + * @return This builder for chaining. + */ + public Builder addScheduleValue(int value) { + ensureScheduleIsMutable(); + schedule_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The enum numeric values on the wire for schedule to add. + * @return This builder for chaining. + */ + public Builder addAllScheduleValue(java.lang.Iterable values) { + ensureScheduleIsMutable(); + for (int value : values) { + schedule_.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.alloydb.v1beta.ContinuousBackupInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.ContinuousBackupInfo) + private static final com.google.cloud.alloydb.v1beta.ContinuousBackupInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.ContinuousBackupInfo(); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContinuousBackupInfo 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.alloydb.v1beta.ContinuousBackupInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupInfoOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupInfoOrBuilder.java new file mode 100644 index 000000000000..ffa89ea3cb7c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupInfoOrBuilder.java @@ -0,0 +1,188 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface ContinuousBackupInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.ContinuousBackupInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + boolean hasEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + com.google.cloud.alloydb.v1beta.EncryptionInfo getEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(); + + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the enabledTime field is set. + */ + boolean hasEnabledTime(); + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enabledTime. + */ + com.google.protobuf.Timestamp getEnabledTime(); + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEnabledTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the schedule. + */ + java.util.List getScheduleList(); + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of schedule. + */ + int getScheduleCount(); + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The schedule at the given index. + */ + com.google.type.DayOfWeek getSchedule(int index); + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the enum numeric values on the wire for schedule. + */ + java.util.List getScheduleValueList(); + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of schedule at the given index. + */ + int getScheduleValue(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupSource.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupSource.java new file mode 100644 index 000000000000..057ffbf6efb9 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupSource.java @@ -0,0 +1,917 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message describing a ContinuousBackupSource.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ContinuousBackupSource} + */ +public final class ContinuousBackupSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.ContinuousBackupSource) + ContinuousBackupSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContinuousBackupSource.newBuilder() to construct. + private ContinuousBackupSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ContinuousBackupSource() { + cluster_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ContinuousBackupSource(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ContinuousBackupSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ContinuousBackupSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ContinuousBackupSource.class, + com.google.cloud.alloydb.v1beta.ContinuousBackupSource.Builder.class); + } + + public static final int CLUSTER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object cluster_ = ""; + /** + * + * + *
+   * Required. The source cluster from which to restore. This cluster must have
+   * continuous backup enabled for this operation to succeed. For the required
+   * format, see the comment on the Cluster.name field.
+   * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The cluster. + */ + @java.lang.Override + public java.lang.String getCluster() { + java.lang.Object ref = cluster_; + 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(); + cluster_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The source cluster from which to restore. This cluster must have
+   * continuous backup enabled for this operation to succeed. For the required
+   * format, see the comment on the Cluster.name field.
+   * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for cluster. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterBytes() { + java.lang.Object ref = cluster_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cluster_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POINT_IN_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp pointInTime_; + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pointInTime field is set. + */ + @java.lang.Override + public boolean hasPointInTime() { + return pointInTime_ != null; + } + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pointInTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPointInTime() { + return pointInTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : pointInTime_; + } + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder() { + return pointInTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : pointInTime_; + } + + 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(cluster_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cluster_); + } + if (pointInTime_ != null) { + output.writeMessage(2, getPointInTime()); + } + 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(cluster_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cluster_); + } + if (pointInTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPointInTime()); + } + 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.alloydb.v1beta.ContinuousBackupSource)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.ContinuousBackupSource other = + (com.google.cloud.alloydb.v1beta.ContinuousBackupSource) obj; + + if (!getCluster().equals(other.getCluster())) return false; + if (hasPointInTime() != other.hasPointInTime()) return false; + if (hasPointInTime()) { + if (!getPointInTime().equals(other.getPointInTime())) 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) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + if (hasPointInTime()) { + hash = (37 * hash) + POINT_IN_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPointInTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupSource 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.alloydb.v1beta.ContinuousBackupSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupSource 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.alloydb.v1beta.ContinuousBackupSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupSource 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.alloydb.v1beta.ContinuousBackupSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupSource 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.alloydb.v1beta.ContinuousBackupSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupSource 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.alloydb.v1beta.ContinuousBackupSource 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; + } + /** + * + * + *
+   * Message describing a ContinuousBackupSource.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ContinuousBackupSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.ContinuousBackupSource) + com.google.cloud.alloydb.v1beta.ContinuousBackupSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ContinuousBackupSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ContinuousBackupSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ContinuousBackupSource.class, + com.google.cloud.alloydb.v1beta.ContinuousBackupSource.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.ContinuousBackupSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cluster_ = ""; + pointInTime_ = null; + if (pointInTimeBuilder_ != null) { + pointInTimeBuilder_.dispose(); + pointInTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_ContinuousBackupSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupSource getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.ContinuousBackupSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupSource build() { + com.google.cloud.alloydb.v1beta.ContinuousBackupSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupSource buildPartial() { + com.google.cloud.alloydb.v1beta.ContinuousBackupSource result = + new com.google.cloud.alloydb.v1beta.ContinuousBackupSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.ContinuousBackupSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cluster_ = cluster_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pointInTime_ = + pointInTimeBuilder_ == null ? pointInTime_ : pointInTimeBuilder_.build(); + } + } + + @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.alloydb.v1beta.ContinuousBackupSource) { + return mergeFrom((com.google.cloud.alloydb.v1beta.ContinuousBackupSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.ContinuousBackupSource other) { + if (other == com.google.cloud.alloydb.v1beta.ContinuousBackupSource.getDefaultInstance()) + return this; + if (!other.getCluster().isEmpty()) { + cluster_ = other.cluster_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasPointInTime()) { + mergePointInTime(other.getPointInTime()); + } + 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: + { + cluster_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getPointInTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + 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 cluster_ = ""; + /** + * + * + *
+     * Required. The source cluster from which to restore. This cluster must have
+     * continuous backup enabled for this operation to succeed. For the required
+     * format, see the comment on the Cluster.name field.
+     * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The cluster. + */ + public java.lang.String getCluster() { + java.lang.Object ref = cluster_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cluster_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The source cluster from which to restore. This cluster must have
+     * continuous backup enabled for this operation to succeed. For the required
+     * format, see the comment on the Cluster.name field.
+     * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for cluster. + */ + public com.google.protobuf.ByteString getClusterBytes() { + java.lang.Object ref = cluster_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cluster_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The source cluster from which to restore. This cluster must have
+     * continuous backup enabled for this operation to succeed. For the required
+     * format, see the comment on the Cluster.name field.
+     * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The cluster to set. + * @return This builder for chaining. + */ + public Builder setCluster(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The source cluster from which to restore. This cluster must have
+     * continuous backup enabled for this operation to succeed. For the required
+     * format, see the comment on the Cluster.name field.
+     * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCluster() { + cluster_ = getDefaultInstance().getCluster(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The source cluster from which to restore. This cluster must have
+     * continuous backup enabled for this operation to succeed. For the required
+     * format, see the comment on the Cluster.name field.
+     * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for cluster to set. + * @return This builder for chaining. + */ + public Builder setClusterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + cluster_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp pointInTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + pointInTimeBuilder_; + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pointInTime field is set. + */ + public boolean hasPointInTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pointInTime. + */ + public com.google.protobuf.Timestamp getPointInTime() { + if (pointInTimeBuilder_ == null) { + return pointInTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : pointInTime_; + } else { + return pointInTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPointInTime(com.google.protobuf.Timestamp value) { + if (pointInTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pointInTime_ = value; + } else { + pointInTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPointInTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (pointInTimeBuilder_ == null) { + pointInTime_ = builderForValue.build(); + } else { + pointInTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePointInTime(com.google.protobuf.Timestamp value) { + if (pointInTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && pointInTime_ != null + && pointInTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getPointInTimeBuilder().mergeFrom(value); + } else { + pointInTime_ = value; + } + } else { + pointInTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPointInTime() { + bitField0_ = (bitField0_ & ~0x00000002); + pointInTime_ = null; + if (pointInTimeBuilder_ != null) { + pointInTimeBuilder_.dispose(); + pointInTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getPointInTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getPointInTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder() { + if (pointInTimeBuilder_ != null) { + return pointInTimeBuilder_.getMessageOrBuilder(); + } else { + return pointInTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : pointInTime_; + } + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getPointInTimeFieldBuilder() { + if (pointInTimeBuilder_ == null) { + pointInTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPointInTime(), getParentForChildren(), isClean()); + pointInTime_ = null; + } + return pointInTimeBuilder_; + } + + @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.alloydb.v1beta.ContinuousBackupSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.ContinuousBackupSource) + private static final com.google.cloud.alloydb.v1beta.ContinuousBackupSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.ContinuousBackupSource(); + } + + public static com.google.cloud.alloydb.v1beta.ContinuousBackupSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContinuousBackupSource 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.alloydb.v1beta.ContinuousBackupSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupSourceOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupSourceOrBuilder.java new file mode 100644 index 000000000000..4c0a1e97cacd --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupSourceOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface ContinuousBackupSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.ContinuousBackupSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The source cluster from which to restore. This cluster must have
+   * continuous backup enabled for this operation to succeed. For the required
+   * format, see the comment on the Cluster.name field.
+   * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The cluster. + */ + java.lang.String getCluster(); + /** + * + * + *
+   * Required. The source cluster from which to restore. This cluster must have
+   * continuous backup enabled for this operation to succeed. For the required
+   * format, see the comment on the Cluster.name field.
+   * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for cluster. + */ + com.google.protobuf.ByteString getClusterBytes(); + + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pointInTime field is set. + */ + boolean hasPointInTime(); + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pointInTime. + */ + com.google.protobuf.Timestamp getPointInTime(); + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateBackupRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateBackupRequest.java new file mode 100644 index 000000000000..97673daa5be8 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateBackupRequest.java @@ -0,0 +1,1455 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for creating a Backup
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.CreateBackupRequest} + */ +public final class CreateBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.CreateBackupRequest) + CreateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateBackupRequest.newBuilder() to construct. + private CreateBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateBackupRequest() { + parent_ = ""; + backupId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateBackupRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.CreateBackupRequest.class, + com.google.cloud.alloydb.v1beta.CreateBackupRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * 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. Value for parent.
+   * 
+ * + * + * 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 BACKUP_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + @java.lang.Override + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + 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(); + backupId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1beta.Backup backup_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return backup_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Backup getBackup() { + return backup_ == null ? com.google.cloud.alloydb.v1beta.Backup.getDefaultInstance() : backup_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BackupOrBuilder getBackupOrBuilder() { + return backup_ == null ? com.google.cloud.alloydb.v1beta.Backup.getDefaultInstance() : backup_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, backupId_); + } + if (backup_ != null) { + output.writeMessage(3, getBackup()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, backupId_); + } + if (backup_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBackup()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + 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.alloydb.v1beta.CreateBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.CreateBackupRequest other = + (com.google.cloud.alloydb.v1beta.CreateBackupRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getBackupId().equals(other.getBackupId())) return false; + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + BACKUP_ID_FIELD_NUMBER; + hash = (53 * hash) + getBackupId().hashCode(); + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.CreateBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateBackupRequest 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.alloydb.v1beta.CreateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateBackupRequest 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.alloydb.v1beta.CreateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.CreateBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateBackupRequest 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.alloydb.v1beta.CreateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateBackupRequest 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.alloydb.v1beta.CreateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateBackupRequest 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.alloydb.v1beta.CreateBackupRequest 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; + } + /** + * + * + *
+   * Message for creating a Backup
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.CreateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.CreateBackupRequest) + com.google.cloud.alloydb.v1beta.CreateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.CreateBackupRequest.class, + com.google.cloud.alloydb.v1beta.CreateBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.CreateBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + backupId_ = ""; + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateBackupRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.CreateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateBackupRequest build() { + com.google.cloud.alloydb.v1beta.CreateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateBackupRequest buildPartial() { + com.google.cloud.alloydb.v1beta.CreateBackupRequest result = + new com.google.cloud.alloydb.v1beta.CreateBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.CreateBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backupId_ = backupId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.backup_ = backupBuilder_ == null ? backup_ : backupBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1beta.CreateBackupRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.CreateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.CreateBackupRequest other) { + if (other == com.google.cloud.alloydb.v1beta.CreateBackupRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getBackupId().isEmpty()) { + backupId_ = other.backupId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + backupId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getBackupFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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. Value for parent.
+     * 
+ * + * + * 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. Value for parent.
+     * 
+ * + * + * 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. Value for parent.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object backupId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearBackupId() { + backupId_ = getDefaultInstance().getBackupId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1beta.Backup backup_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Backup, + com.google.cloud.alloydb.v1beta.Backup.Builder, + com.google.cloud.alloydb.v1beta.BackupOrBuilder> + backupBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.cloud.alloydb.v1beta.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null + ? com.google.cloud.alloydb.v1beta.Backup.getDefaultInstance() + : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.alloydb.v1beta.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + } else { + backupBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.alloydb.v1beta.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.cloud.alloydb.v1beta.Backup value) { + if (backupBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && backup_ != null + && backup_ != com.google.cloud.alloydb.v1beta.Backup.getDefaultInstance()) { + getBackupBuilder().mergeFrom(value); + } else { + backup_ = value; + } + } else { + backupBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + bitField0_ = (bitField0_ & ~0x00000004); + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.Backup.Builder getBackupBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getBackupFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null + ? com.google.cloud.alloydb.v1beta.Backup.getDefaultInstance() + : backup_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Backup, + com.google.cloud.alloydb.v1beta.Backup.Builder, + com.google.cloud.alloydb.v1beta.BackupOrBuilder> + getBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Backup, + com.google.cloud.alloydb.v1beta.Backup.Builder, + com.google.cloud.alloydb.v1beta.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = 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.alloydb.v1beta.CreateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.CreateBackupRequest) + private static final com.google.cloud.alloydb.v1beta.CreateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.CreateBackupRequest(); + } + + public static com.google.cloud.alloydb.v1beta.CreateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBackupRequest 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.alloydb.v1beta.CreateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateBackupRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateBackupRequestOrBuilder.java new file mode 100644 index 000000000000..291a84206cdc --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateBackupRequestOrBuilder.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/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface CreateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.CreateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + java.lang.String getBackupId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + com.google.protobuf.ByteString getBackupIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.cloud.alloydb.v1beta.Backup getBackup(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1beta.BackupOrBuilder getBackupOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateClusterRequest.java new file mode 100644 index 000000000000..d9b1206d7c10 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateClusterRequest.java @@ -0,0 +1,1473 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for creating a Cluster
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.CreateClusterRequest} + */ +public final class CreateClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.CreateClusterRequest) + CreateClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateClusterRequest.newBuilder() to construct. + private CreateClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateClusterRequest() { + parent_ = ""; + clusterId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateClusterRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.CreateClusterRequest.class, + com.google.cloud.alloydb.v1beta.CreateClusterRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 CLUSTER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + @java.lang.Override + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + 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(); + clusterId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1beta.Cluster cluster_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + @java.lang.Override + public boolean hasCluster() { + return cluster_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster getCluster() { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clusterId_); + } + if (cluster_ != null) { + output.writeMessage(3, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clusterId_); + } + if (cluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + 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.alloydb.v1beta.CreateClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.CreateClusterRequest other = + (com.google.cloud.alloydb.v1beta.CreateClusterRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getClusterId().equals(other.getClusterId())) return false; + if (hasCluster() != other.hasCluster()) return false; + if (hasCluster()) { + if (!getCluster().equals(other.getCluster())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getClusterId().hashCode(); + if (hasCluster()) { + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.CreateClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateClusterRequest 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.alloydb.v1beta.CreateClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateClusterRequest 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.alloydb.v1beta.CreateClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.CreateClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateClusterRequest 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.alloydb.v1beta.CreateClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateClusterRequest 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.alloydb.v1beta.CreateClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateClusterRequest 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.alloydb.v1beta.CreateClusterRequest 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; + } + /** + * + * + *
+   * Message for creating a Cluster
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.CreateClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.CreateClusterRequest) + com.google.cloud.alloydb.v1beta.CreateClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.CreateClusterRequest.class, + com.google.cloud.alloydb.v1beta.CreateClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.CreateClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + clusterId_ = ""; + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.CreateClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateClusterRequest build() { + com.google.cloud.alloydb.v1beta.CreateClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateClusterRequest buildPartial() { + com.google.cloud.alloydb.v1beta.CreateClusterRequest result = + new com.google.cloud.alloydb.v1beta.CreateClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.CreateClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterId_ = clusterId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1beta.CreateClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.CreateClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.CreateClusterRequest other) { + if (other == com.google.cloud.alloydb.v1beta.CreateClusterRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getClusterId().isEmpty()) { + clusterId_ = other.clusterId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCluster()) { + mergeCluster(other.getCluster()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + clusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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 name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object clusterId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearClusterId() { + clusterId_ = getDefaultInstance().getClusterId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1beta.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster, + com.google.cloud.alloydb.v1beta.Cluster.Builder, + com.google.cloud.alloydb.v1beta.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.alloydb.v1beta.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1beta.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1beta.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.alloydb.v1beta.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCluster() { + bitField0_ = (bitField0_ & ~0x00000004); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster, + com.google.cloud.alloydb.v1beta.Cluster.Builder, + com.google.cloud.alloydb.v1beta.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster, + com.google.cloud.alloydb.v1beta.Cluster.Builder, + com.google.cloud.alloydb.v1beta.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = 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.alloydb.v1beta.CreateClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.CreateClusterRequest) + private static final com.google.cloud.alloydb.v1beta.CreateClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.CreateClusterRequest(); + } + + public static com.google.cloud.alloydb.v1beta.CreateClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateClusterRequest 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.alloydb.v1beta.CreateClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateClusterRequestOrBuilder.java new file mode 100644 index 000000000000..3414cd40a066 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateClusterRequestOrBuilder.java @@ -0,0 +1,182 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface CreateClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.CreateClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.alloydb.v1beta.Cluster getCluster(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1beta.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateInstanceRequest.java new file mode 100644 index 000000000000..992411e35b44 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateInstanceRequest.java @@ -0,0 +1,1474 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for creating a Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.CreateInstanceRequest} + */ +public final class CreateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.CreateInstanceRequest) + CreateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateInstanceRequest.newBuilder() to construct. + private CreateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateInstanceRequest() { + parent_ = ""; + instanceId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateInstanceRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.CreateInstanceRequest.class, + com.google.cloud.alloydb.v1beta.CreateInstanceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 INSTANCE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + @java.lang.Override + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + 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(); + instanceId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1beta.Instance instance_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return instance_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance getInstance() { + return instance_ == null + ? com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.InstanceOrBuilder getInstanceOrBuilder() { + return instance_ == null + ? com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance() + : instance_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, instanceId_); + } + if (instance_ != null) { + output.writeMessage(3, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, instanceId_); + } + if (instance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + 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.alloydb.v1beta.CreateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.CreateInstanceRequest other = + (com.google.cloud.alloydb.v1beta.CreateInstanceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequest 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.alloydb.v1beta.CreateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequest 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.alloydb.v1beta.CreateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequest 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.alloydb.v1beta.CreateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequest 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.alloydb.v1beta.CreateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequest 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.alloydb.v1beta.CreateInstanceRequest 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; + } + /** + * + * + *
+   * Message for creating a Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.CreateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.CreateInstanceRequest) + com.google.cloud.alloydb.v1beta.CreateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.CreateInstanceRequest.class, + com.google.cloud.alloydb.v1beta.CreateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.CreateInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + instanceId_ = ""; + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.CreateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateInstanceRequest build() { + com.google.cloud.alloydb.v1beta.CreateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1beta.CreateInstanceRequest result = + new com.google.cloud.alloydb.v1beta.CreateInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.CreateInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceId_ = instanceId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1beta.CreateInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.CreateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.CreateInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1beta.CreateInstanceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instanceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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 name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instanceId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + instanceId_ = getDefaultInstance().getInstanceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1beta.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance, + com.google.cloud.alloydb.v1beta.Instance.Builder, + com.google.cloud.alloydb.v1beta.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.alloydb.v1beta.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1beta.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + } else { + instanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1beta.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.alloydb.v1beta.Instance value) { + if (instanceBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && instance_ != null + && instance_ != com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); + } else { + instance_ = value; + } + } else { + instanceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + bitField0_ = (bitField0_ & ~0x00000004); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.Instance.Builder getInstanceBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance, + com.google.cloud.alloydb.v1beta.Instance.Builder, + com.google.cloud.alloydb.v1beta.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance, + com.google.cloud.alloydb.v1beta.Instance.Builder, + com.google.cloud.alloydb.v1beta.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = 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.alloydb.v1beta.CreateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.CreateInstanceRequest) + private static final com.google.cloud.alloydb.v1beta.CreateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.CreateInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateInstanceRequest 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.alloydb.v1beta.CreateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..46536e533cb6 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateInstanceRequestOrBuilder.java @@ -0,0 +1,182 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface CreateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.CreateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.alloydb.v1beta.Instance getInstance(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1beta.InstanceOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateInstanceRequests.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateInstanceRequests.java new file mode 100644 index 000000000000..665dd54386c3 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateInstanceRequests.java @@ -0,0 +1,1035 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * See usage below for notes.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.CreateInstanceRequests} + */ +public final class CreateInstanceRequests extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.CreateInstanceRequests) + CreateInstanceRequestsOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateInstanceRequests.newBuilder() to construct. + private CreateInstanceRequests(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateInstanceRequests() { + createInstanceRequests_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateInstanceRequests(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequests_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequests_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.CreateInstanceRequests.class, + com.google.cloud.alloydb.v1beta.CreateInstanceRequests.Builder.class); + } + + public static final int CREATE_INSTANCE_REQUESTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + createInstanceRequests_; + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getCreateInstanceRequestsList() { + return createInstanceRequests_; + } + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getCreateInstanceRequestsOrBuilderList() { + return createInstanceRequests_; + } + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getCreateInstanceRequestsCount() { + return createInstanceRequests_.size(); + } + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateInstanceRequest getCreateInstanceRequests( + int index) { + return createInstanceRequests_.get(index); + } + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateInstanceRequestOrBuilder + getCreateInstanceRequestsOrBuilder(int index) { + return createInstanceRequests_.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 < createInstanceRequests_.size(); i++) { + output.writeMessage(1, createInstanceRequests_.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 < createInstanceRequests_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, createInstanceRequests_.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.alloydb.v1beta.CreateInstanceRequests)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.CreateInstanceRequests other = + (com.google.cloud.alloydb.v1beta.CreateInstanceRequests) obj; + + if (!getCreateInstanceRequestsList().equals(other.getCreateInstanceRequestsList())) + 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 (getCreateInstanceRequestsCount() > 0) { + hash = (37 * hash) + CREATE_INSTANCE_REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getCreateInstanceRequestsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequests parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequests 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.alloydb.v1beta.CreateInstanceRequests parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequests 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.alloydb.v1beta.CreateInstanceRequests parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequests parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequests parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequests 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.alloydb.v1beta.CreateInstanceRequests parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequests 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.alloydb.v1beta.CreateInstanceRequests parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequests 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.alloydb.v1beta.CreateInstanceRequests 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; + } + /** + * + * + *
+   * See usage below for notes.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.CreateInstanceRequests} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.CreateInstanceRequests) + com.google.cloud.alloydb.v1beta.CreateInstanceRequestsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequests_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequests_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.CreateInstanceRequests.class, + com.google.cloud.alloydb.v1beta.CreateInstanceRequests.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.CreateInstanceRequests.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (createInstanceRequestsBuilder_ == null) { + createInstanceRequests_ = java.util.Collections.emptyList(); + } else { + createInstanceRequests_ = null; + createInstanceRequestsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequests_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateInstanceRequests getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.CreateInstanceRequests.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateInstanceRequests build() { + com.google.cloud.alloydb.v1beta.CreateInstanceRequests result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateInstanceRequests buildPartial() { + com.google.cloud.alloydb.v1beta.CreateInstanceRequests result = + new com.google.cloud.alloydb.v1beta.CreateInstanceRequests(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1beta.CreateInstanceRequests result) { + if (createInstanceRequestsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + createInstanceRequests_ = java.util.Collections.unmodifiableList(createInstanceRequests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.createInstanceRequests_ = createInstanceRequests_; + } else { + result.createInstanceRequests_ = createInstanceRequestsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.CreateInstanceRequests result) { + int from_bitField0_ = bitField0_; + } + + @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.alloydb.v1beta.CreateInstanceRequests) { + return mergeFrom((com.google.cloud.alloydb.v1beta.CreateInstanceRequests) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.CreateInstanceRequests other) { + if (other == com.google.cloud.alloydb.v1beta.CreateInstanceRequests.getDefaultInstance()) + return this; + if (createInstanceRequestsBuilder_ == null) { + if (!other.createInstanceRequests_.isEmpty()) { + if (createInstanceRequests_.isEmpty()) { + createInstanceRequests_ = other.createInstanceRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.addAll(other.createInstanceRequests_); + } + onChanged(); + } + } else { + if (!other.createInstanceRequests_.isEmpty()) { + if (createInstanceRequestsBuilder_.isEmpty()) { + createInstanceRequestsBuilder_.dispose(); + createInstanceRequestsBuilder_ = null; + createInstanceRequests_ = other.createInstanceRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + createInstanceRequestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCreateInstanceRequestsFieldBuilder() + : null; + } else { + createInstanceRequestsBuilder_.addAllMessages(other.createInstanceRequests_); + } + } + } + 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.alloydb.v1beta.CreateInstanceRequest m = + input.readMessage( + com.google.cloud.alloydb.v1beta.CreateInstanceRequest.parser(), + extensionRegistry); + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.add(m); + } else { + createInstanceRequestsBuilder_.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 + createInstanceRequests_ = java.util.Collections.emptyList(); + + private void ensureCreateInstanceRequestsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + createInstanceRequests_ = + new java.util.ArrayList( + createInstanceRequests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.CreateInstanceRequest, + com.google.cloud.alloydb.v1beta.CreateInstanceRequest.Builder, + com.google.cloud.alloydb.v1beta.CreateInstanceRequestOrBuilder> + createInstanceRequestsBuilder_; + + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getCreateInstanceRequestsList() { + if (createInstanceRequestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(createInstanceRequests_); + } else { + return createInstanceRequestsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getCreateInstanceRequestsCount() { + if (createInstanceRequestsBuilder_ == null) { + return createInstanceRequests_.size(); + } else { + return createInstanceRequestsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.CreateInstanceRequest getCreateInstanceRequests( + int index) { + if (createInstanceRequestsBuilder_ == null) { + return createInstanceRequests_.get(index); + } else { + return createInstanceRequestsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCreateInstanceRequests( + int index, com.google.cloud.alloydb.v1beta.CreateInstanceRequest value) { + if (createInstanceRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.set(index, value); + onChanged(); + } else { + createInstanceRequestsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCreateInstanceRequests( + int index, com.google.cloud.alloydb.v1beta.CreateInstanceRequest.Builder builderForValue) { + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.set(index, builderForValue.build()); + onChanged(); + } else { + createInstanceRequestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCreateInstanceRequests( + com.google.cloud.alloydb.v1beta.CreateInstanceRequest value) { + if (createInstanceRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.add(value); + onChanged(); + } else { + createInstanceRequestsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCreateInstanceRequests( + int index, com.google.cloud.alloydb.v1beta.CreateInstanceRequest value) { + if (createInstanceRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.add(index, value); + onChanged(); + } else { + createInstanceRequestsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCreateInstanceRequests( + com.google.cloud.alloydb.v1beta.CreateInstanceRequest.Builder builderForValue) { + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.add(builderForValue.build()); + onChanged(); + } else { + createInstanceRequestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCreateInstanceRequests( + int index, com.google.cloud.alloydb.v1beta.CreateInstanceRequest.Builder builderForValue) { + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.add(index, builderForValue.build()); + onChanged(); + } else { + createInstanceRequestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllCreateInstanceRequests( + java.lang.Iterable + values) { + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, createInstanceRequests_); + onChanged(); + } else { + createInstanceRequestsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCreateInstanceRequests() { + if (createInstanceRequestsBuilder_ == null) { + createInstanceRequests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + createInstanceRequestsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeCreateInstanceRequests(int index) { + if (createInstanceRequestsBuilder_ == null) { + ensureCreateInstanceRequestsIsMutable(); + createInstanceRequests_.remove(index); + onChanged(); + } else { + createInstanceRequestsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.CreateInstanceRequest.Builder + getCreateInstanceRequestsBuilder(int index) { + return getCreateInstanceRequestsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.CreateInstanceRequestOrBuilder + getCreateInstanceRequestsOrBuilder(int index) { + if (createInstanceRequestsBuilder_ == null) { + return createInstanceRequests_.get(index); + } else { + return createInstanceRequestsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getCreateInstanceRequestsOrBuilderList() { + if (createInstanceRequestsBuilder_ != null) { + return createInstanceRequestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(createInstanceRequests_); + } + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.CreateInstanceRequest.Builder + addCreateInstanceRequestsBuilder() { + return getCreateInstanceRequestsFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1beta.CreateInstanceRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.CreateInstanceRequest.Builder + addCreateInstanceRequestsBuilder(int index) { + return getCreateInstanceRequestsFieldBuilder() + .addBuilder( + index, com.google.cloud.alloydb.v1beta.CreateInstanceRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Primary and read replica instances to be created. This list
+     * should not be empty.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getCreateInstanceRequestsBuilderList() { + return getCreateInstanceRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.CreateInstanceRequest, + com.google.cloud.alloydb.v1beta.CreateInstanceRequest.Builder, + com.google.cloud.alloydb.v1beta.CreateInstanceRequestOrBuilder> + getCreateInstanceRequestsFieldBuilder() { + if (createInstanceRequestsBuilder_ == null) { + createInstanceRequestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.CreateInstanceRequest, + com.google.cloud.alloydb.v1beta.CreateInstanceRequest.Builder, + com.google.cloud.alloydb.v1beta.CreateInstanceRequestOrBuilder>( + createInstanceRequests_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + createInstanceRequests_ = null; + } + return createInstanceRequestsBuilder_; + } + + @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.alloydb.v1beta.CreateInstanceRequests) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.CreateInstanceRequests) + private static final com.google.cloud.alloydb.v1beta.CreateInstanceRequests DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.CreateInstanceRequests(); + } + + public static com.google.cloud.alloydb.v1beta.CreateInstanceRequests getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateInstanceRequests 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.alloydb.v1beta.CreateInstanceRequests getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateInstanceRequestsOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateInstanceRequestsOrBuilder.java new file mode 100644 index 000000000000..b643c890ffde --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateInstanceRequestsOrBuilder.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/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface CreateInstanceRequestsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.CreateInstanceRequests) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getCreateInstanceRequestsList(); + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1beta.CreateInstanceRequest getCreateInstanceRequests(int index); + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getCreateInstanceRequestsCount(); + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getCreateInstanceRequestsOrBuilderList(); + /** + * + * + *
+   * Required. Primary and read replica instances to be created. This list
+   * should not be empty.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1beta.CreateInstanceRequestOrBuilder getCreateInstanceRequestsOrBuilder( + int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryClusterRequest.java new file mode 100644 index 000000000000..ced2af0f4328 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryClusterRequest.java @@ -0,0 +1,1462 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** Protobuf type {@code google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} */ +public final class CreateSecondaryClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest) + CreateSecondaryClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSecondaryClusterRequest.newBuilder() to construct. + private CreateSecondaryClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSecondaryClusterRequest() { + parent_ = ""; + clusterId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSecondaryClusterRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateSecondaryClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateSecondaryClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.class, + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource (the primary cluster). For the
+   * required format, see the comment on the Cluster.name field.
+   * 
+ * + * + * 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 parent resource (the primary cluster). For the
+   * required format, see the comment on the Cluster.name field.
+   * 
+ * + * + * 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 CLUSTER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object (the secondary cluster).
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + @java.lang.Override + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + 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(); + clusterId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object (the secondary cluster).
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1beta.Cluster cluster_; + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + @java.lang.Override + public boolean hasCluster() { + return cluster_ != null; + } + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster getCluster() { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 6; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clusterId_); + } + if (cluster_ != null) { + output.writeMessage(3, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(6, validateOnly_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clusterId_); + } + if (cluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, validateOnly_); + } + 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.alloydb.v1beta.CreateSecondaryClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest other = + (com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getClusterId().equals(other.getClusterId())) return false; + if (hasCluster() != other.hasCluster()) return false; + if (hasCluster()) { + if (!getCluster().equals(other.getCluster())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getClusterId().hashCode(); + if (hasCluster()) { + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest 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.alloydb.v1beta.CreateSecondaryClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest 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.alloydb.v1beta.CreateSecondaryClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest 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.alloydb.v1beta.CreateSecondaryClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest 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.alloydb.v1beta.CreateSecondaryClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest 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.alloydb.v1beta.CreateSecondaryClusterRequest 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.alloydb.v1beta.CreateSecondaryClusterRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest) + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateSecondaryClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateSecondaryClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.class, + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + clusterId_ = ""; + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateSecondaryClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest build() { + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest buildPartial() { + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest result = + new com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterId_ = clusterId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1beta.CreateSecondaryClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest other) { + if (other + == com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getClusterId().isEmpty()) { + clusterId_ = other.clusterId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCluster()) { + mergeCluster(other.getCluster()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + clusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 48: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 48 + 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 name of the parent resource (the primary cluster). For the
+     * required format, see the comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource (the primary cluster). For the
+     * required format, see the comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource (the primary cluster). For the
+     * required format, see the comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource (the primary cluster). For the
+     * required format, see the comment on the Cluster.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource (the primary cluster). For the
+     * required format, see the comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object clusterId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object (the secondary cluster).
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object (the secondary cluster).
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object (the secondary cluster).
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object (the secondary cluster).
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearClusterId() { + clusterId_ = getDefaultInstance().getClusterId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object (the secondary cluster).
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1beta.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster, + com.google.cloud.alloydb.v1beta.Cluster.Builder, + com.google.cloud.alloydb.v1beta.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.alloydb.v1beta.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1beta.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1beta.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.alloydb.v1beta.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCluster() { + bitField0_ = (bitField0_ & ~0x00000004); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster, + com.google.cloud.alloydb.v1beta.Cluster.Builder, + com.google.cloud.alloydb.v1beta.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster, + com.google.cloud.alloydb.v1beta.Cluster.Builder, + com.google.cloud.alloydb.v1beta.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = 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.alloydb.v1beta.CreateSecondaryClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest) + private static final com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest(); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSecondaryClusterRequest 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.alloydb.v1beta.CreateSecondaryClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryClusterRequestOrBuilder.java new file mode 100644 index 000000000000..fd59120c0f0f --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryClusterRequestOrBuilder.java @@ -0,0 +1,182 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface CreateSecondaryClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource (the primary cluster). For the
+   * required format, see the comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource (the primary cluster). For the
+   * required format, see the comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object (the secondary cluster).
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + /** + * + * + *
+   * Required. ID of the requesting object (the secondary cluster).
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.alloydb.v1beta.Cluster getCluster(); + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1beta.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryInstanceRequest.java new file mode 100644 index 000000000000..361f65ae232d --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryInstanceRequest.java @@ -0,0 +1,1481 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for creating a Secondary Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} + */ +public final class CreateSecondaryInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest) + CreateSecondaryInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSecondaryInstanceRequest.newBuilder() to construct. + private CreateSecondaryInstanceRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSecondaryInstanceRequest() { + parent_ = ""; + instanceId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSecondaryInstanceRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateSecondaryInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateSecondaryInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.class, + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 INSTANCE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + @java.lang.Override + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + 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(); + instanceId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1beta.Instance instance_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return instance_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance getInstance() { + return instance_ == null + ? com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.InstanceOrBuilder getInstanceOrBuilder() { + return instance_ == null + ? com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance() + : instance_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, instanceId_); + } + if (instance_ != null) { + output.writeMessage(3, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, instanceId_); + } + if (instance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + 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.alloydb.v1beta.CreateSecondaryInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest other = + (com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest 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.alloydb.v1beta.CreateSecondaryInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest 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.alloydb.v1beta.CreateSecondaryInstanceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest 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.alloydb.v1beta.CreateSecondaryInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest 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.alloydb.v1beta.CreateSecondaryInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest 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.alloydb.v1beta.CreateSecondaryInstanceRequest 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; + } + /** + * + * + *
+   * Message for creating a Secondary Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest) + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateSecondaryInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateSecondaryInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.class, + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + instanceId_ = ""; + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateSecondaryInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest build() { + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest result = + new com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceId_ = instanceId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1beta.CreateSecondaryInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest other) { + if (other + == com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instanceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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 name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instanceId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + instanceId_ = getDefaultInstance().getInstanceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1beta.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance, + com.google.cloud.alloydb.v1beta.Instance.Builder, + com.google.cloud.alloydb.v1beta.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.alloydb.v1beta.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1beta.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + } else { + instanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1beta.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.alloydb.v1beta.Instance value) { + if (instanceBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && instance_ != null + && instance_ != com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); + } else { + instance_ = value; + } + } else { + instanceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + bitField0_ = (bitField0_ & ~0x00000004); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.Instance.Builder getInstanceBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance, + com.google.cloud.alloydb.v1beta.Instance.Builder, + com.google.cloud.alloydb.v1beta.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance, + com.google.cloud.alloydb.v1beta.Instance.Builder, + com.google.cloud.alloydb.v1beta.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the create
+     * request.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = 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.alloydb.v1beta.CreateSecondaryInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest) + private static final com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSecondaryInstanceRequest 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.alloydb.v1beta.CreateSecondaryInstanceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..8d3bb59bc5f6 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryInstanceRequestOrBuilder.java @@ -0,0 +1,182 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface CreateSecondaryInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.alloydb.v1beta.Instance getInstance(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1beta.InstanceOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DatabaseVersion.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DatabaseVersion.java new file mode 100644 index 000000000000..2e9af81cac09 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DatabaseVersion.java @@ -0,0 +1,177 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * The supported database engine versions.
+ * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.DatabaseVersion} + */ +public enum DatabaseVersion implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown database version.
+   * 
+ * + * DATABASE_VERSION_UNSPECIFIED = 0; + */ + DATABASE_VERSION_UNSPECIFIED(0), + /** + * + * + *
+   * DEPRECATED - The database version is Postgres 13.
+   * 
+ * + * POSTGRES_13 = 1 [deprecated = true]; + */ + @java.lang.Deprecated + POSTGRES_13(1), + /** + * + * + *
+   * The database version is Postgres 14.
+   * 
+ * + * POSTGRES_14 = 2; + */ + POSTGRES_14(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * This is an unknown database version.
+   * 
+ * + * DATABASE_VERSION_UNSPECIFIED = 0; + */ + public static final int DATABASE_VERSION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * DEPRECATED - The database version is Postgres 13.
+   * 
+ * + * POSTGRES_13 = 1 [deprecated = true]; + */ + @java.lang.Deprecated public static final int POSTGRES_13_VALUE = 1; + /** + * + * + *
+   * The database version is Postgres 14.
+   * 
+ * + * POSTGRES_14 = 2; + */ + public static final int POSTGRES_14_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 DatabaseVersion 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 DatabaseVersion forNumber(int value) { + switch (value) { + case 0: + return DATABASE_VERSION_UNSPECIFIED; + case 1: + return POSTGRES_13; + case 2: + return POSTGRES_14; + 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 DatabaseVersion findValueByNumber(int number) { + return DatabaseVersion.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.alloydb.v1beta.ResourcesProto.getDescriptor().getEnumTypes().get(0); + } + + private static final DatabaseVersion[] VALUES = values(); + + public static DatabaseVersion 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 DatabaseVersion(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.DatabaseVersion) +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteBackupRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteBackupRequest.java new file mode 100644 index 000000000000..d020f4d0693b --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteBackupRequest.java @@ -0,0 +1,1195 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for deleting a Backup
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.DeleteBackupRequest} + */ +public final class DeleteBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.DeleteBackupRequest) + DeleteBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteBackupRequest.newBuilder() to construct. + private DeleteBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteBackupRequest() { + name_ = ""; + requestId_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteBackupRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.DeleteBackupRequest.class, + com.google.cloud.alloydb.v1beta.DeleteBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource. For the required format, see the comment on
+   * the Backup.name field.
+   * 
+ * + * + * 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. Name of the resource. For the required format, see the comment on
+   * the Backup.name field.
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ETAG_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. The current etag of the Backup.
+   * If an etag is provided and does not match the current etag of the Backup,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The current etag of the Backup.
+   * If an etag is provided and does not match the current etag of the Backup,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, etag_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, etag_); + } + 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.alloydb.v1beta.DeleteBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.DeleteBackupRequest other = + (com.google.cloud.alloydb.v1beta.DeleteBackupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getEtag().equals(other.getEtag())) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.DeleteBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.DeleteBackupRequest 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.alloydb.v1beta.DeleteBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.DeleteBackupRequest 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.alloydb.v1beta.DeleteBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.DeleteBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.DeleteBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.DeleteBackupRequest 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.alloydb.v1beta.DeleteBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.DeleteBackupRequest 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.alloydb.v1beta.DeleteBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.DeleteBackupRequest 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.alloydb.v1beta.DeleteBackupRequest 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; + } + /** + * + * + *
+   * Message for deleting a Backup
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.DeleteBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.DeleteBackupRequest) + com.google.cloud.alloydb.v1beta.DeleteBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.DeleteBackupRequest.class, + com.google.cloud.alloydb.v1beta.DeleteBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.DeleteBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + validateOnly_ = false; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DeleteBackupRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.DeleteBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DeleteBackupRequest build() { + com.google.cloud.alloydb.v1beta.DeleteBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DeleteBackupRequest buildPartial() { + com.google.cloud.alloydb.v1beta.DeleteBackupRequest result = + new com.google.cloud.alloydb.v1beta.DeleteBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.DeleteBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.etag_ = etag_; + } + } + + @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.alloydb.v1beta.DeleteBackupRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.DeleteBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.DeleteBackupRequest other) { + if (other == com.google.cloud.alloydb.v1beta.DeleteBackupRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000008; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the resource. For the required format, see the comment on
+     * the Backup.name field.
+     * 
+ * + * + * 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. Name of the resource. For the required format, see the comment on
+     * the Backup.name field.
+     * 
+ * + * + * 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. Name of the resource. For the required format, see the comment on
+     * the Backup.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource. For the required format, see the comment on
+     * the Backup.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource. For the required format, see the comment on
+     * the Backup.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The current etag of the Backup.
+     * If an etag is provided and does not match the current etag of the Backup,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Backup.
+     * If an etag is provided and does not match the current etag of the Backup,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Backup.
+     * If an etag is provided and does not match the current etag of the Backup,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Backup.
+     * If an etag is provided and does not match the current etag of the Backup,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Backup.
+     * If an etag is provided and does not match the current etag of the Backup,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000008; + 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.alloydb.v1beta.DeleteBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.DeleteBackupRequest) + private static final com.google.cloud.alloydb.v1beta.DeleteBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.DeleteBackupRequest(); + } + + public static com.google.cloud.alloydb.v1beta.DeleteBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBackupRequest 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.alloydb.v1beta.DeleteBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteBackupRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteBackupRequestOrBuilder.java new file mode 100644 index 000000000000..fa949687e0cc --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteBackupRequestOrBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface DeleteBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.DeleteBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource. For the required format, see the comment on
+   * the Backup.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource. For the required format, see the comment on
+   * the Backup.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. The current etag of the Backup.
+   * If an etag is provided and does not match the current etag of the Backup,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The current etag of the Backup.
+   * If an etag is provided and does not match the current etag of the Backup,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteClusterRequest.java new file mode 100644 index 000000000000..ced3f082474b --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteClusterRequest.java @@ -0,0 +1,1288 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for deleting a Cluster
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.DeleteClusterRequest} + */ +public final class DeleteClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.DeleteClusterRequest) + DeleteClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteClusterRequest.newBuilder() to construct. + private DeleteClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteClusterRequest() { + name_ = ""; + requestId_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteClusterRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.DeleteClusterRequest.class, + com.google.cloud.alloydb.v1beta.DeleteClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int FORCE_FIELD_NUMBER = 5; + private boolean force_ = false; + /** + * + * + *
+   * Optional. Whether to cascade delete child instances for given cluster.
+   * 
+ * + * bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (force_ != false) { + output.writeBool(5, force_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, force_); + } + 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.alloydb.v1beta.DeleteClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.DeleteClusterRequest other = + (com.google.cloud.alloydb.v1beta.DeleteClusterRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getForce() != other.getForce()) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.DeleteClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.DeleteClusterRequest 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.alloydb.v1beta.DeleteClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.DeleteClusterRequest 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.alloydb.v1beta.DeleteClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.DeleteClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.DeleteClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.DeleteClusterRequest 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.alloydb.v1beta.DeleteClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.DeleteClusterRequest 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.alloydb.v1beta.DeleteClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.DeleteClusterRequest 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.alloydb.v1beta.DeleteClusterRequest 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; + } + /** + * + * + *
+   * Message for deleting a Cluster
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.DeleteClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.DeleteClusterRequest) + com.google.cloud.alloydb.v1beta.DeleteClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.DeleteClusterRequest.class, + com.google.cloud.alloydb.v1beta.DeleteClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.DeleteClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + etag_ = ""; + validateOnly_ = false; + force_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DeleteClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.DeleteClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DeleteClusterRequest build() { + com.google.cloud.alloydb.v1beta.DeleteClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DeleteClusterRequest buildPartial() { + com.google.cloud.alloydb.v1beta.DeleteClusterRequest result = + new com.google.cloud.alloydb.v1beta.DeleteClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.DeleteClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.force_ = force_; + } + } + + @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.alloydb.v1beta.DeleteClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.DeleteClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.DeleteClusterRequest other) { + if (other == com.google.cloud.alloydb.v1beta.DeleteClusterRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + force_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * Optional. Whether to cascade delete child instances for given cluster.
+     * 
+ * + * bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * Optional. Whether to cascade delete child instances for given cluster.
+     * 
+ * + * bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Whether to cascade delete child instances for given cluster.
+     * 
+ * + * bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + bitField0_ = (bitField0_ & ~0x00000010); + force_ = 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.alloydb.v1beta.DeleteClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.DeleteClusterRequest) + private static final com.google.cloud.alloydb.v1beta.DeleteClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.DeleteClusterRequest(); + } + + public static com.google.cloud.alloydb.v1beta.DeleteClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteClusterRequest 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.alloydb.v1beta.DeleteClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteClusterRequestOrBuilder.java new file mode 100644 index 000000000000..a0893bd51afb --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteClusterRequestOrBuilder.java @@ -0,0 +1,157 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface DeleteClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.DeleteClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. Whether to cascade delete child instances for given cluster.
+   * 
+ * + * bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteInstanceRequest.java new file mode 100644 index 000000000000..392a1cb5b5e6 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteInstanceRequest.java @@ -0,0 +1,1196 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for deleting a Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.DeleteInstanceRequest} + */ +public final class DeleteInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.DeleteInstanceRequest) + DeleteInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteInstanceRequest.newBuilder() to construct. + private DeleteInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteInstanceRequest() { + name_ = ""; + requestId_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteInstanceRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.DeleteInstanceRequest.class, + com.google.cloud.alloydb.v1beta.DeleteInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. The current etag of the Instance.
+   * If an etag is provided and does not match the current etag of the Instance,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The current etag of the Instance.
+   * If an etag is provided and does not match the current etag of the Instance,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + 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.alloydb.v1beta.DeleteInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.DeleteInstanceRequest other = + (com.google.cloud.alloydb.v1beta.DeleteInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.DeleteInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.DeleteInstanceRequest 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.alloydb.v1beta.DeleteInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.DeleteInstanceRequest 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.alloydb.v1beta.DeleteInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.DeleteInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.DeleteInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.DeleteInstanceRequest 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.alloydb.v1beta.DeleteInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.DeleteInstanceRequest 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.alloydb.v1beta.DeleteInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.DeleteInstanceRequest 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.alloydb.v1beta.DeleteInstanceRequest 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; + } + /** + * + * + *
+   * Message for deleting a Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.DeleteInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.DeleteInstanceRequest) + com.google.cloud.alloydb.v1beta.DeleteInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.DeleteInstanceRequest.class, + com.google.cloud.alloydb.v1beta.DeleteInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.DeleteInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + etag_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DeleteInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.DeleteInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DeleteInstanceRequest build() { + com.google.cloud.alloydb.v1beta.DeleteInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DeleteInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1beta.DeleteInstanceRequest result = + new com.google.cloud.alloydb.v1beta.DeleteInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.DeleteInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1beta.DeleteInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.DeleteInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.DeleteInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1beta.DeleteInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The current etag of the Instance.
+     * If an etag is provided and does not match the current etag of the Instance,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Instance.
+     * If an etag is provided and does not match the current etag of the Instance,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Instance.
+     * If an etag is provided and does not match the current etag of the Instance,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Instance.
+     * If an etag is provided and does not match the current etag of the Instance,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Instance.
+     * If an etag is provided and does not match the current etag of the Instance,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = 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.alloydb.v1beta.DeleteInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.DeleteInstanceRequest) + private static final com.google.cloud.alloydb.v1beta.DeleteInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.DeleteInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1beta.DeleteInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteInstanceRequest 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.alloydb.v1beta.DeleteInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..a1ab314addda --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteInstanceRequestOrBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface DeleteInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.DeleteInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. The current etag of the Instance.
+   * If an etag is provided and does not match the current etag of the Instance,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The current etag of the Instance.
+   * If an etag is provided and does not match the current etag of the Instance,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/EncryptionConfig.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/EncryptionConfig.java new file mode 100644 index 000000000000..b5d913ba98f9 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/EncryptionConfig.java @@ -0,0 +1,645 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * EncryptionConfig describes the encryption config of a cluster or a backup
+ * that is encrypted with a CMEK (customer-managed encryption key).
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.EncryptionConfig} + */ +public final class EncryptionConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.EncryptionConfig) + EncryptionConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use EncryptionConfig.newBuilder() to construct. + private EncryptionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EncryptionConfig() { + kmsKeyName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EncryptionConfig(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_EncryptionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_EncryptionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.EncryptionConfig.class, + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder.class); + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+   * The fully-qualified resource name of the KMS key.
+   * Each Cloud KMS key is regionalized and has the following format:
+   * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+   * 
+ * + * string kms_key_name = 1; + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + 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(); + kmsKeyName_ = s; + return s; + } + } + /** + * + * + *
+   * The fully-qualified resource name of the KMS key.
+   * Each Cloud KMS key is regionalized and has the following format:
+   * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+   * 
+ * + * string kms_key_name = 1; + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = 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(kmsKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kmsKeyName_); + } + 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(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kmsKeyName_); + } + 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.alloydb.v1beta.EncryptionConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.EncryptionConfig other = + (com.google.cloud.alloydb.v1beta.EncryptionConfig) obj; + + if (!getKmsKeyName().equals(other.getKmsKeyName())) 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) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.EncryptionConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionConfig 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.alloydb.v1beta.EncryptionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionConfig 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.alloydb.v1beta.EncryptionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionConfig 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.alloydb.v1beta.EncryptionConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionConfig 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.alloydb.v1beta.EncryptionConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionConfig 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.alloydb.v1beta.EncryptionConfig 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; + } + /** + * + * + *
+   * EncryptionConfig describes the encryption config of a cluster or a backup
+   * that is encrypted with a CMEK (customer-managed encryption key).
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.EncryptionConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.EncryptionConfig) + com.google.cloud.alloydb.v1beta.EncryptionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_EncryptionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_EncryptionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.EncryptionConfig.class, + com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.EncryptionConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kmsKeyName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_EncryptionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionConfig build() { + com.google.cloud.alloydb.v1beta.EncryptionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionConfig buildPartial() { + com.google.cloud.alloydb.v1beta.EncryptionConfig result = + new com.google.cloud.alloydb.v1beta.EncryptionConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.EncryptionConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kmsKeyName_ = kmsKeyName_; + } + } + + @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.alloydb.v1beta.EncryptionConfig) { + return mergeFrom((com.google.cloud.alloydb.v1beta.EncryptionConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.EncryptionConfig other) { + if (other == com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance()) + return this; + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + bitField0_ |= 0x00000001; + 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: + { + kmsKeyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + 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.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+     * The fully-qualified resource name of the KMS key.
+     * Each Cloud KMS key is regionalized and has the following format:
+     * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+     * 
+ * + * string kms_key_name = 1; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The fully-qualified resource name of the KMS key.
+     * Each Cloud KMS key is regionalized and has the following format:
+     * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+     * 
+ * + * string kms_key_name = 1; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The fully-qualified resource name of the KMS key.
+     * Each Cloud KMS key is regionalized and has the following format:
+     * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+     * 
+ * + * string kms_key_name = 1; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The fully-qualified resource name of the KMS key.
+     * Each Cloud KMS key is regionalized and has the following format:
+     * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+     * 
+ * + * string kms_key_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The fully-qualified resource name of the KMS key.
+     * Each Cloud KMS key is regionalized and has the following format:
+     * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+     * 
+ * + * string kms_key_name = 1; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyName_ = value; + 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.alloydb.v1beta.EncryptionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.EncryptionConfig) + private static final com.google.cloud.alloydb.v1beta.EncryptionConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.EncryptionConfig(); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EncryptionConfig 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.alloydb.v1beta.EncryptionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/EncryptionConfigOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/EncryptionConfigOrBuilder.java new file mode 100644 index 000000000000..efe49748410f --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/EncryptionConfigOrBuilder.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/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface EncryptionConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.EncryptionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The fully-qualified resource name of the KMS key.
+   * Each Cloud KMS key is regionalized and has the following format:
+   * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+   * 
+ * + * string kms_key_name = 1; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + /** + * + * + *
+   * The fully-qualified resource name of the KMS key.
+   * Each Cloud KMS key is regionalized and has the following format:
+   * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
+   * 
+ * + * string kms_key_name = 1; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/EncryptionInfo.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/EncryptionInfo.java new file mode 100644 index 000000000000..151d64ce963f --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/EncryptionInfo.java @@ -0,0 +1,1090 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * EncryptionInfo describes the encryption information of a cluster or a backup.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.EncryptionInfo} + */ +public final class EncryptionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.EncryptionInfo) + EncryptionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use EncryptionInfo.newBuilder() to construct. + private EncryptionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EncryptionInfo() { + encryptionType_ = 0; + kmsKeyVersions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EncryptionInfo(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_EncryptionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_EncryptionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.EncryptionInfo.class, + com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder.class); + } + + /** + * + * + *
+   * Possible encryption types.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.EncryptionInfo.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The data is encrypted at rest with a key that is fully managed by Google.
+     * No key version will be populated. This is the default state.
+     * 
+ * + * GOOGLE_DEFAULT_ENCRYPTION = 1; + */ + GOOGLE_DEFAULT_ENCRYPTION(1), + /** + * + * + *
+     * The data is encrypted at rest with a key that is managed by the customer.
+     * KMS key versions will be populated.
+     * 
+ * + * CUSTOMER_MANAGED_ENCRYPTION = 2; + */ + CUSTOMER_MANAGED_ENCRYPTION(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The data is encrypted at rest with a key that is fully managed by Google.
+     * No key version will be populated. This is the default state.
+     * 
+ * + * GOOGLE_DEFAULT_ENCRYPTION = 1; + */ + public static final int GOOGLE_DEFAULT_ENCRYPTION_VALUE = 1; + /** + * + * + *
+     * The data is encrypted at rest with a key that is managed by the customer.
+     * KMS key versions will be populated.
+     * 
+ * + * CUSTOMER_MANAGED_ENCRYPTION = 2; + */ + public static final int CUSTOMER_MANAGED_ENCRYPTION_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 Type 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 Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return GOOGLE_DEFAULT_ENCRYPTION; + case 2: + return CUSTOMER_MANAGED_ENCRYPTION; + 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 Type findValueByNumber(int number) { + return Type.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.alloydb.v1beta.EncryptionInfo.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.EncryptionInfo.Type) + } + + public static final int ENCRYPTION_TYPE_FIELD_NUMBER = 1; + private int encryptionType_ = 0; + /** + * + * + *
+   * Output only. Type of encryption.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for encryptionType. + */ + @java.lang.Override + public int getEncryptionTypeValue() { + return encryptionType_; + } + /** + * + * + *
+   * Output only. Type of encryption.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionInfo.Type getEncryptionType() { + com.google.cloud.alloydb.v1beta.EncryptionInfo.Type result = + com.google.cloud.alloydb.v1beta.EncryptionInfo.Type.forNumber(encryptionType_); + return result == null + ? com.google.cloud.alloydb.v1beta.EncryptionInfo.Type.UNRECOGNIZED + : result; + } + + public static final int KMS_KEY_VERSIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList kmsKeyVersions_; + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the kmsKeyVersions. + */ + public com.google.protobuf.ProtocolStringList getKmsKeyVersionsList() { + return kmsKeyVersions_; + } + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of kmsKeyVersions. + */ + public int getKmsKeyVersionsCount() { + return kmsKeyVersions_.size(); + } + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The kmsKeyVersions at the given index. + */ + public java.lang.String getKmsKeyVersions(int index) { + return kmsKeyVersions_.get(index); + } + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the kmsKeyVersions at the given index. + */ + public com.google.protobuf.ByteString getKmsKeyVersionsBytes(int index) { + return kmsKeyVersions_.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 (encryptionType_ + != com.google.cloud.alloydb.v1beta.EncryptionInfo.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, encryptionType_); + } + for (int i = 0; i < kmsKeyVersions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kmsKeyVersions_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encryptionType_ + != com.google.cloud.alloydb.v1beta.EncryptionInfo.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, encryptionType_); + } + { + int dataSize = 0; + for (int i = 0; i < kmsKeyVersions_.size(); i++) { + dataSize += computeStringSizeNoTag(kmsKeyVersions_.getRaw(i)); + } + size += dataSize; + size += 1 * getKmsKeyVersionsList().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.alloydb.v1beta.EncryptionInfo)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.EncryptionInfo other = + (com.google.cloud.alloydb.v1beta.EncryptionInfo) obj; + + if (encryptionType_ != other.encryptionType_) return false; + if (!getKmsKeyVersionsList().equals(other.getKmsKeyVersionsList())) 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) + ENCRYPTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + encryptionType_; + if (getKmsKeyVersionsCount() > 0) { + hash = (37 * hash) + KMS_KEY_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyVersionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.EncryptionInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionInfo 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.alloydb.v1beta.EncryptionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionInfo 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.alloydb.v1beta.EncryptionInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionInfo 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.alloydb.v1beta.EncryptionInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionInfo 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.alloydb.v1beta.EncryptionInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionInfo 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.alloydb.v1beta.EncryptionInfo 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; + } + /** + * + * + *
+   * EncryptionInfo describes the encryption information of a cluster or a backup.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.EncryptionInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.EncryptionInfo) + com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_EncryptionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_EncryptionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.EncryptionInfo.class, + com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.EncryptionInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encryptionType_ = 0; + kmsKeyVersions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_EncryptionInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionInfo getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionInfo build() { + com.google.cloud.alloydb.v1beta.EncryptionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionInfo buildPartial() { + com.google.cloud.alloydb.v1beta.EncryptionInfo result = + new com.google.cloud.alloydb.v1beta.EncryptionInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.alloydb.v1beta.EncryptionInfo result) { + if (((bitField0_ & 0x00000002) != 0)) { + kmsKeyVersions_ = kmsKeyVersions_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.kmsKeyVersions_ = kmsKeyVersions_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.EncryptionInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encryptionType_ = encryptionType_; + } + } + + @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.alloydb.v1beta.EncryptionInfo) { + return mergeFrom((com.google.cloud.alloydb.v1beta.EncryptionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.EncryptionInfo other) { + if (other == com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance()) return this; + if (other.encryptionType_ != 0) { + setEncryptionTypeValue(other.getEncryptionTypeValue()); + } + if (!other.kmsKeyVersions_.isEmpty()) { + if (kmsKeyVersions_.isEmpty()) { + kmsKeyVersions_ = other.kmsKeyVersions_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureKmsKeyVersionsIsMutable(); + kmsKeyVersions_.addAll(other.kmsKeyVersions_); + } + 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: + { + encryptionType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureKmsKeyVersionsIsMutable(); + kmsKeyVersions_.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 int encryptionType_ = 0; + /** + * + * + *
+     * Output only. Type of encryption.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for encryptionType. + */ + @java.lang.Override + public int getEncryptionTypeValue() { + return encryptionType_; + } + /** + * + * + *
+     * Output only. Type of encryption.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for encryptionType to set. + * @return This builder for chaining. + */ + public Builder setEncryptionTypeValue(int value) { + encryptionType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of encryption.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.EncryptionInfo.Type getEncryptionType() { + com.google.cloud.alloydb.v1beta.EncryptionInfo.Type result = + com.google.cloud.alloydb.v1beta.EncryptionInfo.Type.forNumber(encryptionType_); + return result == null + ? com.google.cloud.alloydb.v1beta.EncryptionInfo.Type.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Type of encryption.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The encryptionType to set. + * @return This builder for chaining. + */ + public Builder setEncryptionType(com.google.cloud.alloydb.v1beta.EncryptionInfo.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + encryptionType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of encryption.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearEncryptionType() { + bitField0_ = (bitField0_ & ~0x00000001); + encryptionType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList kmsKeyVersions_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureKmsKeyVersionsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + kmsKeyVersions_ = new com.google.protobuf.LazyStringArrayList(kmsKeyVersions_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the kmsKeyVersions. + */ + public com.google.protobuf.ProtocolStringList getKmsKeyVersionsList() { + return kmsKeyVersions_.getUnmodifiableView(); + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of kmsKeyVersions. + */ + public int getKmsKeyVersionsCount() { + return kmsKeyVersions_.size(); + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The kmsKeyVersions at the given index. + */ + public java.lang.String getKmsKeyVersions(int index) { + return kmsKeyVersions_.get(index); + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the kmsKeyVersions at the given index. + */ + public com.google.protobuf.ByteString getKmsKeyVersionsBytes(int index) { + return kmsKeyVersions_.getByteString(index); + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The kmsKeyVersions to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKmsKeyVersionsIsMutable(); + kmsKeyVersions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The kmsKeyVersions to add. + * @return This builder for chaining. + */ + public Builder addKmsKeyVersions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKmsKeyVersionsIsMutable(); + kmsKeyVersions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param values The kmsKeyVersions to add. + * @return This builder for chaining. + */ + public Builder addAllKmsKeyVersions(java.lang.Iterable values) { + ensureKmsKeyVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, kmsKeyVersions_); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyVersions() { + kmsKeyVersions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Cloud KMS key versions that are being used to protect the
+     * database or the backup.
+     * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the kmsKeyVersions to add. + * @return This builder for chaining. + */ + public Builder addKmsKeyVersionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureKmsKeyVersionsIsMutable(); + kmsKeyVersions_.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.alloydb.v1beta.EncryptionInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.EncryptionInfo) + private static final com.google.cloud.alloydb.v1beta.EncryptionInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.EncryptionInfo(); + } + + public static com.google.cloud.alloydb.v1beta.EncryptionInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EncryptionInfo 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.alloydb.v1beta.EncryptionInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/EncryptionInfoOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/EncryptionInfoOrBuilder.java new file mode 100644 index 000000000000..d9f5ef7d1c96 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/EncryptionInfoOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface EncryptionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.EncryptionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Type of encryption.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for encryptionType. + */ + int getEncryptionTypeValue(); + /** + * + * + *
+   * Output only. Type of encryption.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionType. + */ + com.google.cloud.alloydb.v1beta.EncryptionInfo.Type getEncryptionType(); + + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the kmsKeyVersions. + */ + java.util.List getKmsKeyVersionsList(); + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of kmsKeyVersions. + */ + int getKmsKeyVersionsCount(); + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The kmsKeyVersions at the given index. + */ + java.lang.String getKmsKeyVersions(int index); + /** + * + * + *
+   * Output only. Cloud KMS key versions that are being used to protect the
+   * database or the backup.
+   * 
+ * + * + * repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the kmsKeyVersions at the given index. + */ + com.google.protobuf.ByteString getKmsKeyVersionsBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/FailoverInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/FailoverInstanceRequest.java new file mode 100644 index 000000000000..b760c72eb4a7 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/FailoverInstanceRequest.java @@ -0,0 +1,1000 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for triggering failover on an Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.FailoverInstanceRequest} + */ +public final class FailoverInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.FailoverInstanceRequest) + FailoverInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use FailoverInstanceRequest.newBuilder() to construct. + private FailoverInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FailoverInstanceRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FailoverInstanceRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_FailoverInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_FailoverInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.FailoverInstanceRequest.class, + com.google.cloud.alloydb.v1beta.FailoverInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the failover.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + 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.alloydb.v1beta.FailoverInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.FailoverInstanceRequest other = + (com.google.cloud.alloydb.v1beta.FailoverInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.FailoverInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.FailoverInstanceRequest 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.alloydb.v1beta.FailoverInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.FailoverInstanceRequest 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.alloydb.v1beta.FailoverInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.FailoverInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.FailoverInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.FailoverInstanceRequest 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.alloydb.v1beta.FailoverInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.FailoverInstanceRequest 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.alloydb.v1beta.FailoverInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.FailoverInstanceRequest 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.alloydb.v1beta.FailoverInstanceRequest 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; + } + /** + * + * + *
+   * Message for triggering failover on an Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.FailoverInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.FailoverInstanceRequest) + com.google.cloud.alloydb.v1beta.FailoverInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_FailoverInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_FailoverInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.FailoverInstanceRequest.class, + com.google.cloud.alloydb.v1beta.FailoverInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.FailoverInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_FailoverInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.FailoverInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.FailoverInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.FailoverInstanceRequest build() { + com.google.cloud.alloydb.v1beta.FailoverInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.FailoverInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1beta.FailoverInstanceRequest result = + new com.google.cloud.alloydb.v1beta.FailoverInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.FailoverInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1beta.FailoverInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.FailoverInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.FailoverInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1beta.FailoverInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + 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 java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the failover.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the failover.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the failover.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = 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.alloydb.v1beta.FailoverInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.FailoverInstanceRequest) + private static final com.google.cloud.alloydb.v1beta.FailoverInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.FailoverInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1beta.FailoverInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailoverInstanceRequest 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.alloydb.v1beta.FailoverInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/FailoverInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/FailoverInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..51b7755e6724 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/FailoverInstanceRequestOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface FailoverInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.FailoverInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the failover.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateRequest.java new file mode 100644 index 000000000000..06c1814b76c4 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateRequest.java @@ -0,0 +1,1420 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for requests to generate a client certificate signed by the Cluster
+ * CA.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} + */ +public final class GenerateClientCertificateRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.GenerateClientCertificateRequest) + GenerateClientCertificateRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateClientCertificateRequest.newBuilder() to construct. + private GenerateClientCertificateRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateClientCertificateRequest() { + parent_ = ""; + requestId_ = ""; + pemCsr_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateClientCertificateRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.class, + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   *  * projects/{project}/locations/{location}/clusters/{cluster}
+   * 
+ * + * + * 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 parent resource. The required format is:
+   *  * projects/{project}/locations/{location}/clusters/{cluster}
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PEM_CSR_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pemCsr_ = ""; + /** + * + * + *
+   * Optional. A pem-encoded X.509 certificate signing request (CSR).
+   * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pemCsr. + */ + @java.lang.Override + public java.lang.String getPemCsr() { + java.lang.Object ref = pemCsr_; + 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(); + pemCsr_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A pem-encoded X.509 certificate signing request (CSR).
+   * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pemCsr. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPemCsrBytes() { + java.lang.Object ref = pemCsr_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pemCsr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CERT_DURATION_FIELD_NUMBER = 4; + private com.google.protobuf.Duration certDuration_; + /** + * + * + *
+   * Optional. An optional hint to the endpoint to generate the client
+   * certificate with the requested duration. The duration can be from 1 hour to
+   * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+   * unspecified or is not honored, then the endpoint will pick an appropriate
+   * default duration.
+   * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the certDuration field is set. + */ + @java.lang.Override + public boolean hasCertDuration() { + return certDuration_ != null; + } + /** + * + * + *
+   * Optional. An optional hint to the endpoint to generate the client
+   * certificate with the requested duration. The duration can be from 1 hour to
+   * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+   * unspecified or is not honored, then the endpoint will pick an appropriate
+   * default duration.
+   * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The certDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getCertDuration() { + return certDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : certDuration_; + } + /** + * + * + *
+   * Optional. An optional hint to the endpoint to generate the client
+   * certificate with the requested duration. The duration can be from 1 hour to
+   * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+   * unspecified or is not honored, then the endpoint will pick an appropriate
+   * default duration.
+   * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getCertDurationOrBuilder() { + return certDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : certDuration_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pemCsr_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pemCsr_); + } + if (certDuration_ != null) { + output.writeMessage(4, getCertDuration()); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pemCsr_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pemCsr_); + } + if (certDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCertDuration()); + } + 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.alloydb.v1beta.GenerateClientCertificateRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest other = + (com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getPemCsr().equals(other.getPemCsr())) return false; + if (hasCertDuration() != other.hasCertDuration()) return false; + if (hasCertDuration()) { + if (!getCertDuration().equals(other.getCertDuration())) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + PEM_CSR_FIELD_NUMBER; + hash = (53 * hash) + getPemCsr().hashCode(); + if (hasCertDuration()) { + hash = (37 * hash) + CERT_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getCertDuration().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest 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.alloydb.v1beta.GenerateClientCertificateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest 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.alloydb.v1beta.GenerateClientCertificateRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest 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.alloydb.v1beta.GenerateClientCertificateRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest 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.alloydb.v1beta.GenerateClientCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest 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.alloydb.v1beta.GenerateClientCertificateRequest 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; + } + /** + * + * + *
+   * Message for requests to generate a client certificate signed by the Cluster
+   * CA.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.GenerateClientCertificateRequest) + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.class, + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + requestId_ = ""; + pemCsr_ = ""; + certDuration_ = null; + if (certDurationBuilder_ != null) { + certDurationBuilder_.dispose(); + certDurationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest build() { + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest buildPartial() { + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest result = + new com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pemCsr_ = pemCsr_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.certDuration_ = + certDurationBuilder_ == null ? certDuration_ : certDurationBuilder_.build(); + } + } + + @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.alloydb.v1beta.GenerateClientCertificateRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest other) { + if (other + == com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPemCsr().isEmpty()) { + pemCsr_ = other.pemCsr_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCertDuration()) { + mergeCertDuration(other.getCertDuration()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + pemCsr_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getCertDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     *  * projects/{project}/locations/{location}/clusters/{cluster}
+     * 
+ * + * + * 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 parent resource. The required format is:
+     *  * projects/{project}/locations/{location}/clusters/{cluster}
+     * 
+ * + * + * 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 parent resource. The required format is:
+     *  * projects/{project}/locations/{location}/clusters/{cluster}
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     *  * projects/{project}/locations/{location}/clusters/{cluster}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     *  * projects/{project}/locations/{location}/clusters/{cluster}
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object pemCsr_ = ""; + /** + * + * + *
+     * Optional. A pem-encoded X.509 certificate signing request (CSR).
+     * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pemCsr. + */ + public java.lang.String getPemCsr() { + java.lang.Object ref = pemCsr_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pemCsr_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A pem-encoded X.509 certificate signing request (CSR).
+     * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pemCsr. + */ + public com.google.protobuf.ByteString getPemCsrBytes() { + java.lang.Object ref = pemCsr_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pemCsr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A pem-encoded X.509 certificate signing request (CSR).
+     * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pemCsr to set. + * @return This builder for chaining. + */ + public Builder setPemCsr(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pemCsr_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pem-encoded X.509 certificate signing request (CSR).
+     * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPemCsr() { + pemCsr_ = getDefaultInstance().getPemCsr(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pem-encoded X.509 certificate signing request (CSR).
+     * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pemCsr to set. + * @return This builder for chaining. + */ + public Builder setPemCsrBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pemCsr_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Duration certDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + certDurationBuilder_; + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the certDuration field is set. + */ + public boolean hasCertDuration() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The certDuration. + */ + public com.google.protobuf.Duration getCertDuration() { + if (certDurationBuilder_ == null) { + return certDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : certDuration_; + } else { + return certDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCertDuration(com.google.protobuf.Duration value) { + if (certDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + certDuration_ = value; + } else { + certDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCertDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (certDurationBuilder_ == null) { + certDuration_ = builderForValue.build(); + } else { + certDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeCertDuration(com.google.protobuf.Duration value) { + if (certDurationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && certDuration_ != null + && certDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getCertDurationBuilder().mergeFrom(value); + } else { + certDuration_ = value; + } + } else { + certDurationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearCertDuration() { + bitField0_ = (bitField0_ & ~0x00000008); + certDuration_ = null; + if (certDurationBuilder_ != null) { + certDurationBuilder_.dispose(); + certDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Duration.Builder getCertDurationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCertDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.DurationOrBuilder getCertDurationOrBuilder() { + if (certDurationBuilder_ != null) { + return certDurationBuilder_.getMessageOrBuilder(); + } else { + return certDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : certDuration_; + } + } + /** + * + * + *
+     * Optional. An optional hint to the endpoint to generate the client
+     * certificate with the requested duration. The duration can be from 1 hour to
+     * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+     * unspecified or is not honored, then the endpoint will pick an appropriate
+     * default duration.
+     * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getCertDurationFieldBuilder() { + if (certDurationBuilder_ == null) { + certDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getCertDuration(), getParentForChildren(), isClean()); + certDuration_ = null; + } + return certDurationBuilder_; + } + + @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.alloydb.v1beta.GenerateClientCertificateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.GenerateClientCertificateRequest) + private static final com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest(); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateClientCertificateRequest 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.alloydb.v1beta.GenerateClientCertificateRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateRequestOrBuilder.java new file mode 100644 index 000000000000..bbb23340296c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateRequestOrBuilder.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/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface GenerateClientCertificateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.GenerateClientCertificateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   *  * projects/{project}/locations/{location}/clusters/{cluster}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   *  * projects/{project}/locations/{location}/clusters/{cluster}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. A pem-encoded X.509 certificate signing request (CSR).
+   * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pemCsr. + */ + java.lang.String getPemCsr(); + /** + * + * + *
+   * Optional. A pem-encoded X.509 certificate signing request (CSR).
+   * 
+ * + * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pemCsr. + */ + com.google.protobuf.ByteString getPemCsrBytes(); + + /** + * + * + *
+   * Optional. An optional hint to the endpoint to generate the client
+   * certificate with the requested duration. The duration can be from 1 hour to
+   * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+   * unspecified or is not honored, then the endpoint will pick an appropriate
+   * default duration.
+   * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the certDuration field is set. + */ + boolean hasCertDuration(); + /** + * + * + *
+   * Optional. An optional hint to the endpoint to generate the client
+   * certificate with the requested duration. The duration can be from 1 hour to
+   * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+   * unspecified or is not honored, then the endpoint will pick an appropriate
+   * default duration.
+   * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The certDuration. + */ + com.google.protobuf.Duration getCertDuration(); + /** + * + * + *
+   * Optional. An optional hint to the endpoint to generate the client
+   * certificate with the requested duration. The duration can be from 1 hour to
+   * 24 hours. The endpoint may or may not honor the hint. If the hint is left
+   * unspecified or is not honored, then the endpoint will pick an appropriate
+   * default duration.
+   * 
+ * + * .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.DurationOrBuilder getCertDurationOrBuilder(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateResponse.java new file mode 100644 index 000000000000..3d077a1e0254 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateResponse.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/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message returned by a GenerateClientCertificate operation.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} + */ +public final class GenerateClientCertificateResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.GenerateClientCertificateResponse) + GenerateClientCertificateResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateClientCertificateResponse.newBuilder() to construct. + private GenerateClientCertificateResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateClientCertificateResponse() { + pemCertificate_ = ""; + pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateClientCertificateResponse(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.class, + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.Builder.class); + } + + public static final int PEM_CERTIFICATE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object pemCertificate_ = ""; + /** + * + * + *
+   * Output only. The pem-encoded, signed X.509 certificate.
+   * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pemCertificate. + */ + @java.lang.Override + public java.lang.String getPemCertificate() { + java.lang.Object ref = pemCertificate_; + 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(); + pemCertificate_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The pem-encoded, signed X.509 certificate.
+   * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for pemCertificate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPemCertificateBytes() { + java.lang.Object ref = pemCertificate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pemCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PEM_CERTIFICATE_CHAIN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList pemCertificateChain_; + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the pemCertificateChain. + */ + public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { + return pemCertificateChain_; + } + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of pemCertificateChain. + */ + public int getPemCertificateChainCount() { + return pemCertificateChain_.size(); + } + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The pemCertificateChain at the given index. + */ + public java.lang.String getPemCertificateChain(int index) { + return pemCertificateChain_.get(index); + } + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the pemCertificateChain at the given index. + */ + public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { + return pemCertificateChain_.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(pemCertificate_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pemCertificate_); + } + for (int i = 0; i < pemCertificateChain_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pemCertificateChain_.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(pemCertificate_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pemCertificate_); + } + { + int dataSize = 0; + for (int i = 0; i < pemCertificateChain_.size(); i++) { + dataSize += computeStringSizeNoTag(pemCertificateChain_.getRaw(i)); + } + size += dataSize; + size += 1 * getPemCertificateChainList().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.alloydb.v1beta.GenerateClientCertificateResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse other = + (com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse) obj; + + if (!getPemCertificate().equals(other.getPemCertificate())) return false; + if (!getPemCertificateChainList().equals(other.getPemCertificateChainList())) 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) + PEM_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getPemCertificate().hashCode(); + if (getPemCertificateChainCount() > 0) { + hash = (37 * hash) + PEM_CERTIFICATE_CHAIN_FIELD_NUMBER; + hash = (53 * hash) + getPemCertificateChainList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse 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.alloydb.v1beta.GenerateClientCertificateResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse 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.alloydb.v1beta.GenerateClientCertificateResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse 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.alloydb.v1beta.GenerateClientCertificateResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + 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.alloydb.v1beta.GenerateClientCertificateResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse 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.alloydb.v1beta.GenerateClientCertificateResponse 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; + } + /** + * + * + *
+   * Message returned by a GenerateClientCertificate operation.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.GenerateClientCertificateResponse) + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.class, + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.Builder.class); + } + + // Construct using + // com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pemCertificate_ = ""; + pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse build() { + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse buildPartial() { + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse result = + new com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse result) { + if (((bitField0_ & 0x00000002) != 0)) { + pemCertificateChain_ = pemCertificateChain_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.pemCertificateChain_ = pemCertificateChain_; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pemCertificate_ = pemCertificate_; + } + } + + @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.alloydb.v1beta.GenerateClientCertificateResponse) { + return mergeFrom((com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse other) { + if (other + == com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.getDefaultInstance()) + return this; + if (!other.getPemCertificate().isEmpty()) { + pemCertificate_ = other.pemCertificate_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.pemCertificateChain_.isEmpty()) { + if (pemCertificateChain_.isEmpty()) { + pemCertificateChain_ = other.pemCertificateChain_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.addAll(other.pemCertificateChain_); + } + 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: + { + pemCertificate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.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 pemCertificate_ = ""; + /** + * + * + *
+     * Output only. The pem-encoded, signed X.509 certificate.
+     * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pemCertificate. + */ + public java.lang.String getPemCertificate() { + java.lang.Object ref = pemCertificate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pemCertificate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The pem-encoded, signed X.509 certificate.
+     * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for pemCertificate. + */ + public com.google.protobuf.ByteString getPemCertificateBytes() { + java.lang.Object ref = pemCertificate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pemCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The pem-encoded, signed X.509 certificate.
+     * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The pemCertificate to set. + * @return This builder for chaining. + */ + public Builder setPemCertificate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pemCertificate_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded, signed X.509 certificate.
+     * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPemCertificate() { + pemCertificate_ = getDefaultInstance().getPemCertificate(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded, signed X.509 certificate.
+     * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for pemCertificate to set. + * @return This builder for chaining. + */ + public Builder setPemCertificateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pemCertificate_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList pemCertificateChain_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePemCertificateChainIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + pemCertificateChain_ = new com.google.protobuf.LazyStringArrayList(pemCertificateChain_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the pemCertificateChain. + */ + public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { + return pemCertificateChain_.getUnmodifiableView(); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of pemCertificateChain. + */ + public int getPemCertificateChainCount() { + return pemCertificateChain_.size(); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The pemCertificateChain at the given index. + */ + public java.lang.String getPemCertificateChain(int index) { + return pemCertificateChain_.get(index); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the pemCertificateChain at the given index. + */ + public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { + return pemCertificateChain_.getByteString(index); + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The pemCertificateChain to set. + * @return This builder for chaining. + */ + public Builder setPemCertificateChain(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The pemCertificateChain to add. + * @return This builder for chaining. + */ + public Builder addPemCertificateChain(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The pemCertificateChain to add. + * @return This builder for chaining. + */ + public Builder addAllPemCertificateChain(java.lang.Iterable values) { + ensurePemCertificateChainIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pemCertificateChain_); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearPemCertificateChain() { + pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The pem-encoded chain that may be used to verify the X.509
+     * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+     * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes of the pemCertificateChain to add. + * @return This builder for chaining. + */ + public Builder addPemCertificateChainBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePemCertificateChainIsMutable(); + pemCertificateChain_.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.alloydb.v1beta.GenerateClientCertificateResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.GenerateClientCertificateResponse) + private static final com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse(); + } + + public static com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateClientCertificateResponse 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.alloydb.v1beta.GenerateClientCertificateResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateResponseOrBuilder.java new file mode 100644 index 000000000000..7d6107d28c45 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface GenerateClientCertificateResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.GenerateClientCertificateResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The pem-encoded, signed X.509 certificate.
+   * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pemCertificate. + */ + java.lang.String getPemCertificate(); + /** + * + * + *
+   * Output only. The pem-encoded, signed X.509 certificate.
+   * 
+ * + * string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for pemCertificate. + */ + com.google.protobuf.ByteString getPemCertificateBytes(); + + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the pemCertificateChain. + */ + java.util.List getPemCertificateChainList(); + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of pemCertificateChain. + */ + int getPemCertificateChainCount(); + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The pemCertificateChain at the given index. + */ + java.lang.String getPemCertificateChain(int index); + /** + * + * + *
+   * Output only. The pem-encoded chain that may be used to verify the X.509
+   * certificate. Expected to be in issuer-to-root order according to RFC 5246.
+   * 
+ * + * repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the pemCertificateChain at the given index. + */ + com.google.protobuf.ByteString getPemCertificateChainBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetBackupRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetBackupRequest.java new file mode 100644 index 000000000000..3b6def9358a8 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetBackupRequest.java @@ -0,0 +1,643 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for getting a Backup
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.GetBackupRequest} + */ +public final class GetBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.GetBackupRequest) + GetBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetBackupRequest.newBuilder() to construct. + private GetBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetBackupRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetBackupRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.GetBackupRequest.class, + com.google.cloud.alloydb.v1beta.GetBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * 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. Name of the resource
+   * 
+ * + * + * 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.alloydb.v1beta.GetBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.GetBackupRequest other = + (com.google.cloud.alloydb.v1beta.GetBackupRequest) 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.alloydb.v1beta.GetBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GetBackupRequest 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.alloydb.v1beta.GetBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GetBackupRequest 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.alloydb.v1beta.GetBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GetBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.GetBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GetBackupRequest 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.alloydb.v1beta.GetBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GetBackupRequest 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.alloydb.v1beta.GetBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GetBackupRequest 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.alloydb.v1beta.GetBackupRequest 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; + } + /** + * + * + *
+   * Message for getting a Backup
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.GetBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.GetBackupRequest) + com.google.cloud.alloydb.v1beta.GetBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.GetBackupRequest.class, + com.google.cloud.alloydb.v1beta.GetBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.GetBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetBackupRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.GetBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetBackupRequest build() { + com.google.cloud.alloydb.v1beta.GetBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetBackupRequest buildPartial() { + com.google.cloud.alloydb.v1beta.GetBackupRequest result = + new com.google.cloud.alloydb.v1beta.GetBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.GetBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.alloydb.v1beta.GetBackupRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.GetBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.GetBackupRequest other) { + if (other == com.google.cloud.alloydb.v1beta.GetBackupRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + 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(); + bitField0_ |= 0x00000001; + 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.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * 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; + 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.alloydb.v1beta.GetBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.GetBackupRequest) + private static final com.google.cloud.alloydb.v1beta.GetBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.GetBackupRequest(); + } + + public static com.google.cloud.alloydb.v1beta.GetBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBackupRequest 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.alloydb.v1beta.GetBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetBackupRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetBackupRequestOrBuilder.java new file mode 100644 index 000000000000..53720a05e51f --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetBackupRequestOrBuilder.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/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface GetBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.GetBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * 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-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetClusterRequest.java new file mode 100644 index 000000000000..c1285920813e --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetClusterRequest.java @@ -0,0 +1,650 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for getting a Cluster
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.GetClusterRequest} + */ +public final class GetClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.GetClusterRequest) + GetClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetClusterRequest.newBuilder() to construct. + private GetClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetClusterRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetClusterRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.GetClusterRequest.class, + com.google.cloud.alloydb.v1beta.GetClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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.alloydb.v1beta.GetClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.GetClusterRequest other = + (com.google.cloud.alloydb.v1beta.GetClusterRequest) 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.alloydb.v1beta.GetClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GetClusterRequest 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.alloydb.v1beta.GetClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GetClusterRequest 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.alloydb.v1beta.GetClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GetClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.GetClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GetClusterRequest 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.alloydb.v1beta.GetClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GetClusterRequest 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.alloydb.v1beta.GetClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GetClusterRequest 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.alloydb.v1beta.GetClusterRequest 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; + } + /** + * + * + *
+   * Message for getting a Cluster
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.GetClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.GetClusterRequest) + com.google.cloud.alloydb.v1beta.GetClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.GetClusterRequest.class, + com.google.cloud.alloydb.v1beta.GetClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.GetClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.GetClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetClusterRequest build() { + com.google.cloud.alloydb.v1beta.GetClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetClusterRequest buildPartial() { + com.google.cloud.alloydb.v1beta.GetClusterRequest result = + new com.google.cloud.alloydb.v1beta.GetClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.GetClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.alloydb.v1beta.GetClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.GetClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.GetClusterRequest other) { + if (other == com.google.cloud.alloydb.v1beta.GetClusterRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + 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(); + bitField0_ |= 0x00000001; + 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.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + 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.alloydb.v1beta.GetClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.GetClusterRequest) + private static final com.google.cloud.alloydb.v1beta.GetClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.GetClusterRequest(); + } + + public static com.google.cloud.alloydb.v1beta.GetClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetClusterRequest 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.alloydb.v1beta.GetClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetClusterRequestOrBuilder.java new file mode 100644 index 000000000000..fe72e287a896 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetClusterRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface GetClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.GetClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetConnectionInfoRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetConnectionInfoRequest.java new file mode 100644 index 000000000000..d96f180877a4 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetConnectionInfoRequest.java @@ -0,0 +1,903 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Request message for GetConnectionInfo.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.GetConnectionInfoRequest} + */ +public final class GetConnectionInfoRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.GetConnectionInfoRequest) + GetConnectionInfoRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetConnectionInfoRequest.newBuilder() to construct. + private GetConnectionInfoRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetConnectionInfoRequest() { + parent_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetConnectionInfoRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetConnectionInfoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetConnectionInfoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest.class, + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+   * 
+ * + * + * 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 parent resource. The required format is:
+   * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, 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(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, 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.alloydb.v1beta.GetConnectionInfoRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest other = + (com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().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.alloydb.v1beta.GetConnectionInfoRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest 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.alloydb.v1beta.GetConnectionInfoRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest 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.alloydb.v1beta.GetConnectionInfoRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest 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.alloydb.v1beta.GetConnectionInfoRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest 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.alloydb.v1beta.GetConnectionInfoRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest 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.alloydb.v1beta.GetConnectionInfoRequest 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 GetConnectionInfo.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.GetConnectionInfoRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.GetConnectionInfoRequest) + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetConnectionInfoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetConnectionInfoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest.class, + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetConnectionInfoRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest build() { + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest buildPartial() { + com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest result = + new com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + } + + @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.alloydb.v1beta.GetConnectionInfoRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest other) { + if (other == com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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 parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+     * 
+ * + * + * 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 parent resource. The required format is:
+     * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+     * 
+ * + * + * 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 parent resource. The required format is:
+     * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + 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.alloydb.v1beta.GetConnectionInfoRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.GetConnectionInfoRequest) + private static final com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest(); + } + + public static com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetConnectionInfoRequest 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.alloydb.v1beta.GetConnectionInfoRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetConnectionInfoRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetConnectionInfoRequestOrBuilder.java new file mode 100644 index 000000000000..c2c6da163298 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetConnectionInfoRequestOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface GetConnectionInfoRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.GetConnectionInfoRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetInstanceRequest.java new file mode 100644 index 000000000000..b0266ff304f0 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetInstanceRequest.java @@ -0,0 +1,800 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for getting a Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.GetInstanceRequest} + */ +public final class GetInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.GetInstanceRequest) + GetInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetInstanceRequest.newBuilder() to construct. + private GetInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetInstanceRequest() { + name_ = ""; + view_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetInstanceRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.GetInstanceRequest.class, + com.google.cloud.alloydb.v1beta.GetInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 VIEW_FIELD_NUMBER = 2; + private int view_ = 0; + /** + * + * + *
+   * The view of the instance to return.
+   * 
+ * + * .google.cloud.alloydb.v1beta.InstanceView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * The view of the instance to return.
+   * 
+ * + * .google.cloud.alloydb.v1beta.InstanceView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.InstanceView getView() { + com.google.cloud.alloydb.v1beta.InstanceView result = + com.google.cloud.alloydb.v1beta.InstanceView.forNumber(view_); + return result == null ? com.google.cloud.alloydb.v1beta.InstanceView.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 (view_ + != com.google.cloud.alloydb.v1beta.InstanceView.INSTANCE_VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(2, view_); + } + 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 (view_ + != com.google.cloud.alloydb.v1beta.InstanceView.INSTANCE_VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } + 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.alloydb.v1beta.GetInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.GetInstanceRequest other = + (com.google.cloud.alloydb.v1beta.GetInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (view_ != other.view_) 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) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.GetInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GetInstanceRequest 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.alloydb.v1beta.GetInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GetInstanceRequest 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.alloydb.v1beta.GetInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GetInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.GetInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GetInstanceRequest 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.alloydb.v1beta.GetInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GetInstanceRequest 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.alloydb.v1beta.GetInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GetInstanceRequest 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.alloydb.v1beta.GetInstanceRequest 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; + } + /** + * + * + *
+   * Message for getting a Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.GetInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.GetInstanceRequest) + com.google.cloud.alloydb.v1beta.GetInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.GetInstanceRequest.class, + com.google.cloud.alloydb.v1beta.GetInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.GetInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + view_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.GetInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetInstanceRequest build() { + com.google.cloud.alloydb.v1beta.GetInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1beta.GetInstanceRequest result = + new com.google.cloud.alloydb.v1beta.GetInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.GetInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.view_ = view_; + } + } + + @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.alloydb.v1beta.GetInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.GetInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.GetInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1beta.GetInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + view_ = input.readEnum(); + 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 java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int view_ = 0; + /** + * + * + *
+     * The view of the instance to return.
+     * 
+ * + * .google.cloud.alloydb.v1beta.InstanceView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * The view of the instance to return.
+     * 
+ * + * .google.cloud.alloydb.v1beta.InstanceView view = 2; + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + view_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The view of the instance to return.
+     * 
+ * + * .google.cloud.alloydb.v1beta.InstanceView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.InstanceView getView() { + com.google.cloud.alloydb.v1beta.InstanceView result = + com.google.cloud.alloydb.v1beta.InstanceView.forNumber(view_); + return result == null ? com.google.cloud.alloydb.v1beta.InstanceView.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The view of the instance to return.
+     * 
+ * + * .google.cloud.alloydb.v1beta.InstanceView view = 2; + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.alloydb.v1beta.InstanceView value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The view of the instance to return.
+     * 
+ * + * .google.cloud.alloydb.v1beta.InstanceView view = 2; + * + * @return This builder for chaining. + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000002); + view_ = 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.alloydb.v1beta.GetInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.GetInstanceRequest) + private static final com.google.cloud.alloydb.v1beta.GetInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.GetInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1beta.GetInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetInstanceRequest 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.alloydb.v1beta.GetInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..f3ec304f9a48 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetInstanceRequestOrBuilder.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/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface GetInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.GetInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The view of the instance to return.
+   * 
+ * + * .google.cloud.alloydb.v1beta.InstanceView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * The view of the instance to return.
+   * 
+ * + * .google.cloud.alloydb.v1beta.InstanceView view = 2; + * + * @return The view. + */ + com.google.cloud.alloydb.v1beta.InstanceView getView(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Instance.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Instance.java new file mode 100644 index 000000000000..bbac90fb33b7 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Instance.java @@ -0,0 +1,10024 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * An Instance is a computing unit that an end customer can connect to.
+ * It's the main unit of computing resources in AlloyDB.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Instance} + */ +public final class Instance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.Instance) + InstanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Instance.newBuilder() to construct. + private Instance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Instance() { + name_ = ""; + displayName_ = ""; + uid_ = ""; + state_ = 0; + instanceType_ = 0; + availabilityType_ = 0; + gceZone_ = ""; + nodes_ = java.util.Collections.emptyList(); + ipAddress_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Instance(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + case 13: + return internalGetDatabaseFlags(); + case 18: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Instance.class, + com.google.cloud.alloydb.v1beta.Instance.Builder.class); + } + + /** + * + * + *
+   * Instance State
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.Instance.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The instance is active and running.
+     * 
+ * + * READY = 1; + */ + READY(1), + /** + * + * + *
+     * The instance is stopped. Instance name and IP resources are preserved.
+     * 
+ * + * STOPPED = 2; + */ + STOPPED(2), + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 3; + */ + CREATING(3), + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + /** + * + * + *
+     * The instance is down for maintenance.
+     * 
+ * + * MAINTENANCE = 5; + */ + MAINTENANCE(5), + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * an operation on the instance.
+     * Note: Instances in this state would tried to be auto-repaired. And
+     * Customers should be able to restart, update or delete these instances.
+     * 
+ * + * FAILED = 6; + */ + FAILED(6), + /** + * + * + *
+     * Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that
+     * index unused in case that state also needs to exposed via consumer apis
+     * in future.
+     * The instance has been configured to sync data from some other source.
+     * 
+ * + * BOOTSTRAPPING = 8; + */ + BOOTSTRAPPING(8), + /** + * + * + *
+     * The instance is being promoted.
+     * 
+ * + * PROMOTING = 9; + */ + PROMOTING(9), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The instance is active and running.
+     * 
+ * + * READY = 1; + */ + public static final int READY_VALUE = 1; + /** + * + * + *
+     * The instance is stopped. Instance name and IP resources are preserved.
+     * 
+ * + * STOPPED = 2; + */ + public static final int STOPPED_VALUE = 2; + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 3; + */ + public static final int CREATING_VALUE = 3; + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + /** + * + * + *
+     * The instance is down for maintenance.
+     * 
+ * + * MAINTENANCE = 5; + */ + public static final int MAINTENANCE_VALUE = 5; + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * an operation on the instance.
+     * Note: Instances in this state would tried to be auto-repaired. And
+     * Customers should be able to restart, update or delete these instances.
+     * 
+ * + * FAILED = 6; + */ + public static final int FAILED_VALUE = 6; + /** + * + * + *
+     * Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that
+     * index unused in case that state also needs to exposed via consumer apis
+     * in future.
+     * The instance has been configured to sync data from some other source.
+     * 
+ * + * BOOTSTRAPPING = 8; + */ + public static final int BOOTSTRAPPING_VALUE = 8; + /** + * + * + *
+     * The instance is being promoted.
+     * 
+ * + * PROMOTING = 9; + */ + public static final int PROMOTING_VALUE = 9; + + 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 READY; + case 2: + return STOPPED; + case 3: + return CREATING; + case 4: + return DELETING; + case 5: + return MAINTENANCE; + case 6: + return FAILED; + case 8: + return BOOTSTRAPPING; + case 9: + return PROMOTING; + 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.alloydb.v1beta.Instance.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.alloydb.v1beta.Instance.State) + } + + /** + * + * + *
+   * Type of an Instance
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.Instance.InstanceType} + */ + public enum InstanceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The type of the instance is unknown.
+     * 
+ * + * INSTANCE_TYPE_UNSPECIFIED = 0; + */ + INSTANCE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * PRIMARY instances support read and write operations.
+     * 
+ * + * PRIMARY = 1; + */ + PRIMARY(1), + /** + * + * + *
+     * READ POOL instances support read operations only. Each read pool instance
+     * consists of one or more homogeneous nodes.
+     *  * Read pool of size 1 can only have zonal availability.
+     *  * Read pools with node count of 2 or more can have regional
+     *    availability (nodes are present in 2 or more zones in a region).
+     * 
+ * + * READ_POOL = 2; + */ + READ_POOL(2), + /** + * + * + *
+     * SECONDARY instances support read operations only. SECONDARY instance
+     * is a cross-region read replica
+     * 
+ * + * SECONDARY = 3; + */ + SECONDARY(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The type of the instance is unknown.
+     * 
+ * + * INSTANCE_TYPE_UNSPECIFIED = 0; + */ + public static final int INSTANCE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * PRIMARY instances support read and write operations.
+     * 
+ * + * PRIMARY = 1; + */ + public static final int PRIMARY_VALUE = 1; + /** + * + * + *
+     * READ POOL instances support read operations only. Each read pool instance
+     * consists of one or more homogeneous nodes.
+     *  * Read pool of size 1 can only have zonal availability.
+     *  * Read pools with node count of 2 or more can have regional
+     *    availability (nodes are present in 2 or more zones in a region).
+     * 
+ * + * READ_POOL = 2; + */ + public static final int READ_POOL_VALUE = 2; + /** + * + * + *
+     * SECONDARY instances support read operations only. SECONDARY instance
+     * is a cross-region read replica
+     * 
+ * + * SECONDARY = 3; + */ + public static final int SECONDARY_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 InstanceType 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 InstanceType forNumber(int value) { + switch (value) { + case 0: + return INSTANCE_TYPE_UNSPECIFIED; + case 1: + return PRIMARY; + case 2: + return READ_POOL; + case 3: + return SECONDARY; + 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 InstanceType findValueByNumber(int number) { + return InstanceType.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.alloydb.v1beta.Instance.getDescriptor().getEnumTypes().get(1); + } + + private static final InstanceType[] VALUES = values(); + + public static InstanceType 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 InstanceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.Instance.InstanceType) + } + + /** + * + * + *
+   * The Availability type of an instance. Potential values:
+   *   <br><b>ZONAL</b>: The instance serves data from only one zone.
+   * Outages in that zone affect instance availability.
+   *   <br><b>REGIONAL</b>: The instance can serve data from more than one zone
+   *   in a region (it is highly available).
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.Instance.AvailabilityType} + */ + public enum AvailabilityType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * This is an unknown Availability type.
+     * 
+ * + * AVAILABILITY_TYPE_UNSPECIFIED = 0; + */ + AVAILABILITY_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Zonal available instance.
+     * 
+ * + * ZONAL = 1; + */ + ZONAL(1), + /** + * + * + *
+     * Regional (or Highly) available instance.
+     * 
+ * + * REGIONAL = 2; + */ + REGIONAL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * This is an unknown Availability type.
+     * 
+ * + * AVAILABILITY_TYPE_UNSPECIFIED = 0; + */ + public static final int AVAILABILITY_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Zonal available instance.
+     * 
+ * + * ZONAL = 1; + */ + public static final int ZONAL_VALUE = 1; + /** + * + * + *
+     * Regional (or Highly) available instance.
+     * 
+ * + * REGIONAL = 2; + */ + public static final int REGIONAL_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 AvailabilityType 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 AvailabilityType forNumber(int value) { + switch (value) { + case 0: + return AVAILABILITY_TYPE_UNSPECIFIED; + case 1: + return ZONAL; + case 2: + return REGIONAL; + 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 AvailabilityType findValueByNumber(int number) { + return AvailabilityType.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.alloydb.v1beta.Instance.getDescriptor().getEnumTypes().get(2); + } + + private static final AvailabilityType[] VALUES = values(); + + public static AvailabilityType 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 AvailabilityType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.Instance.AvailabilityType) + } + + public interface MachineConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.Instance.MachineConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The number of CPU's in the VM instance.
+     * 
+ * + * int32 cpu_count = 1; + * + * @return The cpuCount. + */ + int getCpuCount(); + } + /** + * + * + *
+   * MachineConfig describes the configuration of a machine.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Instance.MachineConfig} + */ + public static final class MachineConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.Instance.MachineConfig) + MachineConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use MachineConfig.newBuilder() to construct. + private MachineConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MachineConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MachineConfig(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_MachineConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_MachineConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Instance.MachineConfig.class, + com.google.cloud.alloydb.v1beta.Instance.MachineConfig.Builder.class); + } + + public static final int CPU_COUNT_FIELD_NUMBER = 1; + private int cpuCount_ = 0; + /** + * + * + *
+     * The number of CPU's in the VM instance.
+     * 
+ * + * int32 cpu_count = 1; + * + * @return The cpuCount. + */ + @java.lang.Override + public int getCpuCount() { + return cpuCount_; + } + + 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 (cpuCount_ != 0) { + output.writeInt32(1, cpuCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (cpuCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, cpuCount_); + } + 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.alloydb.v1beta.Instance.MachineConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.Instance.MachineConfig other = + (com.google.cloud.alloydb.v1beta.Instance.MachineConfig) obj; + + if (getCpuCount() != other.getCpuCount()) 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) + CPU_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getCpuCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.Instance.MachineConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance.MachineConfig 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.alloydb.v1beta.Instance.MachineConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance.MachineConfig 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.alloydb.v1beta.Instance.MachineConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance.MachineConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Instance.MachineConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance.MachineConfig 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.alloydb.v1beta.Instance.MachineConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance.MachineConfig 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.alloydb.v1beta.Instance.MachineConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance.MachineConfig 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.alloydb.v1beta.Instance.MachineConfig 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; + } + /** + * + * + *
+     * MachineConfig describes the configuration of a machine.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Instance.MachineConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.Instance.MachineConfig) + com.google.cloud.alloydb.v1beta.Instance.MachineConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_MachineConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_MachineConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Instance.MachineConfig.class, + com.google.cloud.alloydb.v1beta.Instance.MachineConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.Instance.MachineConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cpuCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_MachineConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.MachineConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.Instance.MachineConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.MachineConfig build() { + com.google.cloud.alloydb.v1beta.Instance.MachineConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.MachineConfig buildPartial() { + com.google.cloud.alloydb.v1beta.Instance.MachineConfig result = + new com.google.cloud.alloydb.v1beta.Instance.MachineConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.Instance.MachineConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cpuCount_ = cpuCount_; + } + } + + @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.alloydb.v1beta.Instance.MachineConfig) { + return mergeFrom((com.google.cloud.alloydb.v1beta.Instance.MachineConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.Instance.MachineConfig other) { + if (other == com.google.cloud.alloydb.v1beta.Instance.MachineConfig.getDefaultInstance()) + return this; + if (other.getCpuCount() != 0) { + setCpuCount(other.getCpuCount()); + } + 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: + { + cpuCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + 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 bitField0_; + + private int cpuCount_; + /** + * + * + *
+       * The number of CPU's in the VM instance.
+       * 
+ * + * int32 cpu_count = 1; + * + * @return The cpuCount. + */ + @java.lang.Override + public int getCpuCount() { + return cpuCount_; + } + /** + * + * + *
+       * The number of CPU's in the VM instance.
+       * 
+ * + * int32 cpu_count = 1; + * + * @param value The cpuCount to set. + * @return This builder for chaining. + */ + public Builder setCpuCount(int value) { + + cpuCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The number of CPU's in the VM instance.
+       * 
+ * + * int32 cpu_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearCpuCount() { + bitField0_ = (bitField0_ & ~0x00000001); + cpuCount_ = 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.alloydb.v1beta.Instance.MachineConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.Instance.MachineConfig) + private static final com.google.cloud.alloydb.v1beta.Instance.MachineConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.Instance.MachineConfig(); + } + + public static com.google.cloud.alloydb.v1beta.Instance.MachineConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MachineConfig 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.alloydb.v1beta.Instance.MachineConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface NodeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.Instance.Node) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The Compute Engine zone of the VM e.g. "us-central1-b".
+     * 
+ * + * string zone_id = 1; + * + * @return The zoneId. + */ + java.lang.String getZoneId(); + /** + * + * + *
+     * The Compute Engine zone of the VM e.g. "us-central1-b".
+     * 
+ * + * string zone_id = 1; + * + * @return The bytes for zoneId. + */ + com.google.protobuf.ByteString getZoneIdBytes(); + + /** + * + * + *
+     * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+     * 
+ * + * string id = 2; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+     * 
+ * + * string id = 2; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * The private IP address of the VM e.g. "10.57.0.34".
+     * 
+ * + * string ip = 3; + * + * @return The ip. + */ + java.lang.String getIp(); + /** + * + * + *
+     * The private IP address of the VM e.g. "10.57.0.34".
+     * 
+ * + * string ip = 3; + * + * @return The bytes for ip. + */ + com.google.protobuf.ByteString getIpBytes(); + + /** + * + * + *
+     * Determined by state of the compute VM and postgres-service health.
+     * Compute VM state can have values listed in
+     * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+     * postgres-service health can have values: HEALTHY and UNHEALTHY.
+     * 
+ * + * string state = 4; + * + * @return The state. + */ + java.lang.String getState(); + /** + * + * + *
+     * Determined by state of the compute VM and postgres-service health.
+     * Compute VM state can have values listed in
+     * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+     * postgres-service health can have values: HEALTHY and UNHEALTHY.
+     * 
+ * + * string state = 4; + * + * @return The bytes for state. + */ + com.google.protobuf.ByteString getStateBytes(); + } + /** + * + * + *
+   * Details of a single node in the instance.
+   * Nodes in an AlloyDB instance are ephemereal, they can change during
+   * update, failover, autohealing and resize operations.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Instance.Node} + */ + public static final class Node extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.Instance.Node) + NodeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Node.newBuilder() to construct. + private Node(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Node() { + zoneId_ = ""; + id_ = ""; + ip_ = ""; + state_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Node(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_Node_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Instance.Node.class, + com.google.cloud.alloydb.v1beta.Instance.Node.Builder.class); + } + + public static final int ZONE_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object zoneId_ = ""; + /** + * + * + *
+     * The Compute Engine zone of the VM e.g. "us-central1-b".
+     * 
+ * + * string zone_id = 1; + * + * @return The zoneId. + */ + @java.lang.Override + public java.lang.String getZoneId() { + java.lang.Object ref = zoneId_; + 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(); + zoneId_ = s; + return s; + } + } + /** + * + * + *
+     * The Compute Engine zone of the VM e.g. "us-central1-b".
+     * 
+ * + * string zone_id = 1; + * + * @return The bytes for zoneId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getZoneIdBytes() { + java.lang.Object ref = zoneId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zoneId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+     * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+     * 
+ * + * string id = 2; + * + * @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; + } + } + /** + * + * + *
+     * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+     * 
+ * + * string id = 2; + * + * @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 IP_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object ip_ = ""; + /** + * + * + *
+     * The private IP address of the VM e.g. "10.57.0.34".
+     * 
+ * + * string ip = 3; + * + * @return The ip. + */ + @java.lang.Override + public java.lang.String getIp() { + java.lang.Object ref = ip_; + 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(); + ip_ = s; + return s; + } + } + /** + * + * + *
+     * The private IP address of the VM e.g. "10.57.0.34".
+     * 
+ * + * string ip = 3; + * + * @return The bytes for ip. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpBytes() { + java.lang.Object ref = ip_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ip_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object state_ = ""; + /** + * + * + *
+     * Determined by state of the compute VM and postgres-service health.
+     * Compute VM state can have values listed in
+     * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+     * postgres-service health can have values: HEALTHY and UNHEALTHY.
+     * 
+ * + * string state = 4; + * + * @return The state. + */ + @java.lang.Override + public java.lang.String getState() { + java.lang.Object ref = state_; + 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(); + state_ = s; + return s; + } + } + /** + * + * + *
+     * Determined by state of the compute VM and postgres-service health.
+     * Compute VM state can have values listed in
+     * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+     * postgres-service health can have values: HEALTHY and UNHEALTHY.
+     * 
+ * + * string state = 4; + * + * @return The bytes for state. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStateBytes() { + java.lang.Object ref = state_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + state_ = 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(zoneId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, zoneId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ip_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, ip_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(state_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, 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(zoneId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, zoneId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ip_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, ip_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(state_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, 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.alloydb.v1beta.Instance.Node)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.Instance.Node other = + (com.google.cloud.alloydb.v1beta.Instance.Node) obj; + + if (!getZoneId().equals(other.getZoneId())) return false; + if (!getId().equals(other.getId())) return false; + if (!getIp().equals(other.getIp())) return false; + if (!getState().equals(other.getState())) 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) + ZONE_ID_FIELD_NUMBER; + hash = (53 * hash) + getZoneId().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + IP_FIELD_NUMBER; + hash = (53 * hash) + getIp().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + getState().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.Instance.Node parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance.Node 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.alloydb.v1beta.Instance.Node parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance.Node 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.alloydb.v1beta.Instance.Node parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance.Node parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Instance.Node parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance.Node 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.alloydb.v1beta.Instance.Node parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance.Node 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.alloydb.v1beta.Instance.Node parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance.Node 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.alloydb.v1beta.Instance.Node 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; + } + /** + * + * + *
+     * Details of a single node in the instance.
+     * Nodes in an AlloyDB instance are ephemereal, they can change during
+     * update, failover, autohealing and resize operations.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Instance.Node} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.Instance.Node) + com.google.cloud.alloydb.v1beta.Instance.NodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_Node_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Instance.Node.class, + com.google.cloud.alloydb.v1beta.Instance.Node.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.Instance.Node.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + zoneId_ = ""; + id_ = ""; + ip_ = ""; + state_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_Node_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.Node getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.Instance.Node.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.Node build() { + com.google.cloud.alloydb.v1beta.Instance.Node result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.Node buildPartial() { + com.google.cloud.alloydb.v1beta.Instance.Node result = + new com.google.cloud.alloydb.v1beta.Instance.Node(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.Instance.Node result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.zoneId_ = zoneId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ip_ = ip_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.state_ = state_; + } + } + + @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.alloydb.v1beta.Instance.Node) { + return mergeFrom((com.google.cloud.alloydb.v1beta.Instance.Node) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.Instance.Node other) { + if (other == com.google.cloud.alloydb.v1beta.Instance.Node.getDefaultInstance()) + return this; + if (!other.getZoneId().isEmpty()) { + zoneId_ = other.zoneId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getIp().isEmpty()) { + ip_ = other.ip_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getState().isEmpty()) { + state_ = other.state_; + bitField0_ |= 0x00000008; + 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: + { + zoneId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + ip_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + state_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object zoneId_ = ""; + /** + * + * + *
+       * The Compute Engine zone of the VM e.g. "us-central1-b".
+       * 
+ * + * string zone_id = 1; + * + * @return The zoneId. + */ + public java.lang.String getZoneId() { + java.lang.Object ref = zoneId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + zoneId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The Compute Engine zone of the VM e.g. "us-central1-b".
+       * 
+ * + * string zone_id = 1; + * + * @return The bytes for zoneId. + */ + public com.google.protobuf.ByteString getZoneIdBytes() { + java.lang.Object ref = zoneId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zoneId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The Compute Engine zone of the VM e.g. "us-central1-b".
+       * 
+ * + * string zone_id = 1; + * + * @param value The zoneId to set. + * @return This builder for chaining. + */ + public Builder setZoneId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + zoneId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The Compute Engine zone of the VM e.g. "us-central1-b".
+       * 
+ * + * string zone_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearZoneId() { + zoneId_ = getDefaultInstance().getZoneId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The Compute Engine zone of the VM e.g. "us-central1-b".
+       * 
+ * + * string zone_id = 1; + * + * @param value The bytes for zoneId to set. + * @return This builder for chaining. + */ + public Builder setZoneIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + zoneId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+       * 
+ * + * string id = 2; + * + * @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; + } + } + /** + * + * + *
+       * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+       * 
+ * + * string id = 2; + * + * @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; + } + } + /** + * + * + *
+       * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+       * 
+ * + * string id = 2; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+       * 
+ * + * string id = 2; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
+       * 
+ * + * string id = 2; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object ip_ = ""; + /** + * + * + *
+       * The private IP address of the VM e.g. "10.57.0.34".
+       * 
+ * + * string ip = 3; + * + * @return The ip. + */ + public java.lang.String getIp() { + java.lang.Object ref = ip_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ip_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The private IP address of the VM e.g. "10.57.0.34".
+       * 
+ * + * string ip = 3; + * + * @return The bytes for ip. + */ + public com.google.protobuf.ByteString getIpBytes() { + java.lang.Object ref = ip_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ip_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The private IP address of the VM e.g. "10.57.0.34".
+       * 
+ * + * string ip = 3; + * + * @param value The ip to set. + * @return This builder for chaining. + */ + public Builder setIp(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ip_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * The private IP address of the VM e.g. "10.57.0.34".
+       * 
+ * + * string ip = 3; + * + * @return This builder for chaining. + */ + public Builder clearIp() { + ip_ = getDefaultInstance().getIp(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * The private IP address of the VM e.g. "10.57.0.34".
+       * 
+ * + * string ip = 3; + * + * @param value The bytes for ip to set. + * @return This builder for chaining. + */ + public Builder setIpBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ip_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object state_ = ""; + /** + * + * + *
+       * Determined by state of the compute VM and postgres-service health.
+       * Compute VM state can have values listed in
+       * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+       * postgres-service health can have values: HEALTHY and UNHEALTHY.
+       * 
+ * + * string state = 4; + * + * @return The state. + */ + public java.lang.String getState() { + java.lang.Object ref = state_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + state_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Determined by state of the compute VM and postgres-service health.
+       * Compute VM state can have values listed in
+       * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+       * postgres-service health can have values: HEALTHY and UNHEALTHY.
+       * 
+ * + * string state = 4; + * + * @return The bytes for state. + */ + public com.google.protobuf.ByteString getStateBytes() { + java.lang.Object ref = state_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + state_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Determined by state of the compute VM and postgres-service health.
+       * Compute VM state can have values listed in
+       * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+       * postgres-service health can have values: HEALTHY and UNHEALTHY.
+       * 
+ * + * string state = 4; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + state_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Determined by state of the compute VM and postgres-service health.
+       * Compute VM state can have values listed in
+       * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+       * postgres-service health can have values: HEALTHY and UNHEALTHY.
+       * 
+ * + * string state = 4; + * + * @return This builder for chaining. + */ + public Builder clearState() { + state_ = getDefaultInstance().getState(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+       * Determined by state of the compute VM and postgres-service health.
+       * Compute VM state can have values listed in
+       * https://cloud.google.com/compute/docs/instances/instance-life-cycle and
+       * postgres-service health can have values: HEALTHY and UNHEALTHY.
+       * 
+ * + * string state = 4; + * + * @param value The bytes for state to set. + * @return This builder for chaining. + */ + public Builder setStateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + state_ = value; + bitField0_ |= 0x00000008; + 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.alloydb.v1beta.Instance.Node) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.Instance.Node) + private static final com.google.cloud.alloydb.v1beta.Instance.Node DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.Instance.Node(); + } + + public static com.google.cloud.alloydb.v1beta.Instance.Node getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Node 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.alloydb.v1beta.Instance.Node getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryInsightsInstanceConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Record application tags for an instance.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_application_tags = 2; + * + * @return Whether the recordApplicationTags field is set. + */ + boolean hasRecordApplicationTags(); + /** + * + * + *
+     * Record application tags for an instance.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_application_tags = 2; + * + * @return The recordApplicationTags. + */ + boolean getRecordApplicationTags(); + + /** + * + * + *
+     * Record client address for an instance. Client address is PII information.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_client_address = 3; + * + * @return Whether the recordClientAddress field is set. + */ + boolean hasRecordClientAddress(); + /** + * + * + *
+     * Record client address for an instance. Client address is PII information.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_client_address = 3; + * + * @return The recordClientAddress. + */ + boolean getRecordClientAddress(); + + /** + * + * + *
+     * Query string length. The default value is 1024.
+     * Any integer between 256 and 4500 is considered valid.
+     * 
+ * + * uint32 query_string_length = 4; + * + * @return The queryStringLength. + */ + int getQueryStringLength(); + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. The default value is 5.
+     * Any integer between 0 and 20 is considered valid.
+     * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return Whether the queryPlansPerMinute field is set. + */ + boolean hasQueryPlansPerMinute(); + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. The default value is 5.
+     * Any integer between 0 and 20 is considered valid.
+     * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return The queryPlansPerMinute. + */ + int getQueryPlansPerMinute(); + } + /** + * + * + *
+   * QueryInsights Instance specific configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} + */ + public static final class QueryInsightsInstanceConfig + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig) + QueryInsightsInstanceConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryInsightsInstanceConfig.newBuilder() to construct. + private QueryInsightsInstanceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryInsightsInstanceConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryInsightsInstanceConfig(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_QueryInsightsInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_QueryInsightsInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.class, + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.Builder.class); + } + + private int bitField0_; + public static final int RECORD_APPLICATION_TAGS_FIELD_NUMBER = 2; + private boolean recordApplicationTags_ = false; + /** + * + * + *
+     * Record application tags for an instance.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_application_tags = 2; + * + * @return Whether the recordApplicationTags field is set. + */ + @java.lang.Override + public boolean hasRecordApplicationTags() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Record application tags for an instance.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_application_tags = 2; + * + * @return The recordApplicationTags. + */ + @java.lang.Override + public boolean getRecordApplicationTags() { + return recordApplicationTags_; + } + + public static final int RECORD_CLIENT_ADDRESS_FIELD_NUMBER = 3; + private boolean recordClientAddress_ = false; + /** + * + * + *
+     * Record client address for an instance. Client address is PII information.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_client_address = 3; + * + * @return Whether the recordClientAddress field is set. + */ + @java.lang.Override + public boolean hasRecordClientAddress() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Record client address for an instance. Client address is PII information.
+     * This flag is turned "on" by default.
+     * 
+ * + * optional bool record_client_address = 3; + * + * @return The recordClientAddress. + */ + @java.lang.Override + public boolean getRecordClientAddress() { + return recordClientAddress_; + } + + public static final int QUERY_STRING_LENGTH_FIELD_NUMBER = 4; + private int queryStringLength_ = 0; + /** + * + * + *
+     * Query string length. The default value is 1024.
+     * Any integer between 256 and 4500 is considered valid.
+     * 
+ * + * uint32 query_string_length = 4; + * + * @return The queryStringLength. + */ + @java.lang.Override + public int getQueryStringLength() { + return queryStringLength_; + } + + public static final int QUERY_PLANS_PER_MINUTE_FIELD_NUMBER = 5; + private int queryPlansPerMinute_ = 0; + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. The default value is 5.
+     * Any integer between 0 and 20 is considered valid.
+     * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return Whether the queryPlansPerMinute field is set. + */ + @java.lang.Override + public boolean hasQueryPlansPerMinute() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. The default value is 5.
+     * Any integer between 0 and 20 is considered valid.
+     * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return The queryPlansPerMinute. + */ + @java.lang.Override + public int getQueryPlansPerMinute() { + return queryPlansPerMinute_; + } + + 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(2, recordApplicationTags_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(3, recordClientAddress_); + } + if (queryStringLength_ != 0) { + output.writeUInt32(4, queryStringLength_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeUInt32(5, queryPlansPerMinute_); + } + 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(2, recordApplicationTags_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, recordClientAddress_); + } + if (queryStringLength_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(4, queryStringLength_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(5, queryPlansPerMinute_); + } + 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.alloydb.v1beta.Instance.QueryInsightsInstanceConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig other = + (com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig) obj; + + if (hasRecordApplicationTags() != other.hasRecordApplicationTags()) return false; + if (hasRecordApplicationTags()) { + if (getRecordApplicationTags() != other.getRecordApplicationTags()) return false; + } + if (hasRecordClientAddress() != other.hasRecordClientAddress()) return false; + if (hasRecordClientAddress()) { + if (getRecordClientAddress() != other.getRecordClientAddress()) return false; + } + if (getQueryStringLength() != other.getQueryStringLength()) return false; + if (hasQueryPlansPerMinute() != other.hasQueryPlansPerMinute()) return false; + if (hasQueryPlansPerMinute()) { + if (getQueryPlansPerMinute() != other.getQueryPlansPerMinute()) 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 (hasRecordApplicationTags()) { + hash = (37 * hash) + RECORD_APPLICATION_TAGS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRecordApplicationTags()); + } + if (hasRecordClientAddress()) { + hash = (37 * hash) + RECORD_CLIENT_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRecordClientAddress()); + } + hash = (37 * hash) + QUERY_STRING_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getQueryStringLength(); + if (hasQueryPlansPerMinute()) { + hash = (37 * hash) + QUERY_PLANS_PER_MINUTE_FIELD_NUMBER; + hash = (53 * hash) + getQueryPlansPerMinute(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig 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.alloydb.v1beta.Instance.QueryInsightsInstanceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig 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.alloydb.v1beta.Instance.QueryInsightsInstanceConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig 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.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + 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.alloydb.v1beta.Instance.QueryInsightsInstanceConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig 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.alloydb.v1beta.Instance.QueryInsightsInstanceConfig 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; + } + /** + * + * + *
+     * QueryInsights Instance specific configuration.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig) + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_QueryInsightsInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_QueryInsightsInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.class, + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.Builder.class); + } + + // Construct using + // com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + recordApplicationTags_ = false; + recordClientAddress_ = false; + queryStringLength_ = 0; + queryPlansPerMinute_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_QueryInsightsInstanceConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig build() { + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig buildPartial() { + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig result = + new com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.recordApplicationTags_ = recordApplicationTags_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.recordClientAddress_ = recordClientAddress_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.queryStringLength_ = queryStringLength_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.queryPlansPerMinute_ = queryPlansPerMinute_; + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @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.alloydb.v1beta.Instance.QueryInsightsInstanceConfig) { + return mergeFrom( + (com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig other) { + if (other + == com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + .getDefaultInstance()) return this; + if (other.hasRecordApplicationTags()) { + setRecordApplicationTags(other.getRecordApplicationTags()); + } + if (other.hasRecordClientAddress()) { + setRecordClientAddress(other.getRecordClientAddress()); + } + if (other.getQueryStringLength() != 0) { + setQueryStringLength(other.getQueryStringLength()); + } + if (other.hasQueryPlansPerMinute()) { + setQueryPlansPerMinute(other.getQueryPlansPerMinute()); + } + 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 16: + { + recordApplicationTags_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 16 + case 24: + { + recordClientAddress_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 24 + case 32: + { + queryStringLength_ = input.readUInt32(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 40: + { + queryPlansPerMinute_ = input.readUInt32(); + bitField0_ |= 0x00000008; + break; + } // case 40 + 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 recordApplicationTags_; + /** + * + * + *
+       * Record application tags for an instance.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_application_tags = 2; + * + * @return Whether the recordApplicationTags field is set. + */ + @java.lang.Override + public boolean hasRecordApplicationTags() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Record application tags for an instance.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_application_tags = 2; + * + * @return The recordApplicationTags. + */ + @java.lang.Override + public boolean getRecordApplicationTags() { + return recordApplicationTags_; + } + /** + * + * + *
+       * Record application tags for an instance.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_application_tags = 2; + * + * @param value The recordApplicationTags to set. + * @return This builder for chaining. + */ + public Builder setRecordApplicationTags(boolean value) { + + recordApplicationTags_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Record application tags for an instance.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_application_tags = 2; + * + * @return This builder for chaining. + */ + public Builder clearRecordApplicationTags() { + bitField0_ = (bitField0_ & ~0x00000001); + recordApplicationTags_ = false; + onChanged(); + return this; + } + + private boolean recordClientAddress_; + /** + * + * + *
+       * Record client address for an instance. Client address is PII information.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_client_address = 3; + * + * @return Whether the recordClientAddress field is set. + */ + @java.lang.Override + public boolean hasRecordClientAddress() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Record client address for an instance. Client address is PII information.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_client_address = 3; + * + * @return The recordClientAddress. + */ + @java.lang.Override + public boolean getRecordClientAddress() { + return recordClientAddress_; + } + /** + * + * + *
+       * Record client address for an instance. Client address is PII information.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_client_address = 3; + * + * @param value The recordClientAddress to set. + * @return This builder for chaining. + */ + public Builder setRecordClientAddress(boolean value) { + + recordClientAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Record client address for an instance. Client address is PII information.
+       * This flag is turned "on" by default.
+       * 
+ * + * optional bool record_client_address = 3; + * + * @return This builder for chaining. + */ + public Builder clearRecordClientAddress() { + bitField0_ = (bitField0_ & ~0x00000002); + recordClientAddress_ = false; + onChanged(); + return this; + } + + private int queryStringLength_; + /** + * + * + *
+       * Query string length. The default value is 1024.
+       * Any integer between 256 and 4500 is considered valid.
+       * 
+ * + * uint32 query_string_length = 4; + * + * @return The queryStringLength. + */ + @java.lang.Override + public int getQueryStringLength() { + return queryStringLength_; + } + /** + * + * + *
+       * Query string length. The default value is 1024.
+       * Any integer between 256 and 4500 is considered valid.
+       * 
+ * + * uint32 query_string_length = 4; + * + * @param value The queryStringLength to set. + * @return This builder for chaining. + */ + public Builder setQueryStringLength(int value) { + + queryStringLength_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Query string length. The default value is 1024.
+       * Any integer between 256 and 4500 is considered valid.
+       * 
+ * + * uint32 query_string_length = 4; + * + * @return This builder for chaining. + */ + public Builder clearQueryStringLength() { + bitField0_ = (bitField0_ & ~0x00000004); + queryStringLength_ = 0; + onChanged(); + return this; + } + + private int queryPlansPerMinute_; + /** + * + * + *
+       * Number of query execution plans captured by Insights per minute
+       * for all queries combined. The default value is 5.
+       * Any integer between 0 and 20 is considered valid.
+       * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return Whether the queryPlansPerMinute field is set. + */ + @java.lang.Override + public boolean hasQueryPlansPerMinute() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+       * Number of query execution plans captured by Insights per minute
+       * for all queries combined. The default value is 5.
+       * Any integer between 0 and 20 is considered valid.
+       * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return The queryPlansPerMinute. + */ + @java.lang.Override + public int getQueryPlansPerMinute() { + return queryPlansPerMinute_; + } + /** + * + * + *
+       * Number of query execution plans captured by Insights per minute
+       * for all queries combined. The default value is 5.
+       * Any integer between 0 and 20 is considered valid.
+       * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @param value The queryPlansPerMinute to set. + * @return This builder for chaining. + */ + public Builder setQueryPlansPerMinute(int value) { + + queryPlansPerMinute_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Number of query execution plans captured by Insights per minute
+       * for all queries combined. The default value is 5.
+       * Any integer between 0 and 20 is considered valid.
+       * 
+ * + * optional uint32 query_plans_per_minute = 5; + * + * @return This builder for chaining. + */ + public Builder clearQueryPlansPerMinute() { + bitField0_ = (bitField0_ & ~0x00000008); + queryPlansPerMinute_ = 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.alloydb.v1beta.Instance.QueryInsightsInstanceConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig) + private static final com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig(); + } + + public static com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryInsightsInstanceConfig 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.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ReadPoolConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Read capacity, i.e. number of nodes in a read pool instance.
+     * 
+ * + * int32 node_count = 1; + * + * @return The nodeCount. + */ + int getNodeCount(); + } + /** + * + * + *
+   * Configuration for a read pool instance.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} + */ + public static final class ReadPoolConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) + ReadPoolConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadPoolConfig.newBuilder() to construct. + private ReadPoolConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadPoolConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReadPoolConfig(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.class, + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.Builder.class); + } + + public static final int NODE_COUNT_FIELD_NUMBER = 1; + private int nodeCount_ = 0; + /** + * + * + *
+     * Read capacity, i.e. number of nodes in a read pool instance.
+     * 
+ * + * int32 node_count = 1; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + + 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 (nodeCount_ != 0) { + output.writeInt32(1, nodeCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (nodeCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, nodeCount_); + } + 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.alloydb.v1beta.Instance.ReadPoolConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig other = + (com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) obj; + + if (getNodeCount() != other.getNodeCount()) 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) + NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getNodeCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig 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.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig 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.alloydb.v1beta.Instance.ReadPoolConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig 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.alloydb.v1beta.Instance.ReadPoolConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig 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.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig 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.alloydb.v1beta.Instance.ReadPoolConfig 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; + } + /** + * + * + *
+     * Configuration for a read pool instance.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.class, + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + nodeCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig build() { + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig buildPartial() { + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig result = + new com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.nodeCount_ = nodeCount_; + } + } + + @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.alloydb.v1beta.Instance.ReadPoolConfig) { + return mergeFrom((com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig other) { + if (other == com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.getDefaultInstance()) + return this; + if (other.getNodeCount() != 0) { + setNodeCount(other.getNodeCount()); + } + 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: + { + nodeCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + 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 bitField0_; + + private int nodeCount_; + /** + * + * + *
+       * Read capacity, i.e. number of nodes in a read pool instance.
+       * 
+ * + * int32 node_count = 1; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + /** + * + * + *
+       * Read capacity, i.e. number of nodes in a read pool instance.
+       * 
+ * + * int32 node_count = 1; + * + * @param value The nodeCount to set. + * @return This builder for chaining. + */ + public Builder setNodeCount(int value) { + + nodeCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Read capacity, i.e. number of nodes in a read pool instance.
+       * 
+ * + * int32 node_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearNodeCount() { + bitField0_ = (bitField0_ & ~0x00000001); + nodeCount_ = 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.alloydb.v1beta.Instance.ReadPoolConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) + private static final com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig(); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadPoolConfig 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.alloydb.v1beta.Instance.ReadPoolConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The name of the instance resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+   * where the cluster and instance ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the instance resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The name of the instance resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+   * where the cluster and instance ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the instance resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * User-settable and human-readable display name for the Instance.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * User-settable and human-readable display name for the Instance.
+   * 
+ * + * 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 UID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + 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(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int DELETE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + + public static final int LABELS_FIELD_NUMBER = 7; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATE_FIELD_NUMBER = 8; + private int state_ = 0; + /** + * + * + *
+   * Output only. The current serving state of the instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current serving state of the instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.State getState() { + com.google.cloud.alloydb.v1beta.Instance.State result = + com.google.cloud.alloydb.v1beta.Instance.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1beta.Instance.State.UNRECOGNIZED : result; + } + + public static final int INSTANCE_TYPE_FIELD_NUMBER = 9; + private int instanceType_ = 0; + /** + * + * + *
+   * Required. The type of the instance. Specified at creation time.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for instanceType. + */ + @java.lang.Override + public int getInstanceTypeValue() { + return instanceType_; + } + /** + * + * + *
+   * Required. The type of the instance. Specified at creation time.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instanceType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.InstanceType getInstanceType() { + com.google.cloud.alloydb.v1beta.Instance.InstanceType result = + com.google.cloud.alloydb.v1beta.Instance.InstanceType.forNumber(instanceType_); + return result == null + ? com.google.cloud.alloydb.v1beta.Instance.InstanceType.UNRECOGNIZED + : result; + } + + public static final int MACHINE_CONFIG_FIELD_NUMBER = 10; + private com.google.cloud.alloydb.v1beta.Instance.MachineConfig machineConfig_; + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + * + * @return Whether the machineConfig field is set. + */ + @java.lang.Override + public boolean hasMachineConfig() { + return machineConfig_ != null; + } + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + * + * @return The machineConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.MachineConfig getMachineConfig() { + return machineConfig_ == null + ? com.google.cloud.alloydb.v1beta.Instance.MachineConfig.getDefaultInstance() + : machineConfig_; + } + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.MachineConfigOrBuilder + getMachineConfigOrBuilder() { + return machineConfig_ == null + ? com.google.cloud.alloydb.v1beta.Instance.MachineConfig.getDefaultInstance() + : machineConfig_; + } + + public static final int AVAILABILITY_TYPE_FIELD_NUMBER = 11; + private int availabilityType_ = 0; + /** + * + * + *
+   * Availability type of an Instance.
+   * Defaults to REGIONAL for both primary and read instances.
+   * Note that primary and read instances can have different availability types.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; + * + * @return The enum numeric value on the wire for availabilityType. + */ + @java.lang.Override + public int getAvailabilityTypeValue() { + return availabilityType_; + } + /** + * + * + *
+   * Availability type of an Instance.
+   * Defaults to REGIONAL for both primary and read instances.
+   * Note that primary and read instances can have different availability types.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; + * + * @return The availabilityType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.AvailabilityType getAvailabilityType() { + com.google.cloud.alloydb.v1beta.Instance.AvailabilityType result = + com.google.cloud.alloydb.v1beta.Instance.AvailabilityType.forNumber(availabilityType_); + return result == null + ? com.google.cloud.alloydb.v1beta.Instance.AvailabilityType.UNRECOGNIZED + : result; + } + + public static final int GCE_ZONE_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object gceZone_ = ""; + /** + * + * + *
+   * The Compute Engine zone that the instance should serve from, per
+   * https://cloud.google.com/compute/docs/regions-zones
+   * This can ONLY be specified for ZONAL instances.
+   * If present for a REGIONAL instance, an error will be thrown.
+   * If this is absent for a ZONAL instance, instance is created in a random
+   * zone with available capacity.
+   * 
+ * + * string gce_zone = 12; + * + * @return The gceZone. + */ + @java.lang.Override + public java.lang.String getGceZone() { + java.lang.Object ref = gceZone_; + 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(); + gceZone_ = s; + return s; + } + } + /** + * + * + *
+   * The Compute Engine zone that the instance should serve from, per
+   * https://cloud.google.com/compute/docs/regions-zones
+   * This can ONLY be specified for ZONAL instances.
+   * If present for a REGIONAL instance, an error will be thrown.
+   * If this is absent for a ZONAL instance, instance is created in a random
+   * zone with available capacity.
+   * 
+ * + * string gce_zone = 12; + * + * @return The bytes for gceZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGceZoneBytes() { + java.lang.Object ref = gceZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_FLAGS_FIELD_NUMBER = 13; + + private static final class DatabaseFlagsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_DatabaseFlagsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField databaseFlags_; + + private com.google.protobuf.MapField + internalGetDatabaseFlags() { + if (databaseFlags_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DatabaseFlagsDefaultEntryHolder.defaultEntry); + } + return databaseFlags_; + } + + public int getDatabaseFlagsCount() { + return internalGetDatabaseFlags().getMap().size(); + } + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public boolean containsDatabaseFlags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetDatabaseFlags().getMap().containsKey(key); + } + /** Use {@link #getDatabaseFlagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDatabaseFlags() { + return getDatabaseFlagsMap(); + } + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public java.util.Map getDatabaseFlagsMap() { + return internalGetDatabaseFlags().getMap(); + } + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public /* nullable */ java.lang.String getDatabaseFlagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDatabaseFlags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public java.lang.String getDatabaseFlagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDatabaseFlags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int WRITABLE_NODE_FIELD_NUMBER = 19; + private com.google.cloud.alloydb.v1beta.Instance.Node writableNode_; + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writableNode field is set. + */ + @java.lang.Override + public boolean hasWritableNode() { + return writableNode_ != null; + } + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writableNode. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.Node getWritableNode() { + return writableNode_ == null + ? com.google.cloud.alloydb.v1beta.Instance.Node.getDefaultInstance() + : writableNode_; + } + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.NodeOrBuilder getWritableNodeOrBuilder() { + return writableNode_ == null + ? com.google.cloud.alloydb.v1beta.Instance.Node.getDefaultInstance() + : writableNode_; + } + + public static final int NODES_FIELD_NUMBER = 20; + + @SuppressWarnings("serial") + private java.util.List nodes_; + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getNodesList() { + return nodes_; + } + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getNodesOrBuilderList() { + return nodes_; + } + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getNodesCount() { + return nodes_.size(); + } + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.Node getNodes(int index) { + return nodes_.get(index); + } + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.NodeOrBuilder getNodesOrBuilder(int index) { + return nodes_.get(index); + } + + public static final int QUERY_INSIGHTS_CONFIG_FIELD_NUMBER = 21; + private com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig queryInsightsConfig_; + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return Whether the queryInsightsConfig field is set. + */ + @java.lang.Override + public boolean hasQueryInsightsConfig() { + return queryInsightsConfig_ != null; + } + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return The queryInsightsConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + getQueryInsightsConfig() { + return queryInsightsConfig_ == null + ? com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.getDefaultInstance() + : queryInsightsConfig_; + } + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfigOrBuilder + getQueryInsightsConfigOrBuilder() { + return queryInsightsConfig_ == null + ? com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.getDefaultInstance() + : queryInsightsConfig_; + } + + public static final int READ_POOL_CONFIG_FIELD_NUMBER = 14; + private com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig readPoolConfig_; + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return Whether the readPoolConfig field is set. + */ + @java.lang.Override + public boolean hasReadPoolConfig() { + return readPoolConfig_ != null; + } + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return The readPoolConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig getReadPoolConfig() { + return readPoolConfig_ == null + ? com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.getDefaultInstance() + : readPoolConfig_; + } + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfigOrBuilder + getReadPoolConfigOrBuilder() { + return readPoolConfig_ == null + ? com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.getDefaultInstance() + : readPoolConfig_; + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object ipAddress_ = ""; + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ipAddress. + */ + @java.lang.Override + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + 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(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for ipAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECONCILING_FIELD_NUMBER = 16; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+   * Set to true if the current state of Instance does not match the user's
+   * intended state, and the service is actively updating the resource to
+   * reconcile them. This can happen due to user-triggered updates or
+   * system actions like failover or maintenance.
+   * 
+ * + * bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int ETAG_FIELD_NUMBER = 17; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 17; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 17; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 18; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().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(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(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uid_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (deleteTime_ != null) { + output.writeMessage(6, getDeleteTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 7); + if (state_ != com.google.cloud.alloydb.v1beta.Instance.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, state_); + } + if (instanceType_ + != com.google.cloud.alloydb.v1beta.Instance.InstanceType.INSTANCE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, instanceType_); + } + if (machineConfig_ != null) { + output.writeMessage(10, getMachineConfig()); + } + if (availabilityType_ + != com.google.cloud.alloydb.v1beta.Instance.AvailabilityType.AVAILABILITY_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(11, availabilityType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gceZone_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, gceZone_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetDatabaseFlags(), DatabaseFlagsDefaultEntryHolder.defaultEntry, 13); + if (readPoolConfig_ != null) { + output.writeMessage(14, getReadPoolConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, ipAddress_); + } + if (reconciling_ != false) { + output.writeBool(16, reconciling_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, etag_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 18); + if (writableNode_ != null) { + output.writeMessage(19, getWritableNode()); + } + for (int i = 0; i < nodes_.size(); i++) { + output.writeMessage(20, nodes_.get(i)); + } + if (queryInsightsConfig_ != null) { + output.writeMessage(21, getQueryInsightsConfig()); + } + 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(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uid_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDeleteTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, labels__); + } + if (state_ != com.google.cloud.alloydb.v1beta.Instance.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, state_); + } + if (instanceType_ + != com.google.cloud.alloydb.v1beta.Instance.InstanceType.INSTANCE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, instanceType_); + } + if (machineConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getMachineConfig()); + } + if (availabilityType_ + != com.google.cloud.alloydb.v1beta.Instance.AvailabilityType.AVAILABILITY_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, availabilityType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gceZone_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, gceZone_); + } + for (java.util.Map.Entry entry : + internalGetDatabaseFlags().getMap().entrySet()) { + com.google.protobuf.MapEntry databaseFlags__ = + DatabaseFlagsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, databaseFlags__); + } + if (readPoolConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getReadPoolConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, ipAddress_); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(16, reconciling_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, etag_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, annotations__); + } + if (writableNode_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getWritableNode()); + } + for (int i = 0; i < nodes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, nodes_.get(i)); + } + if (queryInsightsConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(21, getQueryInsightsConfig()); + } + 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.alloydb.v1beta.Instance)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.Instance other = (com.google.cloud.alloydb.v1beta.Instance) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (state_ != other.state_) return false; + if (instanceType_ != other.instanceType_) return false; + if (hasMachineConfig() != other.hasMachineConfig()) return false; + if (hasMachineConfig()) { + if (!getMachineConfig().equals(other.getMachineConfig())) return false; + } + if (availabilityType_ != other.availabilityType_) return false; + if (!getGceZone().equals(other.getGceZone())) return false; + if (!internalGetDatabaseFlags().equals(other.internalGetDatabaseFlags())) return false; + if (hasWritableNode() != other.hasWritableNode()) return false; + if (hasWritableNode()) { + if (!getWritableNode().equals(other.getWritableNode())) return false; + } + if (!getNodesList().equals(other.getNodesList())) return false; + if (hasQueryInsightsConfig() != other.hasQueryInsightsConfig()) return false; + if (hasQueryInsightsConfig()) { + if (!getQueryInsightsConfig().equals(other.getQueryInsightsConfig())) return false; + } + if (hasReadPoolConfig() != other.hasReadPoolConfig()) return false; + if (hasReadPoolConfig()) { + if (!getReadPoolConfig().equals(other.getReadPoolConfig())) return false; + } + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (getReconciling() != other.getReconciling()) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) 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(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + INSTANCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + instanceType_; + if (hasMachineConfig()) { + hash = (37 * hash) + MACHINE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getMachineConfig().hashCode(); + } + hash = (37 * hash) + AVAILABILITY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + availabilityType_; + hash = (37 * hash) + GCE_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getGceZone().hashCode(); + if (!internalGetDatabaseFlags().getMap().isEmpty()) { + hash = (37 * hash) + DATABASE_FLAGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetDatabaseFlags().hashCode(); + } + if (hasWritableNode()) { + hash = (37 * hash) + WRITABLE_NODE_FIELD_NUMBER; + hash = (53 * hash) + getWritableNode().hashCode(); + } + if (getNodesCount() > 0) { + hash = (37 * hash) + NODES_FIELD_NUMBER; + hash = (53 * hash) + getNodesList().hashCode(); + } + if (hasQueryInsightsConfig()) { + hash = (37 * hash) + QUERY_INSIGHTS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getQueryInsightsConfig().hashCode(); + } + if (hasReadPoolConfig()) { + hash = (37 * hash) + READ_POOL_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getReadPoolConfig().hashCode(); + } + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.Instance parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance 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.alloydb.v1beta.Instance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance 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.alloydb.v1beta.Instance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Instance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance 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.alloydb.v1beta.Instance parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance 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.alloydb.v1beta.Instance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance 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.alloydb.v1beta.Instance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An Instance is a computing unit that an end customer can connect to.
+   * It's the main unit of computing resources in AlloyDB.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Instance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.Instance) + com.google.cloud.alloydb.v1beta.InstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetLabels(); + case 13: + return internalGetDatabaseFlags(); + case 18: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableLabels(); + case 13: + return internalGetMutableDatabaseFlags(); + case 18: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Instance.class, + com.google.cloud.alloydb.v1beta.Instance.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.Instance.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + uid_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + state_ = 0; + instanceType_ = 0; + machineConfig_ = null; + if (machineConfigBuilder_ != null) { + machineConfigBuilder_.dispose(); + machineConfigBuilder_ = null; + } + availabilityType_ = 0; + gceZone_ = ""; + internalGetMutableDatabaseFlags().clear(); + writableNode_ = null; + if (writableNodeBuilder_ != null) { + writableNodeBuilder_.dispose(); + writableNodeBuilder_ = null; + } + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + } else { + nodes_ = null; + nodesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00004000); + queryInsightsConfig_ = null; + if (queryInsightsConfigBuilder_ != null) { + queryInsightsConfigBuilder_.dispose(); + queryInsightsConfigBuilder_ = null; + } + readPoolConfig_ = null; + if (readPoolConfigBuilder_ != null) { + readPoolConfigBuilder_.dispose(); + readPoolConfigBuilder_ = null; + } + ipAddress_ = ""; + reconciling_ = false; + etag_ = ""; + internalGetMutableAnnotations().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance build() { + com.google.cloud.alloydb.v1beta.Instance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance buildPartial() { + com.google.cloud.alloydb.v1beta.Instance result = + new com.google.cloud.alloydb.v1beta.Instance(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.alloydb.v1beta.Instance result) { + if (nodesBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0)) { + nodes_ = java.util.Collections.unmodifiableList(nodes_); + bitField0_ = (bitField0_ & ~0x00004000); + } + result.nodes_ = nodes_; + } else { + result.nodes_ = nodesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.Instance result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.instanceType_ = instanceType_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.machineConfig_ = + machineConfigBuilder_ == null ? machineConfig_ : machineConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.availabilityType_ = availabilityType_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.gceZone_ = gceZone_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.databaseFlags_ = internalGetDatabaseFlags(); + result.databaseFlags_.makeImmutable(); + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.writableNode_ = + writableNodeBuilder_ == null ? writableNode_ : writableNodeBuilder_.build(); + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.queryInsightsConfig_ = + queryInsightsConfigBuilder_ == null + ? queryInsightsConfig_ + : queryInsightsConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.readPoolConfig_ = + readPoolConfigBuilder_ == null ? readPoolConfig_ : readPoolConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.ipAddress_ = ipAddress_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + } + + @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.alloydb.v1beta.Instance) { + return mergeFrom((com.google.cloud.alloydb.v1beta.Instance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.Instance other) { + if (other == com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000040; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.instanceType_ != 0) { + setInstanceTypeValue(other.getInstanceTypeValue()); + } + if (other.hasMachineConfig()) { + mergeMachineConfig(other.getMachineConfig()); + } + if (other.availabilityType_ != 0) { + setAvailabilityTypeValue(other.getAvailabilityTypeValue()); + } + if (!other.getGceZone().isEmpty()) { + gceZone_ = other.gceZone_; + bitField0_ |= 0x00000800; + onChanged(); + } + internalGetMutableDatabaseFlags().mergeFrom(other.internalGetDatabaseFlags()); + bitField0_ |= 0x00001000; + if (other.hasWritableNode()) { + mergeWritableNode(other.getWritableNode()); + } + if (nodesBuilder_ == null) { + if (!other.nodes_.isEmpty()) { + if (nodes_.isEmpty()) { + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00004000); + } else { + ensureNodesIsMutable(); + nodes_.addAll(other.nodes_); + } + onChanged(); + } + } else { + if (!other.nodes_.isEmpty()) { + if (nodesBuilder_.isEmpty()) { + nodesBuilder_.dispose(); + nodesBuilder_ = null; + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00004000); + nodesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNodesFieldBuilder() + : null; + } else { + nodesBuilder_.addAllMessages(other.nodes_); + } + } + } + if (other.hasQueryInsightsConfig()) { + mergeQueryInsightsConfig(other.getQueryInsightsConfig()); + } + if (other.hasReadPoolConfig()) { + mergeReadPoolConfig(other.getReadPoolConfig()); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + bitField0_ |= 0x00020000; + onChanged(); + } + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00080000; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00100000; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: + { + instanceType_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 82: + { + input.readMessage(getMachineConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 88: + { + availabilityType_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 98: + { + gceZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 106: + { + com.google.protobuf.MapEntry databaseFlags__ = + input.readMessage( + DatabaseFlagsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableDatabaseFlags() + .getMutableMap() + .put(databaseFlags__.getKey(), databaseFlags__.getValue()); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 114: + { + input.readMessage(getReadPoolConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 114 + case 122: + { + ipAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00020000; + break; + } // case 122 + case 128: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00040000; + break; + } // case 128 + case 138: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00080000; + break; + } // case 138 + case 146: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00100000; + break; + } // case 146 + case 154: + { + input.readMessage(getWritableNodeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 154 + case 162: + { + com.google.cloud.alloydb.v1beta.Instance.Node m = + input.readMessage( + com.google.cloud.alloydb.v1beta.Instance.Node.parser(), extensionRegistry); + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(m); + } else { + nodesBuilder_.addMessage(m); + } + break; + } // case 162 + case 170: + { + input.readMessage( + getQueryInsightsConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00008000; + break; + } // case 170 + 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_ = ""; + /** + * + * + *
+     * Output only. The name of the instance resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+     * where the cluster and instance ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the instance resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the instance resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+     * where the cluster and instance ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the instance resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the instance resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+     * where the cluster and instance ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the instance resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the instance resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+     * where the cluster and instance ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the instance resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the instance resource with the format:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+     * where the cluster and instance ID segments should satisfy the regex
+     * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+     * lowercase letters, numbers, and dashes, starting with a letter, and ending
+     * with a letter or number. For more details see https://google.aip.dev/122.
+     * The prefix of the instance resource name is the name of the parent
+     * resource:
+     *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * User-settable and human-readable display name for the Instance.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Instance.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * User-settable and human-readable display name for the Instance.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Instance.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * User-settable and human-readable display name for the Instance.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UID of the resource. The UID is assigned
+     * when the resource is created, and it is retained until it is deleted.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + 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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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 deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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; + } else { + deleteTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); + } else { + deleteTime_ = value; + } + } else { + deleteTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + bitField0_ = (bitField0_ & ~0x00000020); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 6 [(.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. Delete time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp delete_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> + 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_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000040; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000040; + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current serving state of the instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current serving state of the instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current serving state of the instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.State getState() { + com.google.cloud.alloydb.v1beta.Instance.State result = + com.google.cloud.alloydb.v1beta.Instance.State.forNumber(state_); + return result == null ? com.google.cloud.alloydb.v1beta.Instance.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current serving state of the instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.alloydb.v1beta.Instance.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current serving state of the instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000080); + state_ = 0; + onChanged(); + return this; + } + + private int instanceType_ = 0; + /** + * + * + *
+     * Required. The type of the instance. Specified at creation time.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for instanceType. + */ + @java.lang.Override + public int getInstanceTypeValue() { + return instanceType_; + } + /** + * + * + *
+     * Required. The type of the instance. Specified at creation time.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for instanceType to set. + * @return This builder for chaining. + */ + public Builder setInstanceTypeValue(int value) { + instanceType_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of the instance. Specified at creation time.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instanceType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.InstanceType getInstanceType() { + com.google.cloud.alloydb.v1beta.Instance.InstanceType result = + com.google.cloud.alloydb.v1beta.Instance.InstanceType.forNumber(instanceType_); + return result == null + ? com.google.cloud.alloydb.v1beta.Instance.InstanceType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The type of the instance. Specified at creation time.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The instanceType to set. + * @return This builder for chaining. + */ + public Builder setInstanceType(com.google.cloud.alloydb.v1beta.Instance.InstanceType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + instanceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of the instance. Specified at creation time.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearInstanceType() { + bitField0_ = (bitField0_ & ~0x00000100); + instanceType_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1beta.Instance.MachineConfig machineConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.MachineConfig, + com.google.cloud.alloydb.v1beta.Instance.MachineConfig.Builder, + com.google.cloud.alloydb.v1beta.Instance.MachineConfigOrBuilder> + machineConfigBuilder_; + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + * + * @return Whether the machineConfig field is set. + */ + public boolean hasMachineConfig() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + * + * @return The machineConfig. + */ + public com.google.cloud.alloydb.v1beta.Instance.MachineConfig getMachineConfig() { + if (machineConfigBuilder_ == null) { + return machineConfig_ == null + ? com.google.cloud.alloydb.v1beta.Instance.MachineConfig.getDefaultInstance() + : machineConfig_; + } else { + return machineConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + */ + public Builder setMachineConfig(com.google.cloud.alloydb.v1beta.Instance.MachineConfig value) { + if (machineConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + machineConfig_ = value; + } else { + machineConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + */ + public Builder setMachineConfig( + com.google.cloud.alloydb.v1beta.Instance.MachineConfig.Builder builderForValue) { + if (machineConfigBuilder_ == null) { + machineConfig_ = builderForValue.build(); + } else { + machineConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + */ + public Builder mergeMachineConfig( + com.google.cloud.alloydb.v1beta.Instance.MachineConfig value) { + if (machineConfigBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && machineConfig_ != null + && machineConfig_ + != com.google.cloud.alloydb.v1beta.Instance.MachineConfig.getDefaultInstance()) { + getMachineConfigBuilder().mergeFrom(value); + } else { + machineConfig_ = value; + } + } else { + machineConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + */ + public Builder clearMachineConfig() { + bitField0_ = (bitField0_ & ~0x00000200); + machineConfig_ = null; + if (machineConfigBuilder_ != null) { + machineConfigBuilder_.dispose(); + machineConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + */ + public com.google.cloud.alloydb.v1beta.Instance.MachineConfig.Builder + getMachineConfigBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getMachineConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + */ + public com.google.cloud.alloydb.v1beta.Instance.MachineConfigOrBuilder + getMachineConfigOrBuilder() { + if (machineConfigBuilder_ != null) { + return machineConfigBuilder_.getMessageOrBuilder(); + } else { + return machineConfig_ == null + ? com.google.cloud.alloydb.v1beta.Instance.MachineConfig.getDefaultInstance() + : machineConfig_; + } + } + /** + * + * + *
+     * Configurations for the machines that host the underlying
+     * database engine.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.MachineConfig, + com.google.cloud.alloydb.v1beta.Instance.MachineConfig.Builder, + com.google.cloud.alloydb.v1beta.Instance.MachineConfigOrBuilder> + getMachineConfigFieldBuilder() { + if (machineConfigBuilder_ == null) { + machineConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.MachineConfig, + com.google.cloud.alloydb.v1beta.Instance.MachineConfig.Builder, + com.google.cloud.alloydb.v1beta.Instance.MachineConfigOrBuilder>( + getMachineConfig(), getParentForChildren(), isClean()); + machineConfig_ = null; + } + return machineConfigBuilder_; + } + + private int availabilityType_ = 0; + /** + * + * + *
+     * Availability type of an Instance.
+     * Defaults to REGIONAL for both primary and read instances.
+     * Note that primary and read instances can have different availability types.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; + * + * @return The enum numeric value on the wire for availabilityType. + */ + @java.lang.Override + public int getAvailabilityTypeValue() { + return availabilityType_; + } + /** + * + * + *
+     * Availability type of an Instance.
+     * Defaults to REGIONAL for both primary and read instances.
+     * Note that primary and read instances can have different availability types.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; + * + * @param value The enum numeric value on the wire for availabilityType to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityTypeValue(int value) { + availabilityType_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Availability type of an Instance.
+     * Defaults to REGIONAL for both primary and read instances.
+     * Note that primary and read instances can have different availability types.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; + * + * @return The availabilityType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.AvailabilityType getAvailabilityType() { + com.google.cloud.alloydb.v1beta.Instance.AvailabilityType result = + com.google.cloud.alloydb.v1beta.Instance.AvailabilityType.forNumber(availabilityType_); + return result == null + ? com.google.cloud.alloydb.v1beta.Instance.AvailabilityType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Availability type of an Instance.
+     * Defaults to REGIONAL for both primary and read instances.
+     * Note that primary and read instances can have different availability types.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; + * + * @param value The availabilityType to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityType( + com.google.cloud.alloydb.v1beta.Instance.AvailabilityType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + availabilityType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Availability type of an Instance.
+     * Defaults to REGIONAL for both primary and read instances.
+     * Note that primary and read instances can have different availability types.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; + * + * @return This builder for chaining. + */ + public Builder clearAvailabilityType() { + bitField0_ = (bitField0_ & ~0x00000400); + availabilityType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object gceZone_ = ""; + /** + * + * + *
+     * The Compute Engine zone that the instance should serve from, per
+     * https://cloud.google.com/compute/docs/regions-zones
+     * This can ONLY be specified for ZONAL instances.
+     * If present for a REGIONAL instance, an error will be thrown.
+     * If this is absent for a ZONAL instance, instance is created in a random
+     * zone with available capacity.
+     * 
+ * + * string gce_zone = 12; + * + * @return The gceZone. + */ + public java.lang.String getGceZone() { + java.lang.Object ref = gceZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gceZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Compute Engine zone that the instance should serve from, per
+     * https://cloud.google.com/compute/docs/regions-zones
+     * This can ONLY be specified for ZONAL instances.
+     * If present for a REGIONAL instance, an error will be thrown.
+     * If this is absent for a ZONAL instance, instance is created in a random
+     * zone with available capacity.
+     * 
+ * + * string gce_zone = 12; + * + * @return The bytes for gceZone. + */ + public com.google.protobuf.ByteString getGceZoneBytes() { + java.lang.Object ref = gceZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Compute Engine zone that the instance should serve from, per
+     * https://cloud.google.com/compute/docs/regions-zones
+     * This can ONLY be specified for ZONAL instances.
+     * If present for a REGIONAL instance, an error will be thrown.
+     * If this is absent for a ZONAL instance, instance is created in a random
+     * zone with available capacity.
+     * 
+ * + * string gce_zone = 12; + * + * @param value The gceZone to set. + * @return This builder for chaining. + */ + public Builder setGceZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + gceZone_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * The Compute Engine zone that the instance should serve from, per
+     * https://cloud.google.com/compute/docs/regions-zones
+     * This can ONLY be specified for ZONAL instances.
+     * If present for a REGIONAL instance, an error will be thrown.
+     * If this is absent for a ZONAL instance, instance is created in a random
+     * zone with available capacity.
+     * 
+ * + * string gce_zone = 12; + * + * @return This builder for chaining. + */ + public Builder clearGceZone() { + gceZone_ = getDefaultInstance().getGceZone(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+     * The Compute Engine zone that the instance should serve from, per
+     * https://cloud.google.com/compute/docs/regions-zones
+     * This can ONLY be specified for ZONAL instances.
+     * If present for a REGIONAL instance, an error will be thrown.
+     * If this is absent for a ZONAL instance, instance is created in a random
+     * zone with available capacity.
+     * 
+ * + * string gce_zone = 12; + * + * @param value The bytes for gceZone to set. + * @return This builder for chaining. + */ + public Builder setGceZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + gceZone_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private com.google.protobuf.MapField databaseFlags_; + + private com.google.protobuf.MapField + internalGetDatabaseFlags() { + if (databaseFlags_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DatabaseFlagsDefaultEntryHolder.defaultEntry); + } + return databaseFlags_; + } + + private com.google.protobuf.MapField + internalGetMutableDatabaseFlags() { + if (databaseFlags_ == null) { + databaseFlags_ = + com.google.protobuf.MapField.newMapField(DatabaseFlagsDefaultEntryHolder.defaultEntry); + } + if (!databaseFlags_.isMutable()) { + databaseFlags_ = databaseFlags_.copy(); + } + bitField0_ |= 0x00001000; + onChanged(); + return databaseFlags_; + } + + public int getDatabaseFlagsCount() { + return internalGetDatabaseFlags().getMap().size(); + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public boolean containsDatabaseFlags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetDatabaseFlags().getMap().containsKey(key); + } + /** Use {@link #getDatabaseFlagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDatabaseFlags() { + return getDatabaseFlagsMap(); + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public java.util.Map getDatabaseFlagsMap() { + return internalGetDatabaseFlags().getMap(); + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public /* nullable */ java.lang.String getDatabaseFlagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDatabaseFlags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + @java.lang.Override + public java.lang.String getDatabaseFlagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDatabaseFlags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearDatabaseFlags() { + bitField0_ = (bitField0_ & ~0x00001000); + internalGetMutableDatabaseFlags().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + public Builder removeDatabaseFlags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableDatabaseFlags().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableDatabaseFlags() { + bitField0_ |= 0x00001000; + return internalGetMutableDatabaseFlags().getMutableMap(); + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + public Builder putDatabaseFlags(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableDatabaseFlags().getMutableMap().put(key, value); + bitField0_ |= 0x00001000; + return this; + } + /** + * + * + *
+     * Database flags. Set at instance level.
+     *  * They are copied from primary instance on read instance creation.
+     *  * Read instances can set new or override existing flags that are relevant
+     *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+     *    set on read instance may or may not be present on primary.
+     * This is a list of "key": "value" pairs.
+     * "key": The name of the flag. These flags are passed at instance setup time,
+     * so include both server options and system variables for Postgres. Flags are
+     * specified with underscores, not hyphens.
+     * "value": The value of the flag. Booleans are set to **on** for true
+     * and **off** for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * map<string, string> database_flags = 13; + */ + public Builder putAllDatabaseFlags(java.util.Map values) { + internalGetMutableDatabaseFlags().getMutableMap().putAll(values); + bitField0_ |= 0x00001000; + return this; + } + + private com.google.cloud.alloydb.v1beta.Instance.Node writableNode_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.Node, + com.google.cloud.alloydb.v1beta.Instance.Node.Builder, + com.google.cloud.alloydb.v1beta.Instance.NodeOrBuilder> + writableNodeBuilder_; + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writableNode field is set. + */ + public boolean hasWritableNode() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writableNode. + */ + public com.google.cloud.alloydb.v1beta.Instance.Node getWritableNode() { + if (writableNodeBuilder_ == null) { + return writableNode_ == null + ? com.google.cloud.alloydb.v1beta.Instance.Node.getDefaultInstance() + : writableNode_; + } else { + return writableNodeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setWritableNode(com.google.cloud.alloydb.v1beta.Instance.Node value) { + if (writableNodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + writableNode_ = value; + } else { + writableNodeBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setWritableNode( + com.google.cloud.alloydb.v1beta.Instance.Node.Builder builderForValue) { + if (writableNodeBuilder_ == null) { + writableNode_ = builderForValue.build(); + } else { + writableNodeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeWritableNode(com.google.cloud.alloydb.v1beta.Instance.Node value) { + if (writableNodeBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && writableNode_ != null + && writableNode_ + != com.google.cloud.alloydb.v1beta.Instance.Node.getDefaultInstance()) { + getWritableNodeBuilder().mergeFrom(value); + } else { + writableNode_ = value; + } + } else { + writableNodeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearWritableNode() { + bitField0_ = (bitField0_ & ~0x00002000); + writableNode_ = null; + if (writableNodeBuilder_ != null) { + writableNodeBuilder_.dispose(); + writableNodeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.Instance.Node.Builder getWritableNodeBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getWritableNodeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.Instance.NodeOrBuilder getWritableNodeOrBuilder() { + if (writableNodeBuilder_ != null) { + return writableNodeBuilder_.getMessageOrBuilder(); + } else { + return writableNode_ == null + ? com.google.cloud.alloydb.v1beta.Instance.Node.getDefaultInstance() + : writableNode_; + } + } + /** + * + * + *
+     * Output only. This is set for the read-write VM of the PRIMARY instance
+     * only.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.Node, + com.google.cloud.alloydb.v1beta.Instance.Node.Builder, + com.google.cloud.alloydb.v1beta.Instance.NodeOrBuilder> + getWritableNodeFieldBuilder() { + if (writableNodeBuilder_ == null) { + writableNodeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.Node, + com.google.cloud.alloydb.v1beta.Instance.Node.Builder, + com.google.cloud.alloydb.v1beta.Instance.NodeOrBuilder>( + getWritableNode(), getParentForChildren(), isClean()); + writableNode_ = null; + } + return writableNodeBuilder_; + } + + private java.util.List nodes_ = + java.util.Collections.emptyList(); + + private void ensureNodesIsMutable() { + if (!((bitField0_ & 0x00004000) != 0)) { + nodes_ = new java.util.ArrayList(nodes_); + bitField0_ |= 0x00004000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.Node, + com.google.cloud.alloydb.v1beta.Instance.Node.Builder, + com.google.cloud.alloydb.v1beta.Instance.NodeOrBuilder> + nodesBuilder_; + + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getNodesList() { + if (nodesBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodes_); + } else { + return nodesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getNodesCount() { + if (nodesBuilder_ == null) { + return nodes_.size(); + } else { + return nodesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.Instance.Node getNodes(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodes(int index, com.google.cloud.alloydb.v1beta.Instance.Node value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.set(index, value); + onChanged(); + } else { + nodesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodes( + int index, com.google.cloud.alloydb.v1beta.Instance.Node.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.set(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes(com.google.cloud.alloydb.v1beta.Instance.Node value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(value); + onChanged(); + } else { + nodesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes(int index, com.google.cloud.alloydb.v1beta.Instance.Node value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(index, value); + onChanged(); + } else { + nodesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes(com.google.cloud.alloydb.v1beta.Instance.Node.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + int index, com.google.cloud.alloydb.v1beta.Instance.Node.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllNodes( + java.lang.Iterable values) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, nodes_); + onChanged(); + } else { + nodesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearNodes() { + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + } else { + nodesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeNodes(int index) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.remove(index); + onChanged(); + } else { + nodesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.Instance.Node.Builder getNodesBuilder(int index) { + return getNodesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.Instance.NodeOrBuilder getNodesOrBuilder(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getNodesOrBuilderList() { + if (nodesBuilder_ != null) { + return nodesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodes_); + } + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.Instance.Node.Builder addNodesBuilder() { + return getNodesFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1beta.Instance.Node.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.Instance.Node.Builder addNodesBuilder(int index) { + return getNodesFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1beta.Instance.Node.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of available read-only VMs in this instance, including
+     * the standby for a PRIMARY instance.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getNodesBuilderList() { + return getNodesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.Node, + com.google.cloud.alloydb.v1beta.Instance.Node.Builder, + com.google.cloud.alloydb.v1beta.Instance.NodeOrBuilder> + getNodesFieldBuilder() { + if (nodesBuilder_ == null) { + nodesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.Node, + com.google.cloud.alloydb.v1beta.Instance.Node.Builder, + com.google.cloud.alloydb.v1beta.Instance.NodeOrBuilder>( + nodes_, ((bitField0_ & 0x00004000) != 0), getParentForChildren(), isClean()); + nodes_ = null; + } + return nodesBuilder_; + } + + private com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + queryInsightsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig, + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.Builder, + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfigOrBuilder> + queryInsightsConfigBuilder_; + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return Whether the queryInsightsConfig field is set. + */ + public boolean hasQueryInsightsConfig() { + return ((bitField0_ & 0x00008000) != 0); + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return The queryInsightsConfig. + */ + public com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + getQueryInsightsConfig() { + if (queryInsightsConfigBuilder_ == null) { + return queryInsightsConfig_ == null + ? com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + .getDefaultInstance() + : queryInsightsConfig_; + } else { + return queryInsightsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public Builder setQueryInsightsConfig( + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig value) { + if (queryInsightsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryInsightsConfig_ = value; + } else { + queryInsightsConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public Builder setQueryInsightsConfig( + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.Builder + builderForValue) { + if (queryInsightsConfigBuilder_ == null) { + queryInsightsConfig_ = builderForValue.build(); + } else { + queryInsightsConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public Builder mergeQueryInsightsConfig( + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig value) { + if (queryInsightsConfigBuilder_ == null) { + if (((bitField0_ & 0x00008000) != 0) + && queryInsightsConfig_ != null + && queryInsightsConfig_ + != com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + .getDefaultInstance()) { + getQueryInsightsConfigBuilder().mergeFrom(value); + } else { + queryInsightsConfig_ = value; + } + } else { + queryInsightsConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public Builder clearQueryInsightsConfig() { + bitField0_ = (bitField0_ & ~0x00008000); + queryInsightsConfig_ = null; + if (queryInsightsConfigBuilder_ != null) { + queryInsightsConfigBuilder_.dispose(); + queryInsightsConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.Builder + getQueryInsightsConfigBuilder() { + bitField0_ |= 0x00008000; + onChanged(); + return getQueryInsightsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + public com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfigOrBuilder + getQueryInsightsConfigOrBuilder() { + if (queryInsightsConfigBuilder_ != null) { + return queryInsightsConfigBuilder_.getMessageOrBuilder(); + } else { + return queryInsightsConfig_ == null + ? com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + .getDefaultInstance() + : queryInsightsConfig_; + } + } + /** + * + * + *
+     * Configuration for query insights.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig, + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.Builder, + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfigOrBuilder> + getQueryInsightsConfigFieldBuilder() { + if (queryInsightsConfigBuilder_ == null) { + queryInsightsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig, + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.Builder, + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfigOrBuilder>( + getQueryInsightsConfig(), getParentForChildren(), isClean()); + queryInsightsConfig_ = null; + } + return queryInsightsConfigBuilder_; + } + + private com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig readPoolConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig, + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.Builder, + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfigOrBuilder> + readPoolConfigBuilder_; + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return Whether the readPoolConfig field is set. + */ + public boolean hasReadPoolConfig() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return The readPoolConfig. + */ + public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig getReadPoolConfig() { + if (readPoolConfigBuilder_ == null) { + return readPoolConfig_ == null + ? com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.getDefaultInstance() + : readPoolConfig_; + } else { + return readPoolConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + */ + public Builder setReadPoolConfig( + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig value) { + if (readPoolConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readPoolConfig_ = value; + } else { + readPoolConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + */ + public Builder setReadPoolConfig( + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.Builder builderForValue) { + if (readPoolConfigBuilder_ == null) { + readPoolConfig_ = builderForValue.build(); + } else { + readPoolConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + */ + public Builder mergeReadPoolConfig( + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig value) { + if (readPoolConfigBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && readPoolConfig_ != null + && readPoolConfig_ + != com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.getDefaultInstance()) { + getReadPoolConfigBuilder().mergeFrom(value); + } else { + readPoolConfig_ = value; + } + } else { + readPoolConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + */ + public Builder clearReadPoolConfig() { + bitField0_ = (bitField0_ & ~0x00010000); + readPoolConfig_ = null; + if (readPoolConfigBuilder_ != null) { + readPoolConfigBuilder_.dispose(); + readPoolConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + */ + public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.Builder + getReadPoolConfigBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return getReadPoolConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + */ + public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfigOrBuilder + getReadPoolConfigOrBuilder() { + if (readPoolConfigBuilder_ != null) { + return readPoolConfigBuilder_.getMessageOrBuilder(); + } else { + return readPoolConfig_ == null + ? com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.getDefaultInstance() + : readPoolConfig_; + } + } + /** + * + * + *
+     * Read pool specific config.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig, + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.Builder, + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfigOrBuilder> + getReadPoolConfigFieldBuilder() { + if (readPoolConfigBuilder_ == null) { + readPoolConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig, + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.Builder, + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfigOrBuilder>( + getReadPoolConfig(), getParentForChildren(), isClean()); + readPoolConfig_ = null; + } + return readPoolConfigBuilder_; + } + + private java.lang.Object ipAddress_ = ""; + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ipAddress_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + ipAddress_ = getDefaultInstance().getIpAddress(); + bitField0_ = (bitField0_ & ~0x00020000); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP address for the Instance.
+     * This is the connection endpoint for an end-user application.
+     * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ipAddress_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Instance does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Instance does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+     * Set to true if the current state of Instance does not match the user's
+     * intended state, and the service is actively updating the resource to
+     * reconcile them. This can happen due to user-triggered updates or
+     * system actions like failover or maintenance.
+     * 
+ * + * bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00040000); + reconciling_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 17; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 17; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 17; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 17; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00080000); + onChanged(); + return this; + } + /** + * + * + *
+     * For Resource freshness validation (https://google.aip.dev/154)
+     * 
+ * + * string etag = 17; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00100000; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00100000); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00100000; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00100000; + return this; + } + /** + * + * + *
+     * Annotations to allow client tools to store small amount of arbitrary data.
+     * This is distinct from labels.
+     * https://google.aip.dev/128
+     * 
+ * + * map<string, string> annotations = 18; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00100000; + 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.alloydb.v1beta.Instance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.Instance) + private static final com.google.cloud.alloydb.v1beta.Instance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.Instance(); + } + + public static com.google.cloud.alloydb.v1beta.Instance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Instance 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.alloydb.v1beta.Instance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceName.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceName.java new file mode 100644 index 000000000000..b179c4aee8c6 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceName.java @@ -0,0 +1,259 @@ +/* + * 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.alloydb.v1beta; + +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 InstanceName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CLUSTER_INSTANCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String cluster; + private final String instance; + + @Deprecated + protected InstanceName() { + project = null; + location = null; + cluster = null; + instance = null; + } + + private InstanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + cluster = Preconditions.checkNotNull(builder.getCluster()); + instance = Preconditions.checkNotNull(builder.getInstance()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public String getInstance() { + return instance; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static InstanceName of(String project, String location, String cluster, String instance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCluster(cluster) + .setInstance(instance) + .build(); + } + + public static String format(String project, String location, String cluster, String instance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCluster(cluster) + .setInstance(instance) + .build() + .toString(); + } + + public static InstanceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CLUSTER_INSTANCE.validatedMatch( + formattedString, "InstanceName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("cluster"), + matchMap.get("instance")); + } + + 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 (InstanceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CLUSTER_INSTANCE.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 (cluster != null) { + fieldMapBuilder.put("cluster", cluster); + } + if (instance != null) { + fieldMapBuilder.put("instance", instance); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CLUSTER_INSTANCE.instantiate( + "project", project, "location", location, "cluster", cluster, "instance", instance); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + InstanceName that = ((InstanceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.cluster, that.cluster) + && Objects.equals(this.instance, that.instance); + } + 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(cluster); + h *= 1000003; + h ^= Objects.hashCode(instance); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}. + */ + public static class Builder { + private String project; + private String location; + private String cluster; + private String instance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public String getInstance() { + return instance; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCluster(String cluster) { + this.cluster = cluster; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + private Builder(InstanceName instanceName) { + this.project = instanceName.project; + this.location = instanceName.location; + this.cluster = instanceName.cluster; + this.instance = instanceName.instance; + } + + public InstanceName build() { + return new InstanceName(this); + } + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceOrBuilder.java new file mode 100644 index 000000000000..7b0851dbccf1 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceOrBuilder.java @@ -0,0 +1,888 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface InstanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.Instance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The name of the instance resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+   * where the cluster and instance ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the instance resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The name of the instance resource with the format:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
+   * where the cluster and instance ID segments should satisfy the regex
+   * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
+   * lowercase letters, numbers, and dashes, starting with a letter, and ending
+   * with a letter or number. For more details see https://google.aip.dev/122.
+   * The prefix of the instance resource name is the name of the parent
+   * resource:
+   *  * projects/{project}/locations/{region}/clusters/{cluster_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * User-settable and human-readable display name for the Instance.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * User-settable and human-readable display name for the Instance.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. The system-generated UID of the resource. The UID is assigned
+   * when the resource is created, and it is retained until it is deleted.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. Delete time stamp
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 7; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The current serving state of the instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current serving state of the instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.alloydb.v1beta.Instance.State getState(); + + /** + * + * + *
+   * Required. The type of the instance. Specified at creation time.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for instanceType. + */ + int getInstanceTypeValue(); + /** + * + * + *
+   * Required. The type of the instance. Specified at creation time.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instanceType. + */ + com.google.cloud.alloydb.v1beta.Instance.InstanceType getInstanceType(); + + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + * + * @return Whether the machineConfig field is set. + */ + boolean hasMachineConfig(); + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + * + * @return The machineConfig. + */ + com.google.cloud.alloydb.v1beta.Instance.MachineConfig getMachineConfig(); + /** + * + * + *
+   * Configurations for the machines that host the underlying
+   * database engine.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + */ + com.google.cloud.alloydb.v1beta.Instance.MachineConfigOrBuilder getMachineConfigOrBuilder(); + + /** + * + * + *
+   * Availability type of an Instance.
+   * Defaults to REGIONAL for both primary and read instances.
+   * Note that primary and read instances can have different availability types.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; + * + * @return The enum numeric value on the wire for availabilityType. + */ + int getAvailabilityTypeValue(); + /** + * + * + *
+   * Availability type of an Instance.
+   * Defaults to REGIONAL for both primary and read instances.
+   * Note that primary and read instances can have different availability types.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; + * + * @return The availabilityType. + */ + com.google.cloud.alloydb.v1beta.Instance.AvailabilityType getAvailabilityType(); + + /** + * + * + *
+   * The Compute Engine zone that the instance should serve from, per
+   * https://cloud.google.com/compute/docs/regions-zones
+   * This can ONLY be specified for ZONAL instances.
+   * If present for a REGIONAL instance, an error will be thrown.
+   * If this is absent for a ZONAL instance, instance is created in a random
+   * zone with available capacity.
+   * 
+ * + * string gce_zone = 12; + * + * @return The gceZone. + */ + java.lang.String getGceZone(); + /** + * + * + *
+   * The Compute Engine zone that the instance should serve from, per
+   * https://cloud.google.com/compute/docs/regions-zones
+   * This can ONLY be specified for ZONAL instances.
+   * If present for a REGIONAL instance, an error will be thrown.
+   * If this is absent for a ZONAL instance, instance is created in a random
+   * zone with available capacity.
+   * 
+ * + * string gce_zone = 12; + * + * @return The bytes for gceZone. + */ + com.google.protobuf.ByteString getGceZoneBytes(); + + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + int getDatabaseFlagsCount(); + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + boolean containsDatabaseFlags(java.lang.String key); + /** Use {@link #getDatabaseFlagsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getDatabaseFlags(); + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + java.util.Map getDatabaseFlagsMap(); + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + /* nullable */ + java.lang.String getDatabaseFlagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Database flags. Set at instance level.
+   *  * They are copied from primary instance on read instance creation.
+   *  * Read instances can set new or override existing flags that are relevant
+   *    for reads, e.g. for enabling columnar cache on a read instance. Flags
+   *    set on read instance may or may not be present on primary.
+   * This is a list of "key": "value" pairs.
+   * "key": The name of the flag. These flags are passed at instance setup time,
+   * so include both server options and system variables for Postgres. Flags are
+   * specified with underscores, not hyphens.
+   * "value": The value of the flag. Booleans are set to **on** for true
+   * and **off** for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * map<string, string> database_flags = 13; + */ + java.lang.String getDatabaseFlagsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writableNode field is set. + */ + boolean hasWritableNode(); + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writableNode. + */ + com.google.cloud.alloydb.v1beta.Instance.Node getWritableNode(); + /** + * + * + *
+   * Output only. This is set for the read-write VM of the PRIMARY instance
+   * only.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1beta.Instance.NodeOrBuilder getWritableNodeOrBuilder(); + + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getNodesList(); + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1beta.Instance.Node getNodes(int index); + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getNodesCount(); + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getNodesOrBuilderList(); + /** + * + * + *
+   * Output only. List of available read-only VMs in this instance, including
+   * the standby for a PRIMARY instance.
+   * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1beta.Instance.NodeOrBuilder getNodesOrBuilder(int index); + + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return Whether the queryInsightsConfig field is set. + */ + boolean hasQueryInsightsConfig(); + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + * + * @return The queryInsightsConfig. + */ + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig getQueryInsightsConfig(); + /** + * + * + *
+   * Configuration for query insights.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * + */ + com.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfigOrBuilder + getQueryInsightsConfigOrBuilder(); + + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return Whether the readPoolConfig field is set. + */ + boolean hasReadPoolConfig(); + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + * + * @return The readPoolConfig. + */ + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig getReadPoolConfig(); + /** + * + * + *
+   * Read pool specific config.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + */ + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfigOrBuilder getReadPoolConfigOrBuilder(); + + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * Output only. The IP address for the Instance.
+   * This is the connection endpoint for an end-user application.
+   * 
+ * + * string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * Output only. Reconciling (https://google.aip.dev/128#reconciliation).
+   * Set to true if the current state of Instance does not match the user's
+   * intended state, and the service is actively updating the resource to
+   * reconcile them. This can happen due to user-triggered updates or
+   * system actions like failover or maintenance.
+   * 
+ * + * bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 17; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * For Resource freshness validation (https://google.aip.dev/154)
+   * 
+ * + * string etag = 17; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Annotations to allow client tools to store small amount of arbitrary data.
+   * This is distinct from labels.
+   * https://google.aip.dev/128
+   * 
+ * + * map<string, string> annotations = 18; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceView.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceView.java new file mode 100644 index 000000000000..5af03785f045 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceView.java @@ -0,0 +1,183 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * View on Instance. Pass this enum to rpcs that returns an Instance message to
+ * control which subsets of fields to get.
+ * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.InstanceView} + */ +public enum InstanceView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
+   * 
+ * + * INSTANCE_VIEW_UNSPECIFIED = 0; + */ + INSTANCE_VIEW_UNSPECIFIED(0), + /** + * + * + *
+   * BASIC server responses for a primary or read instance include all the
+   * relevant instance details, excluding the details of each node in the
+   * instance. The default value.
+   * 
+ * + * INSTANCE_VIEW_BASIC = 1; + */ + INSTANCE_VIEW_BASIC(1), + /** + * + * + *
+   * FULL response is equivalent to BASIC for primary instance (for now).
+   * For read pool instance, this includes details of each node in the pool.
+   * 
+ * + * INSTANCE_VIEW_FULL = 2; + */ + INSTANCE_VIEW_FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
+   * 
+ * + * INSTANCE_VIEW_UNSPECIFIED = 0; + */ + public static final int INSTANCE_VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * BASIC server responses for a primary or read instance include all the
+   * relevant instance details, excluding the details of each node in the
+   * instance. The default value.
+   * 
+ * + * INSTANCE_VIEW_BASIC = 1; + */ + public static final int INSTANCE_VIEW_BASIC_VALUE = 1; + /** + * + * + *
+   * FULL response is equivalent to BASIC for primary instance (for now).
+   * For read pool instance, this includes details of each node in the pool.
+   * 
+ * + * INSTANCE_VIEW_FULL = 2; + */ + public static final int INSTANCE_VIEW_FULL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static InstanceView 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 InstanceView forNumber(int value) { + switch (value) { + case 0: + return INSTANCE_VIEW_UNSPECIFIED; + case 1: + return INSTANCE_VIEW_BASIC; + case 2: + return INSTANCE_VIEW_FULL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public InstanceView findValueByNumber(int number) { + return InstanceView.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.alloydb.v1beta.ResourcesProto.getDescriptor().getEnumTypes().get(1); + } + + private static final InstanceView[] VALUES = values(); + + public static InstanceView 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 InstanceView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.InstanceView) +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListBackupsRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListBackupsRequest.java new file mode 100644 index 000000000000..12c450422144 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListBackupsRequest.java @@ -0,0 +1,1286 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for requesting list of Backups
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListBackupsRequest} + */ +public final class ListBackupsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.ListBackupsRequest) + ListBackupsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupsRequest.newBuilder() to construct. + private ListBackupsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupsRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListBackupsRequest.class, + com.google.cloud.alloydb.v1beta.ListBackupsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value for ListBackupsRequest
+   * 
+ * + * + * 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 value for ListBackupsRequest
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @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; + } + } + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @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; + } + } + + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.alloydb.v1beta.ListBackupsRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.ListBackupsRequest other = + (com.google.cloud.alloydb.v1beta.ListBackupsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsRequest 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.alloydb.v1beta.ListBackupsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsRequest 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.alloydb.v1beta.ListBackupsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsRequest 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.alloydb.v1beta.ListBackupsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsRequest 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.alloydb.v1beta.ListBackupsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsRequest 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.alloydb.v1beta.ListBackupsRequest 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; + } + /** + * + * + *
+   * Message for requesting list of Backups
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListBackupsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.ListBackupsRequest) + com.google.cloud.alloydb.v1beta.ListBackupsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListBackupsRequest.class, + com.google.cloud.alloydb.v1beta.ListBackupsRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.ListBackupsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListBackupsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListBackupsRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.ListBackupsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListBackupsRequest build() { + com.google.cloud.alloydb.v1beta.ListBackupsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListBackupsRequest buildPartial() { + com.google.cloud.alloydb.v1beta.ListBackupsRequest result = + new com.google.cloud.alloydb.v1beta.ListBackupsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.ListBackupsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @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.alloydb.v1beta.ListBackupsRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.ListBackupsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.ListBackupsRequest other) { + if (other == com.google.cloud.alloydb.v1beta.ListBackupsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + 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 parent_ = ""; + /** + * + * + *
+     * Required. Parent value for ListBackupsRequest
+     * 
+ * + * + * 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 value for ListBackupsRequest
+     * 
+ * + * + * 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 value for ListBackupsRequest
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListBackupsRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListBackupsRequest
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @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; + } + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @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; + } + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @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; + bitField0_ |= 0x00000010; + 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.alloydb.v1beta.ListBackupsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.ListBackupsRequest) + private static final com.google.cloud.alloydb.v1beta.ListBackupsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.ListBackupsRequest(); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsRequest 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.alloydb.v1beta.ListBackupsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListBackupsRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListBackupsRequestOrBuilder.java new file mode 100644 index 000000000000..d3fc7b301bef --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListBackupsRequestOrBuilder.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/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface ListBackupsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.ListBackupsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value for ListBackupsRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value for ListBackupsRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListBackupsResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListBackupsResponse.java new file mode 100644 index 000000000000..e69c233769f3 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListBackupsResponse.java @@ -0,0 +1,1393 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for response to listing Backups
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListBackupsResponse} + */ +public final class ListBackupsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.ListBackupsResponse) + ListBackupsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupsResponse.newBuilder() to construct. + private ListBackupsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupsResponse() { + backups_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupsResponse(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListBackupsResponse.class, + com.google.cloud.alloydb.v1beta.ListBackupsResponse.Builder.class); + } + + public static final int BACKUPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List backups_; + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + @java.lang.Override + public java.util.List getBackupsList() { + return backups_; + } + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + @java.lang.Override + public java.util.List + getBackupsOrBuilderList() { + return backups_; + } + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + @java.lang.Override + public int getBackupsCount() { + return backups_.size(); + } + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Backup getBackups(int index) { + return backups_.get(index); + } + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BackupOrBuilder getBackupsOrBuilder(int index) { + return backups_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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 UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.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 < backups_.size(); i++) { + output.writeMessage(1, backups_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(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 < backups_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, backups_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().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.alloydb.v1beta.ListBackupsResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.ListBackupsResponse other = + (com.google.cloud.alloydb.v1beta.ListBackupsResponse) obj; + + if (!getBackupsList().equals(other.getBackupsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) 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 (getBackupsCount() > 0) { + hash = (37 * hash) + BACKUPS_FIELD_NUMBER; + hash = (53 * hash) + getBackupsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsResponse 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.alloydb.v1beta.ListBackupsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsResponse 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.alloydb.v1beta.ListBackupsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsResponse 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.alloydb.v1beta.ListBackupsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsResponse 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.alloydb.v1beta.ListBackupsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsResponse 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.alloydb.v1beta.ListBackupsResponse 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; + } + /** + * + * + *
+   * Message for response to listing Backups
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListBackupsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.ListBackupsResponse) + com.google.cloud.alloydb.v1beta.ListBackupsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListBackupsResponse.class, + com.google.cloud.alloydb.v1beta.ListBackupsResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.ListBackupsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + } else { + backups_ = null; + backupsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListBackupsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListBackupsResponse getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.ListBackupsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListBackupsResponse build() { + com.google.cloud.alloydb.v1beta.ListBackupsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListBackupsResponse buildPartial() { + com.google.cloud.alloydb.v1beta.ListBackupsResponse result = + new com.google.cloud.alloydb.v1beta.ListBackupsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1beta.ListBackupsResponse result) { + if (backupsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + backups_ = java.util.Collections.unmodifiableList(backups_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.backups_ = backups_; + } else { + result.backups_ = backupsBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.ListBackupsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.alloydb.v1beta.ListBackupsResponse) { + return mergeFrom((com.google.cloud.alloydb.v1beta.ListBackupsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.ListBackupsResponse other) { + if (other == com.google.cloud.alloydb.v1beta.ListBackupsResponse.getDefaultInstance()) + return this; + if (backupsBuilder_ == null) { + if (!other.backups_.isEmpty()) { + if (backups_.isEmpty()) { + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBackupsIsMutable(); + backups_.addAll(other.backups_); + } + onChanged(); + } + } else { + if (!other.backups_.isEmpty()) { + if (backupsBuilder_.isEmpty()) { + backupsBuilder_.dispose(); + backupsBuilder_ = null; + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + backupsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBackupsFieldBuilder() + : null; + } else { + backupsBuilder_.addAllMessages(other.backups_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.alloydb.v1beta.Backup m = + input.readMessage( + com.google.cloud.alloydb.v1beta.Backup.parser(), extensionRegistry); + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(m); + } else { + backupsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + 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 backups_ = + java.util.Collections.emptyList(); + + private void ensureBackupsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + backups_ = new java.util.ArrayList(backups_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Backup, + com.google.cloud.alloydb.v1beta.Backup.Builder, + com.google.cloud.alloydb.v1beta.BackupOrBuilder> + backupsBuilder_; + + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public java.util.List getBackupsList() { + if (backupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(backups_); + } else { + return backupsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public int getBackupsCount() { + if (backupsBuilder_ == null) { + return backups_.size(); + } else { + return backupsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public com.google.cloud.alloydb.v1beta.Backup getBackups(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public Builder setBackups(int index, com.google.cloud.alloydb.v1beta.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.set(index, value); + onChanged(); + } else { + backupsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public Builder setBackups( + int index, com.google.cloud.alloydb.v1beta.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.set(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public Builder addBackups(com.google.cloud.alloydb.v1beta.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(value); + onChanged(); + } else { + backupsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public Builder addBackups(int index, com.google.cloud.alloydb.v1beta.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(index, value); + onChanged(); + } else { + backupsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public Builder addBackups(com.google.cloud.alloydb.v1beta.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public Builder addBackups( + int index, com.google.cloud.alloydb.v1beta.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public Builder addAllBackups( + java.lang.Iterable values) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, backups_); + onChanged(); + } else { + backupsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public Builder clearBackups() { + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + backupsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public Builder removeBackups(int index) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.remove(index); + onChanged(); + } else { + backupsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public com.google.cloud.alloydb.v1beta.Backup.Builder getBackupsBuilder(int index) { + return getBackupsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public com.google.cloud.alloydb.v1beta.BackupOrBuilder getBackupsOrBuilder(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public java.util.List + getBackupsOrBuilderList() { + if (backupsBuilder_ != null) { + return backupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(backups_); + } + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public com.google.cloud.alloydb.v1beta.Backup.Builder addBackupsBuilder() { + return getBackupsFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1beta.Backup.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public com.google.cloud.alloydb.v1beta.Backup.Builder addBackupsBuilder(int index) { + return getBackupsFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1beta.Backup.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Backup
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + public java.util.List getBackupsBuilderList() { + return getBackupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Backup, + com.google.cloud.alloydb.v1beta.Backup.Builder, + com.google.cloud.alloydb.v1beta.BackupOrBuilder> + getBackupsFieldBuilder() { + if (backupsBuilder_ == null) { + backupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Backup, + com.google.cloud.alloydb.v1beta.Backup.Builder, + com.google.cloud.alloydb.v1beta.BackupOrBuilder>( + backups_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + backups_ = null; + } + return backupsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.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.alloydb.v1beta.ListBackupsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.ListBackupsResponse) + private static final com.google.cloud.alloydb.v1beta.ListBackupsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.ListBackupsResponse(); + } + + public static com.google.cloud.alloydb.v1beta.ListBackupsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsResponse 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.alloydb.v1beta.ListBackupsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListBackupsResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListBackupsResponseOrBuilder.java new file mode 100644 index 000000000000..8058b4422716 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListBackupsResponseOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface ListBackupsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.ListBackupsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + java.util.List getBackupsList(); + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + com.google.cloud.alloydb.v1beta.Backup getBackups(int index); + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + int getBackupsCount(); + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + java.util.List + getBackupsOrBuilderList(); + /** + * + * + *
+   * The list of Backup
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + com.google.cloud.alloydb.v1beta.BackupOrBuilder getBackupsOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListClustersRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListClustersRequest.java new file mode 100644 index 000000000000..5bd3397e7ca9 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListClustersRequest.java @@ -0,0 +1,1307 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for requesting list of Clusters
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListClustersRequest} + */ +public final class ListClustersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.ListClustersRequest) + ListClustersRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListClustersRequest.newBuilder() to construct. + private ListClustersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListClustersRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListClustersRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListClustersRequest.class, + com.google.cloud.alloydb.v1beta.ListClustersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with the following format:
+   *  * projects/{project}/locations/-
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Cluster.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with the following format:
+   *  * projects/{project}/locations/-
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.alloydb.v1beta.ListClustersRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.ListClustersRequest other = + (com.google.cloud.alloydb.v1beta.ListClustersRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.ListClustersRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersRequest 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.alloydb.v1beta.ListClustersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersRequest 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.alloydb.v1beta.ListClustersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersRequest 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.alloydb.v1beta.ListClustersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersRequest 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.alloydb.v1beta.ListClustersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersRequest 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.alloydb.v1beta.ListClustersRequest 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; + } + /** + * + * + *
+   * Message for requesting list of Clusters
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListClustersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.ListClustersRequest) + com.google.cloud.alloydb.v1beta.ListClustersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListClustersRequest.class, + com.google.cloud.alloydb.v1beta.ListClustersRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.ListClustersRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListClustersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListClustersRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.ListClustersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListClustersRequest build() { + com.google.cloud.alloydb.v1beta.ListClustersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListClustersRequest buildPartial() { + com.google.cloud.alloydb.v1beta.ListClustersRequest result = + new com.google.cloud.alloydb.v1beta.ListClustersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.ListClustersRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @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.alloydb.v1beta.ListClustersRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.ListClustersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.ListClustersRequest other) { + if (other == com.google.cloud.alloydb.v1beta.ListClustersRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + 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 parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with the following format:
+     *  * projects/{project}/locations/-
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with the following format:
+     *  * projects/{project}/locations/-
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with the following format:
+     *  * projects/{project}/locations/-
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with the following format:
+     *  * projects/{project}/locations/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with the following format:
+     *  * projects/{project}/locations/-
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000010; + 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.alloydb.v1beta.ListClustersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.ListClustersRequest) + private static final com.google.cloud.alloydb.v1beta.ListClustersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.ListClustersRequest(); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListClustersRequest 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.alloydb.v1beta.ListClustersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListClustersRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListClustersRequestOrBuilder.java new file mode 100644 index 000000000000..55efd0573a0b --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListClustersRequestOrBuilder.java @@ -0,0 +1,149 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface ListClustersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.ListClustersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with the following format:
+   *  * projects/{project}/locations/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with the following format:
+   *  * projects/{project}/locations/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListClustersResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListClustersResponse.java new file mode 100644 index 000000000000..faf00ffc7779 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListClustersResponse.java @@ -0,0 +1,1394 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for response to listing Clusters
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListClustersResponse} + */ +public final class ListClustersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.ListClustersResponse) + ListClustersResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListClustersResponse.newBuilder() to construct. + private ListClustersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListClustersResponse() { + clusters_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListClustersResponse(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListClustersResponse.class, + com.google.cloud.alloydb.v1beta.ListClustersResponse.Builder.class); + } + + public static final int CLUSTERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List clusters_; + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + @java.lang.Override + public java.util.List getClustersList() { + return clusters_; + } + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + @java.lang.Override + public java.util.List + getClustersOrBuilderList() { + return clusters_; + } + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + @java.lang.Override + public int getClustersCount() { + return clusters_.size(); + } + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster getClusters(int index) { + return clusters_.get(index); + } + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ClusterOrBuilder getClustersOrBuilder(int index) { + return clusters_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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 UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.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 < clusters_.size(); i++) { + output.writeMessage(1, clusters_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(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 < clusters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, clusters_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().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.alloydb.v1beta.ListClustersResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.ListClustersResponse other = + (com.google.cloud.alloydb.v1beta.ListClustersResponse) obj; + + if (!getClustersList().equals(other.getClustersList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) 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 (getClustersCount() > 0) { + hash = (37 * hash) + CLUSTERS_FIELD_NUMBER; + hash = (53 * hash) + getClustersList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.ListClustersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersResponse 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.alloydb.v1beta.ListClustersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersResponse 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.alloydb.v1beta.ListClustersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersResponse 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.alloydb.v1beta.ListClustersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersResponse 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.alloydb.v1beta.ListClustersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersResponse 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.alloydb.v1beta.ListClustersResponse 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; + } + /** + * + * + *
+   * Message for response to listing Clusters
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListClustersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.ListClustersResponse) + com.google.cloud.alloydb.v1beta.ListClustersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListClustersResponse.class, + com.google.cloud.alloydb.v1beta.ListClustersResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.ListClustersResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (clustersBuilder_ == null) { + clusters_ = java.util.Collections.emptyList(); + } else { + clusters_ = null; + clustersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListClustersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListClustersResponse getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.ListClustersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListClustersResponse build() { + com.google.cloud.alloydb.v1beta.ListClustersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListClustersResponse buildPartial() { + com.google.cloud.alloydb.v1beta.ListClustersResponse result = + new com.google.cloud.alloydb.v1beta.ListClustersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1beta.ListClustersResponse result) { + if (clustersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + clusters_ = java.util.Collections.unmodifiableList(clusters_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.clusters_ = clusters_; + } else { + result.clusters_ = clustersBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.ListClustersResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.alloydb.v1beta.ListClustersResponse) { + return mergeFrom((com.google.cloud.alloydb.v1beta.ListClustersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.ListClustersResponse other) { + if (other == com.google.cloud.alloydb.v1beta.ListClustersResponse.getDefaultInstance()) + return this; + if (clustersBuilder_ == null) { + if (!other.clusters_.isEmpty()) { + if (clusters_.isEmpty()) { + clusters_ = other.clusters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureClustersIsMutable(); + clusters_.addAll(other.clusters_); + } + onChanged(); + } + } else { + if (!other.clusters_.isEmpty()) { + if (clustersBuilder_.isEmpty()) { + clustersBuilder_.dispose(); + clustersBuilder_ = null; + clusters_ = other.clusters_; + bitField0_ = (bitField0_ & ~0x00000001); + clustersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getClustersFieldBuilder() + : null; + } else { + clustersBuilder_.addAllMessages(other.clusters_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.alloydb.v1beta.Cluster m = + input.readMessage( + com.google.cloud.alloydb.v1beta.Cluster.parser(), extensionRegistry); + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(m); + } else { + clustersBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + 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 clusters_ = + java.util.Collections.emptyList(); + + private void ensureClustersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + clusters_ = new java.util.ArrayList(clusters_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster, + com.google.cloud.alloydb.v1beta.Cluster.Builder, + com.google.cloud.alloydb.v1beta.ClusterOrBuilder> + clustersBuilder_; + + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public java.util.List getClustersList() { + if (clustersBuilder_ == null) { + return java.util.Collections.unmodifiableList(clusters_); + } else { + return clustersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public int getClustersCount() { + if (clustersBuilder_ == null) { + return clusters_.size(); + } else { + return clustersBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public com.google.cloud.alloydb.v1beta.Cluster getClusters(int index) { + if (clustersBuilder_ == null) { + return clusters_.get(index); + } else { + return clustersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public Builder setClusters(int index, com.google.cloud.alloydb.v1beta.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.set(index, value); + onChanged(); + } else { + clustersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public Builder setClusters( + int index, com.google.cloud.alloydb.v1beta.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.set(index, builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public Builder addClusters(com.google.cloud.alloydb.v1beta.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.add(value); + onChanged(); + } else { + clustersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public Builder addClusters(int index, com.google.cloud.alloydb.v1beta.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.add(index, value); + onChanged(); + } else { + clustersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public Builder addClusters(com.google.cloud.alloydb.v1beta.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public Builder addClusters( + int index, com.google.cloud.alloydb.v1beta.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(index, builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public Builder addAllClusters( + java.lang.Iterable values) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clusters_); + onChanged(); + } else { + clustersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public Builder clearClusters() { + if (clustersBuilder_ == null) { + clusters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + clustersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public Builder removeClusters(int index) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.remove(index); + onChanged(); + } else { + clustersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public com.google.cloud.alloydb.v1beta.Cluster.Builder getClustersBuilder(int index) { + return getClustersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public com.google.cloud.alloydb.v1beta.ClusterOrBuilder getClustersOrBuilder(int index) { + if (clustersBuilder_ == null) { + return clusters_.get(index); + } else { + return clustersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public java.util.List + getClustersOrBuilderList() { + if (clustersBuilder_ != null) { + return clustersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(clusters_); + } + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public com.google.cloud.alloydb.v1beta.Cluster.Builder addClustersBuilder() { + return getClustersFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public com.google.cloud.alloydb.v1beta.Cluster.Builder addClustersBuilder(int index) { + return getClustersFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Cluster
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + public java.util.List + getClustersBuilderList() { + return getClustersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster, + com.google.cloud.alloydb.v1beta.Cluster.Builder, + com.google.cloud.alloydb.v1beta.ClusterOrBuilder> + getClustersFieldBuilder() { + if (clustersBuilder_ == null) { + clustersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster, + com.google.cloud.alloydb.v1beta.Cluster.Builder, + com.google.cloud.alloydb.v1beta.ClusterOrBuilder>( + clusters_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + clusters_ = null; + } + return clustersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.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.alloydb.v1beta.ListClustersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.ListClustersResponse) + private static final com.google.cloud.alloydb.v1beta.ListClustersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.ListClustersResponse(); + } + + public static com.google.cloud.alloydb.v1beta.ListClustersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListClustersResponse 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.alloydb.v1beta.ListClustersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListClustersResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListClustersResponseOrBuilder.java new file mode 100644 index 000000000000..9f76c943735f --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListClustersResponseOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface ListClustersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.ListClustersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + java.util.List getClustersList(); + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + com.google.cloud.alloydb.v1beta.Cluster getClusters(int index); + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + int getClustersCount(); + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + java.util.List + getClustersOrBuilderList(); + /** + * + * + *
+   * The list of Cluster
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + com.google.cloud.alloydb.v1beta.ClusterOrBuilder getClustersOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListInstancesRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListInstancesRequest.java new file mode 100644 index 000000000000..bcb597bb030a --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListInstancesRequest.java @@ -0,0 +1,1321 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for requesting list of Instances
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListInstancesRequest} + */ +public final class ListInstancesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.ListInstancesRequest) + ListInstancesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInstancesRequest.newBuilder() to construct. + private ListInstancesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInstancesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListInstancesRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListInstancesRequest.class, + com.google.cloud.alloydb.v1beta.ListInstancesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with one of the following
+   * formats:
+   *  * projects/{project}/locations/-/clusters/-
+   *  * projects/{project}/locations/{region}/clusters/-
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Instance.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with one of the following
+   * formats:
+   *  * projects/{project}/locations/-/clusters/-
+   *  * projects/{project}/locations/{region}/clusters/-
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.alloydb.v1beta.ListInstancesRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.ListInstancesRequest other = + (com.google.cloud.alloydb.v1beta.ListInstancesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesRequest 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.alloydb.v1beta.ListInstancesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesRequest 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.alloydb.v1beta.ListInstancesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesRequest 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.alloydb.v1beta.ListInstancesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesRequest 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.alloydb.v1beta.ListInstancesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesRequest 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.alloydb.v1beta.ListInstancesRequest 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; + } + /** + * + * + *
+   * Message for requesting list of Instances
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListInstancesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.ListInstancesRequest) + com.google.cloud.alloydb.v1beta.ListInstancesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListInstancesRequest.class, + com.google.cloud.alloydb.v1beta.ListInstancesRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.ListInstancesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListInstancesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListInstancesRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.ListInstancesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListInstancesRequest build() { + com.google.cloud.alloydb.v1beta.ListInstancesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListInstancesRequest buildPartial() { + com.google.cloud.alloydb.v1beta.ListInstancesRequest result = + new com.google.cloud.alloydb.v1beta.ListInstancesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.ListInstancesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @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.alloydb.v1beta.ListInstancesRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.ListInstancesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.ListInstancesRequest other) { + if (other == com.google.cloud.alloydb.v1beta.ListInstancesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + 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 parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with one of the following
+     * formats:
+     *  * projects/{project}/locations/-/clusters/-
+     *  * projects/{project}/locations/{region}/clusters/-
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with one of the following
+     * formats:
+     *  * projects/{project}/locations/-/clusters/-
+     *  * projects/{project}/locations/{region}/clusters/-
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Instance.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with one of the following
+     * formats:
+     *  * projects/{project}/locations/-/clusters/-
+     *  * projects/{project}/locations/{region}/clusters/-
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with one of the following
+     * formats:
+     *  * projects/{project}/locations/-/clusters/-
+     *  * projects/{project}/locations/{region}/clusters/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field. Additionally, you can perform an
+     * aggregated list operation by specifying a value with one of the following
+     * formats:
+     *  * projects/{project}/locations/-/clusters/-
+     *  * projects/{project}/locations/{region}/clusters/-
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000010; + 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.alloydb.v1beta.ListInstancesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.ListInstancesRequest) + private static final com.google.cloud.alloydb.v1beta.ListInstancesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.ListInstancesRequest(); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesRequest 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.alloydb.v1beta.ListInstancesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListInstancesRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListInstancesRequestOrBuilder.java new file mode 100644 index 000000000000..be4cd1c7c2dd --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListInstancesRequestOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface ListInstancesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.ListInstancesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with one of the following
+   * formats:
+   *  * projects/{project}/locations/-/clusters/-
+   *  * projects/{project}/locations/{region}/clusters/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field. Additionally, you can perform an
+   * aggregated list operation by specifying a value with one of the following
+   * formats:
+   *  * projects/{project}/locations/-/clusters/-
+   *  * projects/{project}/locations/{region}/clusters/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListInstancesResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListInstancesResponse.java new file mode 100644 index 000000000000..acc9cb42a651 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListInstancesResponse.java @@ -0,0 +1,1395 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for response to listing Instances
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListInstancesResponse} + */ +public final class ListInstancesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.ListInstancesResponse) + ListInstancesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInstancesResponse.newBuilder() to construct. + private ListInstancesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInstancesResponse() { + instances_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListInstancesResponse(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListInstancesResponse.class, + com.google.cloud.alloydb.v1beta.ListInstancesResponse.Builder.class); + } + + public static final int INSTANCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List instances_; + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + @java.lang.Override + public java.util.List getInstancesList() { + return instances_; + } + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + @java.lang.Override + public java.util.List + getInstancesOrBuilderList() { + return instances_; + } + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance getInstances(int index) { + return instances_.get(index); + } + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.InstanceOrBuilder getInstancesOrBuilder(int index) { + return instances_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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 UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.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 < instances_.size(); i++) { + output.writeMessage(1, instances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(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 < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, instances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().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.alloydb.v1beta.ListInstancesResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.ListInstancesResponse other = + (com.google.cloud.alloydb.v1beta.ListInstancesResponse) obj; + + if (!getInstancesList().equals(other.getInstancesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) 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 (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesResponse 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.alloydb.v1beta.ListInstancesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesResponse 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.alloydb.v1beta.ListInstancesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesResponse 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.alloydb.v1beta.ListInstancesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesResponse 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.alloydb.v1beta.ListInstancesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesResponse 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.alloydb.v1beta.ListInstancesResponse 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; + } + /** + * + * + *
+   * Message for response to listing Instances
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListInstancesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.ListInstancesResponse) + com.google.cloud.alloydb.v1beta.ListInstancesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListInstancesResponse.class, + com.google.cloud.alloydb.v1beta.ListInstancesResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.ListInstancesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + } else { + instances_ = null; + instancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListInstancesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListInstancesResponse getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.ListInstancesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListInstancesResponse build() { + com.google.cloud.alloydb.v1beta.ListInstancesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListInstancesResponse buildPartial() { + com.google.cloud.alloydb.v1beta.ListInstancesResponse result = + new com.google.cloud.alloydb.v1beta.ListInstancesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1beta.ListInstancesResponse result) { + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.ListInstancesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.alloydb.v1beta.ListInstancesResponse) { + return mergeFrom((com.google.cloud.alloydb.v1beta.ListInstancesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.ListInstancesResponse other) { + if (other == com.google.cloud.alloydb.v1beta.ListInstancesResponse.getDefaultInstance()) + return this; + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.alloydb.v1beta.Instance m = + input.readMessage( + com.google.cloud.alloydb.v1beta.Instance.parser(), extensionRegistry); + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(m); + } else { + instancesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + 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 instances_ = + java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instances_ = new java.util.ArrayList(instances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance, + com.google.cloud.alloydb.v1beta.Instance.Builder, + com.google.cloud.alloydb.v1beta.InstanceOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public java.util.List getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1beta.Instance getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder setInstances(int index, com.google.cloud.alloydb.v1beta.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder setInstances( + int index, com.google.cloud.alloydb.v1beta.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.alloydb.v1beta.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder addInstances(int index, com.google.cloud.alloydb.v1beta.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.alloydb.v1beta.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder addInstances( + int index, com.google.cloud.alloydb.v1beta.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder addAllInstances( + java.lang.Iterable values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1beta.Instance.Builder getInstancesBuilder(int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1beta.InstanceOrBuilder getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public java.util.List + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1beta.Instance.Builder addInstancesBuilder() { + return getInstancesFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public com.google.cloud.alloydb.v1beta.Instance.Builder addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Instance
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + public java.util.List + getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance, + com.google.cloud.alloydb.v1beta.Instance.Builder, + com.google.cloud.alloydb.v1beta.InstanceOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance, + com.google.cloud.alloydb.v1beta.Instance.Builder, + com.google.cloud.alloydb.v1beta.InstanceOrBuilder>( + instances_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.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.alloydb.v1beta.ListInstancesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.ListInstancesResponse) + private static final com.google.cloud.alloydb.v1beta.ListInstancesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.ListInstancesResponse(); + } + + public static com.google.cloud.alloydb.v1beta.ListInstancesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesResponse 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.alloydb.v1beta.ListInstancesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListInstancesResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListInstancesResponseOrBuilder.java new file mode 100644 index 000000000000..f47199513785 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListInstancesResponseOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface ListInstancesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.ListInstancesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + java.util.List getInstancesList(); + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + com.google.cloud.alloydb.v1beta.Instance getInstances(int index); + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + int getInstancesCount(); + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + java.util.List + getInstancesOrBuilderList(); + /** + * + * + *
+   * The list of Instance
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + com.google.cloud.alloydb.v1beta.InstanceOrBuilder getInstancesOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListSupportedDatabaseFlagsRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListSupportedDatabaseFlagsRequest.java new file mode 100644 index 000000000000..cdd1dbd285ca --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListSupportedDatabaseFlagsRequest.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/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for listing the information about the supported Database flags.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} + */ +public final class ListSupportedDatabaseFlagsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest) + ListSupportedDatabaseFlagsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSupportedDatabaseFlagsRequest.newBuilder() to construct. + private ListSupportedDatabaseFlagsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSupportedDatabaseFlagsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSupportedDatabaseFlagsRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.class, + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   *  * projects/{project}/locations/{location}
+   * Regardless of the parent specified here, as long it is contains a valid
+   * project and location, the service will return a static list of supported
+   * flags resources. Note that we do not yet support region-specific
+   * flags.
+   * 
+ * + * + * 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 parent resource. The required format is:
+   *  * projects/{project}/locations/{location}
+   * Regardless of the parent specified here, as long it is contains a valid
+   * project and location, the service will return a static list of supported
+   * flags resources. Note that we do not yet support region-specific
+   * flags.
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * 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.alloydb.v1beta.ListSupportedDatabaseFlagsRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest other = + (com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest) 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.alloydb.v1beta.ListSupportedDatabaseFlagsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest 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.alloydb.v1beta.ListSupportedDatabaseFlagsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest 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.alloydb.v1beta.ListSupportedDatabaseFlagsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest 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.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + 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.alloydb.v1beta.ListSupportedDatabaseFlagsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest 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.alloydb.v1beta.ListSupportedDatabaseFlagsRequest 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; + } + /** + * + * + *
+   * Message for listing the information about the supported Database flags.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest) + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.class, + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest build() { + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest buildPartial() { + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest result = + new com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.alloydb.v1beta.ListSupportedDatabaseFlagsRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest other) { + if (other + == com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + 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 parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     *  * projects/{project}/locations/{location}
+     * Regardless of the parent specified here, as long it is contains a valid
+     * project and location, the service will return a static list of supported
+     * flags resources. Note that we do not yet support region-specific
+     * flags.
+     * 
+ * + * + * 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 parent resource. The required format is:
+     *  * projects/{project}/locations/{location}
+     * Regardless of the parent specified here, as long it is contains a valid
+     * project and location, the service will return a static list of supported
+     * flags resources. Note that we do not yet support region-specific
+     * flags.
+     * 
+ * + * + * 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 parent resource. The required format is:
+     *  * projects/{project}/locations/{location}
+     * Regardless of the parent specified here, as long it is contains a valid
+     * project and location, the service will return a static list of supported
+     * flags resources. Note that we do not yet support region-specific
+     * flags.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     *  * projects/{project}/locations/{location}
+     * Regardless of the parent specified here, as long it is contains a valid
+     * project and location, the service will return a static list of supported
+     * flags resources. Note that we do not yet support region-specific
+     * flags.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. The required format is:
+     *  * projects/{project}/locations/{location}
+     * Regardless of the parent specified here, as long it is contains a valid
+     * project and location, the service will return a static list of supported
+     * flags resources. Note that we do not yet support region-specific
+     * flags.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + 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.alloydb.v1beta.ListSupportedDatabaseFlagsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest) + private static final com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest(); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSupportedDatabaseFlagsRequest 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.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListSupportedDatabaseFlagsRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListSupportedDatabaseFlagsRequestOrBuilder.java new file mode 100644 index 000000000000..e40429bb66cd --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListSupportedDatabaseFlagsRequestOrBuilder.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/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface ListSupportedDatabaseFlagsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   *  * projects/{project}/locations/{location}
+   * Regardless of the parent specified here, as long it is contains a valid
+   * project and location, the service will return a static list of supported
+   * flags resources. Note that we do not yet support region-specific
+   * flags.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. The required format is:
+   *  * projects/{project}/locations/{location}
+   * Regardless of the parent specified here, as long it is contains a valid
+   * project and location, the service will return a static list of supported
+   * flags resources. Note that we do not yet support region-specific
+   * flags.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListSupportedDatabaseFlagsResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListSupportedDatabaseFlagsResponse.java new file mode 100644 index 000000000000..30d3278b9bd1 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListSupportedDatabaseFlagsResponse.java @@ -0,0 +1,1201 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for response to listing SupportedDatabaseFlags.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} + */ +public final class ListSupportedDatabaseFlagsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) + ListSupportedDatabaseFlagsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSupportedDatabaseFlagsResponse.newBuilder() to construct. + private ListSupportedDatabaseFlagsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSupportedDatabaseFlagsResponse() { + supportedDatabaseFlags_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSupportedDatabaseFlagsResponse(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.class, + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.Builder.class); + } + + public static final int SUPPORTED_DATABASE_FLAGS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + supportedDatabaseFlags_; + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + @java.lang.Override + public java.util.List + getSupportedDatabaseFlagsList() { + return supportedDatabaseFlags_; + } + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + @java.lang.Override + public java.util.List + getSupportedDatabaseFlagsOrBuilderList() { + return supportedDatabaseFlags_; + } + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + @java.lang.Override + public int getSupportedDatabaseFlagsCount() { + return supportedDatabaseFlags_.size(); + } + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag getSupportedDatabaseFlags( + int index) { + return supportedDatabaseFlags_.get(index); + } + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlagOrBuilder + getSupportedDatabaseFlagsOrBuilder(int index) { + return supportedDatabaseFlags_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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 < supportedDatabaseFlags_.size(); i++) { + output.writeMessage(1, supportedDatabaseFlags_.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 < supportedDatabaseFlags_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, supportedDatabaseFlags_.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.alloydb.v1beta.ListSupportedDatabaseFlagsResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse other = + (com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) obj; + + if (!getSupportedDatabaseFlagsList().equals(other.getSupportedDatabaseFlagsList())) + 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 (getSupportedDatabaseFlagsCount() > 0) { + hash = (37 * hash) + SUPPORTED_DATABASE_FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getSupportedDatabaseFlagsList().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.alloydb.v1beta.ListSupportedDatabaseFlagsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse 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.alloydb.v1beta.ListSupportedDatabaseFlagsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse 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.alloydb.v1beta.ListSupportedDatabaseFlagsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse 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.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + 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.alloydb.v1beta.ListSupportedDatabaseFlagsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse 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.alloydb.v1beta.ListSupportedDatabaseFlagsResponse 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; + } + /** + * + * + *
+   * Message for response to listing SupportedDatabaseFlags.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.class, + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (supportedDatabaseFlagsBuilder_ == null) { + supportedDatabaseFlags_ = java.util.Collections.emptyList(); + } else { + supportedDatabaseFlags_ = null; + supportedDatabaseFlagsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse build() { + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse buildPartial() { + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse result = + new com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse result) { + if (supportedDatabaseFlagsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + supportedDatabaseFlags_ = java.util.Collections.unmodifiableList(supportedDatabaseFlags_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.supportedDatabaseFlags_ = supportedDatabaseFlags_; + } else { + result.supportedDatabaseFlags_ = supportedDatabaseFlagsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) { + return mergeFrom( + (com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse other) { + if (other + == com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + .getDefaultInstance()) return this; + if (supportedDatabaseFlagsBuilder_ == null) { + if (!other.supportedDatabaseFlags_.isEmpty()) { + if (supportedDatabaseFlags_.isEmpty()) { + supportedDatabaseFlags_ = other.supportedDatabaseFlags_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.addAll(other.supportedDatabaseFlags_); + } + onChanged(); + } + } else { + if (!other.supportedDatabaseFlags_.isEmpty()) { + if (supportedDatabaseFlagsBuilder_.isEmpty()) { + supportedDatabaseFlagsBuilder_.dispose(); + supportedDatabaseFlagsBuilder_ = null; + supportedDatabaseFlags_ = other.supportedDatabaseFlags_; + bitField0_ = (bitField0_ & ~0x00000001); + supportedDatabaseFlagsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSupportedDatabaseFlagsFieldBuilder() + : null; + } else { + supportedDatabaseFlagsBuilder_.addAllMessages(other.supportedDatabaseFlags_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + 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.alloydb.v1beta.SupportedDatabaseFlag m = + input.readMessage( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.parser(), + extensionRegistry); + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.add(m); + } else { + supportedDatabaseFlagsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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 + supportedDatabaseFlags_ = java.util.Collections.emptyList(); + + private void ensureSupportedDatabaseFlagsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + supportedDatabaseFlags_ = + new java.util.ArrayList( + supportedDatabaseFlags_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Builder, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlagOrBuilder> + supportedDatabaseFlagsBuilder_; + + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public java.util.List + getSupportedDatabaseFlagsList() { + if (supportedDatabaseFlagsBuilder_ == null) { + return java.util.Collections.unmodifiableList(supportedDatabaseFlags_); + } else { + return supportedDatabaseFlagsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public int getSupportedDatabaseFlagsCount() { + if (supportedDatabaseFlagsBuilder_ == null) { + return supportedDatabaseFlags_.size(); + } else { + return supportedDatabaseFlagsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag getSupportedDatabaseFlags( + int index) { + if (supportedDatabaseFlagsBuilder_ == null) { + return supportedDatabaseFlags_.get(index); + } else { + return supportedDatabaseFlagsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder setSupportedDatabaseFlags( + int index, com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag value) { + if (supportedDatabaseFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.set(index, value); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder setSupportedDatabaseFlags( + int index, com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Builder builderForValue) { + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.set(index, builderForValue.build()); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder addSupportedDatabaseFlags( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag value) { + if (supportedDatabaseFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.add(value); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder addSupportedDatabaseFlags( + int index, com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag value) { + if (supportedDatabaseFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.add(index, value); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder addSupportedDatabaseFlags( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Builder builderForValue) { + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.add(builderForValue.build()); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder addSupportedDatabaseFlags( + int index, com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Builder builderForValue) { + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.add(index, builderForValue.build()); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder addAllSupportedDatabaseFlags( + java.lang.Iterable + values) { + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, supportedDatabaseFlags_); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder clearSupportedDatabaseFlags() { + if (supportedDatabaseFlagsBuilder_ == null) { + supportedDatabaseFlags_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public Builder removeSupportedDatabaseFlags(int index) { + if (supportedDatabaseFlagsBuilder_ == null) { + ensureSupportedDatabaseFlagsIsMutable(); + supportedDatabaseFlags_.remove(index); + onChanged(); + } else { + supportedDatabaseFlagsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Builder + getSupportedDatabaseFlagsBuilder(int index) { + return getSupportedDatabaseFlagsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlagOrBuilder + getSupportedDatabaseFlagsOrBuilder(int index) { + if (supportedDatabaseFlagsBuilder_ == null) { + return supportedDatabaseFlags_.get(index); + } else { + return supportedDatabaseFlagsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public java.util.List + getSupportedDatabaseFlagsOrBuilderList() { + if (supportedDatabaseFlagsBuilder_ != null) { + return supportedDatabaseFlagsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(supportedDatabaseFlags_); + } + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Builder + addSupportedDatabaseFlagsBuilder() { + return getSupportedDatabaseFlagsFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.getDefaultInstance()); + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Builder + addSupportedDatabaseFlagsBuilder(int index) { + return getSupportedDatabaseFlagsFieldBuilder() + .addBuilder( + index, com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.getDefaultInstance()); + } + /** + * + * + *
+     * The list of SupportedDatabaseFlags.
+     * 
+ * + * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + public java.util.List + getSupportedDatabaseFlagsBuilderList() { + return getSupportedDatabaseFlagsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Builder, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlagOrBuilder> + getSupportedDatabaseFlagsFieldBuilder() { + if (supportedDatabaseFlagsBuilder_ == null) { + supportedDatabaseFlagsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Builder, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlagOrBuilder>( + supportedDatabaseFlags_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + supportedDatabaseFlags_ = null; + } + return supportedDatabaseFlagsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) + private static final com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse(); + } + + public static com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSupportedDatabaseFlagsResponse 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.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListSupportedDatabaseFlagsResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListSupportedDatabaseFlagsResponseOrBuilder.java new file mode 100644 index 000000000000..e4821dfe93a0 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListSupportedDatabaseFlagsResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface ListSupportedDatabaseFlagsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + java.util.List + getSupportedDatabaseFlagsList(); + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag getSupportedDatabaseFlags(int index); + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + int getSupportedDatabaseFlagsCount(); + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + java.util.List + getSupportedDatabaseFlagsOrBuilderList(); + /** + * + * + *
+   * The list of SupportedDatabaseFlags.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * + */ + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlagOrBuilder getSupportedDatabaseFlagsOrBuilder( + int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/LocationName.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/LocationName.java new file mode 100644 index 000000000000..12396c9e1153 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/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.alloydb.v1beta; + +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-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/MigrationSource.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/MigrationSource.java new file mode 100644 index 000000000000..ee502169df5c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/MigrationSource.java @@ -0,0 +1,1139 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Subset of the source instance configuration that is available when reading
+ * the cluster resource.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.MigrationSource} + */ +public final class MigrationSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.MigrationSource) + MigrationSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use MigrationSource.newBuilder() to construct. + private MigrationSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MigrationSource() { + hostPort_ = ""; + referenceId_ = ""; + sourceType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MigrationSource(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_MigrationSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_MigrationSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.MigrationSource.class, + com.google.cloud.alloydb.v1beta.MigrationSource.Builder.class); + } + + /** + * + * + *
+   * Denote the type of migration source that created this cluster.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType} + */ + public enum MigrationSourceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Migration source is unknown.
+     * 
+ * + * MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + */ + MIGRATION_SOURCE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * DMS source means the cluster was created via DMS migration job.
+     * 
+ * + * DMS = 1; + */ + DMS(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Migration source is unknown.
+     * 
+ * + * MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + */ + public static final int MIGRATION_SOURCE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * DMS source means the cluster was created via DMS migration job.
+     * 
+ * + * DMS = 1; + */ + public static final int DMS_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 MigrationSourceType 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 MigrationSourceType forNumber(int value) { + switch (value) { + case 0: + return MIGRATION_SOURCE_TYPE_UNSPECIFIED; + case 1: + return DMS; + 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 MigrationSourceType findValueByNumber(int number) { + return MigrationSourceType.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.alloydb.v1beta.MigrationSource.getDescriptor().getEnumTypes().get(0); + } + + private static final MigrationSourceType[] VALUES = values(); + + public static MigrationSourceType 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 MigrationSourceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType) + } + + public static final int HOST_PORT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object hostPort_ = ""; + /** + * + * + *
+   * Output only. The host and port of the on-premises instance in host:port
+   * format
+   * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The hostPort. + */ + @java.lang.Override + public java.lang.String getHostPort() { + java.lang.Object ref = hostPort_; + 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(); + hostPort_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The host and port of the on-premises instance in host:port
+   * format
+   * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for hostPort. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostPortBytes() { + java.lang.Object ref = hostPort_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostPort_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REFERENCE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object referenceId_ = ""; + /** + * + * + *
+   * Output only. Place holder for the external source identifier(e.g DMS job
+   * name) that created the cluster.
+   * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. Place holder for the external source identifier(e.g DMS job
+   * name) that created the cluster.
+   * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 SOURCE_TYPE_FIELD_NUMBER = 3; + private int sourceType_ = 0; + /** + * + * + *
+   * Output only. Type of migration source.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for sourceType. + */ + @java.lang.Override + public int getSourceTypeValue() { + return sourceType_; + } + /** + * + * + *
+   * Output only. Type of migration source.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType getSourceType() { + com.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType result = + com.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType.forNumber(sourceType_); + return result == null + ? com.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType.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(hostPort_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, hostPort_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, referenceId_); + } + if (sourceType_ + != com.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType + .MIGRATION_SOURCE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, sourceType_); + } + 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(hostPort_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, hostPort_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, referenceId_); + } + if (sourceType_ + != com.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType + .MIGRATION_SOURCE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, sourceType_); + } + 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.alloydb.v1beta.MigrationSource)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.MigrationSource other = + (com.google.cloud.alloydb.v1beta.MigrationSource) obj; + + if (!getHostPort().equals(other.getHostPort())) return false; + if (!getReferenceId().equals(other.getReferenceId())) return false; + if (sourceType_ != other.sourceType_) 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) + HOST_PORT_FIELD_NUMBER; + hash = (53 * hash) + getHostPort().hashCode(); + hash = (37 * hash) + REFERENCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getReferenceId().hashCode(); + hash = (37 * hash) + SOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + sourceType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.MigrationSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.MigrationSource 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.alloydb.v1beta.MigrationSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.MigrationSource 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.alloydb.v1beta.MigrationSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.MigrationSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.MigrationSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.MigrationSource 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.alloydb.v1beta.MigrationSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.MigrationSource 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.alloydb.v1beta.MigrationSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.MigrationSource 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.alloydb.v1beta.MigrationSource 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; + } + /** + * + * + *
+   * Subset of the source instance configuration that is available when reading
+   * the cluster resource.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.MigrationSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.MigrationSource) + com.google.cloud.alloydb.v1beta.MigrationSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_MigrationSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_MigrationSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.MigrationSource.class, + com.google.cloud.alloydb.v1beta.MigrationSource.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.MigrationSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + hostPort_ = ""; + referenceId_ = ""; + sourceType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_MigrationSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.MigrationSource getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.MigrationSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.MigrationSource build() { + com.google.cloud.alloydb.v1beta.MigrationSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.MigrationSource buildPartial() { + com.google.cloud.alloydb.v1beta.MigrationSource result = + new com.google.cloud.alloydb.v1beta.MigrationSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.MigrationSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.hostPort_ = hostPort_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.referenceId_ = referenceId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sourceType_ = sourceType_; + } + } + + @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.alloydb.v1beta.MigrationSource) { + return mergeFrom((com.google.cloud.alloydb.v1beta.MigrationSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.MigrationSource other) { + if (other == com.google.cloud.alloydb.v1beta.MigrationSource.getDefaultInstance()) + return this; + if (!other.getHostPort().isEmpty()) { + hostPort_ = other.hostPort_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getReferenceId().isEmpty()) { + referenceId_ = other.referenceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.sourceType_ != 0) { + setSourceTypeValue(other.getSourceTypeValue()); + } + 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: + { + hostPort_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + referenceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + sourceType_ = input.readEnum(); + bitField0_ |= 0x00000004; + 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 java.lang.Object hostPort_ = ""; + /** + * + * + *
+     * Output only. The host and port of the on-premises instance in host:port
+     * format
+     * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The hostPort. + */ + public java.lang.String getHostPort() { + java.lang.Object ref = hostPort_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostPort_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The host and port of the on-premises instance in host:port
+     * format
+     * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for hostPort. + */ + public com.google.protobuf.ByteString getHostPortBytes() { + java.lang.Object ref = hostPort_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostPort_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The host and port of the on-premises instance in host:port
+     * format
+     * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The hostPort to set. + * @return This builder for chaining. + */ + public Builder setHostPort(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + hostPort_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The host and port of the on-premises instance in host:port
+     * format
+     * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearHostPort() { + hostPort_ = getDefaultInstance().getHostPort(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The host and port of the on-premises instance in host:port
+     * format
+     * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for hostPort to set. + * @return This builder for chaining. + */ + public Builder setHostPortBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + hostPort_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object referenceId_ = ""; + /** + * + * + *
+     * Output only. Place holder for the external source identifier(e.g DMS job
+     * name) that created the cluster.
+     * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. Place holder for the external source identifier(e.g DMS job
+     * name) that created the cluster.
+     * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. Place holder for the external source identifier(e.g DMS job
+     * name) that created the cluster.
+     * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Place holder for the external source identifier(e.g DMS job
+     * name) that created the cluster.
+     * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReferenceId() { + referenceId_ = getDefaultInstance().getReferenceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Place holder for the external source identifier(e.g DMS job
+     * name) that created the cluster.
+     * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int sourceType_ = 0; + /** + * + * + *
+     * Output only. Type of migration source.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for sourceType. + */ + @java.lang.Override + public int getSourceTypeValue() { + return sourceType_; + } + /** + * + * + *
+     * Output only. Type of migration source.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for sourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceTypeValue(int value) { + sourceType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of migration source.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType getSourceType() { + com.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType result = + com.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType.forNumber( + sourceType_); + return result == null + ? com.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Type of migration source.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The sourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceType( + com.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + sourceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of migration source.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSourceType() { + bitField0_ = (bitField0_ & ~0x00000004); + sourceType_ = 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.alloydb.v1beta.MigrationSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.MigrationSource) + private static final com.google.cloud.alloydb.v1beta.MigrationSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.MigrationSource(); + } + + public static com.google.cloud.alloydb.v1beta.MigrationSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MigrationSource 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.alloydb.v1beta.MigrationSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/MigrationSourceOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/MigrationSourceOrBuilder.java new file mode 100644 index 000000000000..f694aacfdcde --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/MigrationSourceOrBuilder.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/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface MigrationSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.MigrationSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The host and port of the on-premises instance in host:port
+   * format
+   * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The hostPort. + */ + java.lang.String getHostPort(); + /** + * + * + *
+   * Output only. The host and port of the on-premises instance in host:port
+   * format
+   * 
+ * + * string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for hostPort. + */ + com.google.protobuf.ByteString getHostPortBytes(); + + /** + * + * + *
+   * Output only. Place holder for the external source identifier(e.g DMS job
+   * name) that created the cluster.
+   * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The referenceId. + */ + java.lang.String getReferenceId(); + /** + * + * + *
+   * Output only. Place holder for the external source identifier(e.g DMS job
+   * name) that created the cluster.
+   * 
+ * + * string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for referenceId. + */ + com.google.protobuf.ByteString getReferenceIdBytes(); + + /** + * + * + *
+   * Output only. Type of migration source.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for sourceType. + */ + int getSourceTypeValue(); + /** + * + * + *
+   * Output only. Type of migration source.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceType. + */ + com.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType getSourceType(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/OperationMetadata.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/OperationMetadata.java new file mode 100644 index 000000000000..947a5ef1dac3 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/OperationMetadata.java @@ -0,0 +1,2244 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.OperationMetadata.class, + com.google.cloud.alloydb.v1beta.OperationMetadata.Builder.class); + } + + private int requestSpecificCase_ = 0; + private java.lang.Object requestSpecific_; + + public enum RequestSpecificCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BATCH_CREATE_INSTANCES_METADATA(8), + REQUESTSPECIFIC_NOT_SET(0); + private final int value; + + private RequestSpecificCase(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 RequestSpecificCase valueOf(int value) { + return forNumber(value); + } + + public static RequestSpecificCase forNumber(int value) { + switch (value) { + case 8: + return BATCH_CREATE_INSTANCES_METADATA; + case 0: + return REQUESTSPECIFIC_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RequestSpecificCase getRequestSpecificCase() { + return RequestSpecificCase.forNumber(requestSpecificCase_); + } + + public static final int BATCH_CREATE_INSTANCES_METADATA_FIELD_NUMBER = 8; + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the batchCreateInstancesMetadata field is set. + */ + @java.lang.Override + public boolean hasBatchCreateInstancesMetadata() { + return requestSpecificCase_ == 8; + } + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The batchCreateInstancesMetadata. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + getBatchCreateInstancesMetadata() { + if (requestSpecificCase_ == 8) { + return (com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) requestSpecific_; + } + return com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadataOrBuilder + getBatchCreateInstancesMetadataOrBuilder() { + if (requestSpecificCase_ == 8) { + return (com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) requestSpecific_; + } + return com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.getDefaultInstance(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int TARGET_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object verb_ = ""; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object statusMessage_ = ""; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + 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(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_ = false; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiVersion_ = ""; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + if (requestSpecificCase_ == 8) { + output.writeMessage( + 8, (com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) requestSpecific_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + if (requestSpecificCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) requestSpecific_); + } + 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.alloydb.v1beta.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.OperationMetadata other = + (com.google.cloud.alloydb.v1beta.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (!getRequestSpecificCase().equals(other.getRequestSpecificCase())) return false; + switch (requestSpecificCase_) { + case 8: + if (!getBatchCreateInstancesMetadata().equals(other.getBatchCreateInstancesMetadata())) + 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(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + switch (requestSpecificCase_) { + case 8: + hash = (37 * hash) + BATCH_CREATE_INSTANCES_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getBatchCreateInstancesMetadata().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.OperationMetadata 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.alloydb.v1beta.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.OperationMetadata 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.alloydb.v1beta.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.OperationMetadata 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.alloydb.v1beta.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.OperationMetadata 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.alloydb.v1beta.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.OperationMetadata 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.alloydb.v1beta.OperationMetadata 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 metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.OperationMetadata) + com.google.cloud.alloydb.v1beta.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.OperationMetadata.class, + com.google.cloud.alloydb.v1beta.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.OperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (batchCreateInstancesMetadataBuilder_ != null) { + batchCreateInstancesMetadataBuilder_.clear(); + } + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + requestedCancellation_ = false; + apiVersion_ = ""; + requestSpecificCase_ = 0; + requestSpecific_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.OperationMetadata build() { + com.google.cloud.alloydb.v1beta.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.OperationMetadata buildPartial() { + com.google.cloud.alloydb.v1beta.OperationMetadata result = + new com.google.cloud.alloydb.v1beta.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.OperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.verb_ = verb_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.statusMessage_ = statusMessage_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.apiVersion_ = apiVersion_; + } + } + + private void buildPartialOneofs(com.google.cloud.alloydb.v1beta.OperationMetadata result) { + result.requestSpecificCase_ = requestSpecificCase_; + result.requestSpecific_ = this.requestSpecific_; + if (requestSpecificCase_ == 8 && batchCreateInstancesMetadataBuilder_ != null) { + result.requestSpecific_ = batchCreateInstancesMetadataBuilder_.build(); + } + } + + @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.alloydb.v1beta.OperationMetadata) { + return mergeFrom((com.google.cloud.alloydb.v1beta.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.OperationMetadata other) { + if (other == com.google.cloud.alloydb.v1beta.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + bitField0_ |= 0x00000080; + onChanged(); + } + switch (other.getRequestSpecificCase()) { + case BATCH_CREATE_INSTANCES_METADATA: + { + mergeBatchCreateInstancesMetadata(other.getBatchCreateInstancesMetadata()); + break; + } + case REQUESTSPECIFIC_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(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 26: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + verb_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + statusMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 48: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 48 + case 58: + { + apiVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + input.readMessage( + getBatchCreateInstancesMetadataFieldBuilder().getBuilder(), extensionRegistry); + requestSpecificCase_ = 8; + break; + } // case 66 + 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 requestSpecificCase_ = 0; + private java.lang.Object requestSpecific_; + + public RequestSpecificCase getRequestSpecificCase() { + return RequestSpecificCase.forNumber(requestSpecificCase_); + } + + public Builder clearRequestSpecific() { + requestSpecificCase_ = 0; + requestSpecific_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata, + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.Builder, + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadataOrBuilder> + batchCreateInstancesMetadataBuilder_; + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the batchCreateInstancesMetadata field is set. + */ + @java.lang.Override + public boolean hasBatchCreateInstancesMetadata() { + return requestSpecificCase_ == 8; + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The batchCreateInstancesMetadata. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + getBatchCreateInstancesMetadata() { + if (batchCreateInstancesMetadataBuilder_ == null) { + if (requestSpecificCase_ == 8) { + return (com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) requestSpecific_; + } + return com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.getDefaultInstance(); + } else { + if (requestSpecificCase_ == 8) { + return batchCreateInstancesMetadataBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBatchCreateInstancesMetadata( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata value) { + if (batchCreateInstancesMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestSpecific_ = value; + onChanged(); + } else { + batchCreateInstancesMetadataBuilder_.setMessage(value); + } + requestSpecificCase_ = 8; + return this; + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBatchCreateInstancesMetadata( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.Builder builderForValue) { + if (batchCreateInstancesMetadataBuilder_ == null) { + requestSpecific_ = builderForValue.build(); + onChanged(); + } else { + batchCreateInstancesMetadataBuilder_.setMessage(builderForValue.build()); + } + requestSpecificCase_ = 8; + return this; + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeBatchCreateInstancesMetadata( + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata value) { + if (batchCreateInstancesMetadataBuilder_ == null) { + if (requestSpecificCase_ == 8 + && requestSpecific_ + != com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + .getDefaultInstance()) { + requestSpecific_ = + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.newBuilder( + (com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) + requestSpecific_) + .mergeFrom(value) + .buildPartial(); + } else { + requestSpecific_ = value; + } + onChanged(); + } else { + if (requestSpecificCase_ == 8) { + batchCreateInstancesMetadataBuilder_.mergeFrom(value); + } else { + batchCreateInstancesMetadataBuilder_.setMessage(value); + } + } + requestSpecificCase_ = 8; + return this; + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearBatchCreateInstancesMetadata() { + if (batchCreateInstancesMetadataBuilder_ == null) { + if (requestSpecificCase_ == 8) { + requestSpecificCase_ = 0; + requestSpecific_ = null; + onChanged(); + } + } else { + if (requestSpecificCase_ == 8) { + requestSpecificCase_ = 0; + requestSpecific_ = null; + } + batchCreateInstancesMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.Builder + getBatchCreateInstancesMetadataBuilder() { + return getBatchCreateInstancesMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadataOrBuilder + getBatchCreateInstancesMetadataOrBuilder() { + if ((requestSpecificCase_ == 8) && (batchCreateInstancesMetadataBuilder_ != null)) { + return batchCreateInstancesMetadataBuilder_.getMessageOrBuilder(); + } else { + if (requestSpecificCase_ == 8) { + return (com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) requestSpecific_; + } + return com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. BatchCreateInstances related metadata.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata, + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.Builder, + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadataOrBuilder> + getBatchCreateInstancesMetadataFieldBuilder() { + if (batchCreateInstancesMetadataBuilder_ == null) { + if (!(requestSpecificCase_ == 8)) { + requestSpecific_ = + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.getDefaultInstance(); + } + batchCreateInstancesMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata, + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.Builder, + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadataOrBuilder>( + (com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) requestSpecific_, + getParentForChildren(), + isClean()); + requestSpecific_ = null; + } + requestSpecificCase_ = 8; + onChanged(); + return batchCreateInstancesMetadataBuilder_; + } + + 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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000002); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + target_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + verb_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + verb_ = getDefaultInstance().getVerb(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + verb_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + statusMessage_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + statusMessage_ = getDefaultInstance().getStatusMessage(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + statusMessage_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + bitField0_ = (bitField0_ & ~0x00000040); + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiVersion_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + apiVersion_ = getDefaultInstance().getApiVersion(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiVersion_ = value; + bitField0_ |= 0x00000080; + 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.alloydb.v1beta.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.OperationMetadata) + private static final com.google.cloud.alloydb.v1beta.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.OperationMetadata(); + } + + public static com.google.cloud.alloydb.v1beta.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata 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.alloydb.v1beta.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/OperationMetadataOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..40c6e329ad39 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/OperationMetadataOrBuilder.java @@ -0,0 +1,263 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the batchCreateInstancesMetadata field is set. + */ + boolean hasBatchCreateInstancesMetadata(); + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The batchCreateInstancesMetadata. + */ + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata getBatchCreateInstancesMetadata(); + /** + * + * + *
+   * Output only. BatchCreateInstances related metadata.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadataOrBuilder + getBatchCreateInstancesMetadataOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); + + public com.google.cloud.alloydb.v1beta.OperationMetadata.RequestSpecificCase + getRequestSpecificCase(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/PromoteClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/PromoteClusterRequest.java new file mode 100644 index 000000000000..b9fe73dcdbb5 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/PromoteClusterRequest.java @@ -0,0 +1,1196 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for promoting a Cluster
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.PromoteClusterRequest} + */ +public final class PromoteClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.PromoteClusterRequest) + PromoteClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PromoteClusterRequest.newBuilder() to construct. + private PromoteClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PromoteClusterRequest() { + name_ = ""; + requestId_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PromoteClusterRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_PromoteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_PromoteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.PromoteClusterRequest.class, + com.google.cloud.alloydb.v1beta.PromoteClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Cluster.name field
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + 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.alloydb.v1beta.PromoteClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.PromoteClusterRequest other = + (com.google.cloud.alloydb.v1beta.PromoteClusterRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.PromoteClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.PromoteClusterRequest 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.alloydb.v1beta.PromoteClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.PromoteClusterRequest 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.alloydb.v1beta.PromoteClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.PromoteClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.PromoteClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.PromoteClusterRequest 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.alloydb.v1beta.PromoteClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.PromoteClusterRequest 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.alloydb.v1beta.PromoteClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.PromoteClusterRequest 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.alloydb.v1beta.PromoteClusterRequest 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; + } + /** + * + * + *
+   * Message for promoting a Cluster
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.PromoteClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.PromoteClusterRequest) + com.google.cloud.alloydb.v1beta.PromoteClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_PromoteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_PromoteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.PromoteClusterRequest.class, + com.google.cloud.alloydb.v1beta.PromoteClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.PromoteClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + etag_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_PromoteClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.PromoteClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.PromoteClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.PromoteClusterRequest build() { + com.google.cloud.alloydb.v1beta.PromoteClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.PromoteClusterRequest buildPartial() { + com.google.cloud.alloydb.v1beta.PromoteClusterRequest result = + new com.google.cloud.alloydb.v1beta.PromoteClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.PromoteClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1beta.PromoteClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.PromoteClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.PromoteClusterRequest other) { + if (other == com.google.cloud.alloydb.v1beta.PromoteClusterRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Cluster.name field
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the Cluster.
+     * If an etag is provided and does not match the current etag of the Cluster,
+     * deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = 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.alloydb.v1beta.PromoteClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.PromoteClusterRequest) + private static final com.google.cloud.alloydb.v1beta.PromoteClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.PromoteClusterRequest(); + } + + public static com.google.cloud.alloydb.v1beta.PromoteClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PromoteClusterRequest 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.alloydb.v1beta.PromoteClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/PromoteClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/PromoteClusterRequestOrBuilder.java new file mode 100644 index 000000000000..d81fe5259731 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/PromoteClusterRequestOrBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface PromoteClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.PromoteClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The current etag of the Cluster.
+   * If an etag is provided and does not match the current etag of the Cluster,
+   * deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ResourcesProto.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ResourcesProto.java new file mode 100644 index 000000000000..abdec51d7128 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ResourcesProto.java @@ -0,0 +1,825 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public final class ResourcesProto { + private ResourcesProto() {} + + 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_alloydb_v1beta_UserPassword_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_UserPassword_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_MigrationSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_MigrationSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_EncryptionConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_EncryptionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_EncryptionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_EncryptionInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_SslConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_SslConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_WeeklySchedule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_WeeklySchedule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_TimeBasedRetention_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_TimeBasedRetention_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_QuantityBasedRetention_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_QuantityBasedRetention_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_ContinuousBackupConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_ContinuousBackupConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_ContinuousBackupInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_ContinuousBackupInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_BackupSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_BackupSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_ContinuousBackupSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_ContinuousBackupSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Cluster_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Cluster_SecondaryConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Cluster_SecondaryConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Cluster_PrimaryConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Cluster_PrimaryConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Cluster_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Cluster_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Cluster_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Cluster_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Instance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Instance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Instance_MachineConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Instance_MachineConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Instance_Node_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Instance_Node_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Instance_QueryInsightsInstanceConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Instance_QueryInsightsInstanceConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Instance_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Instance_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Instance_DatabaseFlagsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Instance_DatabaseFlagsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Instance_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Instance_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_ConnectionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_ConnectionInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Backup_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Backup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Backup_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Backup_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Backup_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Backup_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_StringRestrictions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_StringRestrictions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_IntegerRestrictions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_IntegerRestrictions_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/alloydb/v1beta/resources." + + "proto\022\033google.cloud.alloydb.v1beta\032\037goog" + + "le/api/field_behavior.proto\032\031google/api/" + + "resource.proto\032\036google/protobuf/duration" + + ".proto\032\037google/protobuf/timestamp.proto\032" + + "\036google/protobuf/wrappers.proto\032\033google/" + + "type/dayofweek.proto\032\033google/type/timeof" + + "day.proto\".\n\014UserPassword\022\014\n\004user\030\001 \001(\t\022" + + "\020\n\010password\030\002 \001(\t\"\347\001\n\017MigrationSource\022\026\n" + + "\thost_port\030\001 \001(\tB\003\340A\003\022\031\n\014reference_id\030\002 " + + "\001(\tB\003\340A\003\022Z\n\013source_type\030\003 \001(\0162@.google.c" + + "loud.alloydb.v1beta.MigrationSource.Migr" + + "ationSourceTypeB\003\340A\003\"E\n\023MigrationSourceT" + + "ype\022%\n!MIGRATION_SOURCE_TYPE_UNSPECIFIED" + + "\020\000\022\007\n\003DMS\020\001\"(\n\020EncryptionConfig\022\024\n\014kms_k" + + "ey_name\030\001 \001(\t\"\212\002\n\016EncryptionInfo\022N\n\017encr" + + "yption_type\030\001 \001(\01620.google.cloud.alloydb" + + ".v1beta.EncryptionInfo.TypeB\003\340A\003\022J\n\020kms_" + + "key_versions\030\002 \003(\tB0\340A\003\372A*\n(cloudkms.goo" + + "gleapis.com/CryptoKeyVersion\"\\\n\004Type\022\024\n\020" + + "TYPE_UNSPECIFIED\020\000\022\035\n\031GOOGLE_DEFAULT_ENC" + + "RYPTION\020\001\022\037\n\033CUSTOMER_MANAGED_ENCRYPTION" + + "\020\002\"\300\002\n\tSslConfig\022E\n\010ssl_mode\030\001 \001(\0162..goo" + + "gle.cloud.alloydb.v1beta.SslConfig.SslMo" + + "deB\003\340A\001\022G\n\tca_source\030\002 \001(\0162/.google.clou" + + "d.alloydb.v1beta.SslConfig.CaSourceB\003\340A\001" + + "\"e\n\007SslMode\022\030\n\024SSL_MODE_UNSPECIFIED\020\000\022\022\n" + + "\016SSL_MODE_ALLOW\020\001\022\024\n\020SSL_MODE_REQUIRE\020\002\022" + + "\026\n\022SSL_MODE_VERIFY_CA\020\003\"<\n\010CaSource\022\031\n\025C" + + "A_SOURCE_UNSPECIFIED\020\000\022\025\n\021CA_SOURCE_MANA" + + "GED\020\001\"\371\006\n\025AutomatedBackupPolicy\022\\\n\017weekl" + + "y_schedule\030\002 \001(\0132A.google.cloud.alloydb." + + "v1beta.AutomatedBackupPolicy.WeeklySched" + + "uleH\000\022e\n\024time_based_retention\030\004 \001(\0132E.go" + + "ogle.cloud.alloydb.v1beta.AutomatedBacku" + + "pPolicy.TimeBasedRetentionH\001\022m\n\030quantity" + + "_based_retention\030\005 \001(\0132I.google.cloud.al" + + "loydb.v1beta.AutomatedBackupPolicy.Quant" + + "ityBasedRetentionH\001\022\024\n\007enabled\030\001 \001(\010H\002\210\001" + + "\001\0220\n\rbackup_window\030\003 \001(\0132\031.google.protob" + + "uf.Duration\022M\n\021encryption_config\030\010 \001(\0132-" + + ".google.cloud.alloydb.v1beta.EncryptionC" + + "onfigB\003\340A\001\022\020\n\010location\030\006 \001(\t\022N\n\006labels\030\007" + + " \003(\0132>.google.cloud.alloydb.v1beta.Autom" + + "atedBackupPolicy.LabelsEntry\032k\n\016WeeklySc" + + "hedule\022+\n\013start_times\030\001 \003(\0132\026.google.typ" + + "e.TimeOfDay\022,\n\014days_of_week\030\002 \003(\0162\026.goog" + + "le.type.DayOfWeek\032I\n\022TimeBasedRetention\022" + + "3\n\020retention_period\030\001 \001(\0132\031.google.proto" + + "buf.Duration\032\'\n\026QuantityBasedRetention\022\r" + + "\n\005count\030\001 \001(\005\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(" + + "\t\022\r\n\005value\030\002 \001(\t:\0028\001B\n\n\010scheduleB\013\n\trete" + + "ntionB\n\n\010_enabled\"\242\001\n\026ContinuousBackupCo" + + "nfig\022\024\n\007enabled\030\001 \001(\010H\000\210\001\001\022\034\n\024recovery_w" + + "indow_days\030\004 \001(\005\022H\n\021encryption_config\030\003 " + + "\001(\0132-.google.cloud.alloydb.v1beta.Encryp" + + "tionConfigB\n\n\010_enabled\"\307\001\n\024ContinuousBac" + + "kupInfo\022I\n\017encryption_info\030\001 \001(\0132+.googl" + + "e.cloud.alloydb.v1beta.EncryptionInfoB\003\340" + + "A\003\0225\n\014enabled_time\030\002 \001(\0132\032.google.protob" + + "uf.TimestampB\003\340A\003\022-\n\010schedule\030\003 \003(\0162\026.go" + + "ogle.type.DayOfWeekB\003\340A\003\"c\n\014BackupSource" + + "\022\027\n\nbackup_uid\030\002 \001(\tB\003\340A\003\022:\n\013backup_name" + + "\030\001 \001(\tB%\340A\002\372A\037\n\035alloydb.googleapis.com/B" + + "ackup\"f\n\026ContinuousBackupSource\022\024\n\007clust" + + "er\030\001 \001(\tB\003\340A\002\0226\n\rpoint_in_time\030\002 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\003\340A\002\"\256\020\n\007Cluste" + + "r\022G\n\rbackup_source\030\017 \001(\0132).google.cloud." + + "alloydb.v1beta.BackupSourceB\003\340A\003H\000\022M\n\020mi" + + "gration_source\030\020 \001(\0132,.google.cloud.allo" + + "ydb.v1beta.MigrationSourceB\003\340A\003H\000\022\021\n\004nam" + + "e\030\001 \001(\tB\003\340A\003\022\024\n\014display_name\030\002 \001(\t\022\020\n\003ui" + + "d\030\003 \001(\tB\003\340A\003\0224\n\013create_time\030\004 \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\003\0224\n\013update_tim" + + "e\030\005 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + "\0224\n\013delete_time\030\006 \001(\0132\032.google.protobuf." + + "TimestampB\003\340A\003\022@\n\006labels\030\007 \003(\01320.google." + + "cloud.alloydb.v1beta.Cluster.LabelsEntry" + + "\022>\n\005state\030\010 \001(\0162*.google.cloud.alloydb.v" + + "1beta.Cluster.StateB\003\340A\003\022K\n\014cluster_type" + + "\030\030 \001(\01620.google.cloud.alloydb.v1beta.Clu" + + "ster.ClusterTypeB\003\340A\003\022K\n\020database_versio" + + "n\030\t \001(\0162,.google.cloud.alloydb.v1beta.Da" + + "tabaseVersionB\003\340A\003\0227\n\007network\030\n \001(\tB&\340A\002" + + "\372A \n\036compute.googleapis.com/Network\022\014\n\004e" + + "tag\030\013 \001(\t\022J\n\013annotations\030\014 \003(\01325.google." + + "cloud.alloydb.v1beta.Cluster.Annotations" + + "Entry\022\030\n\013reconciling\030\r \001(\010B\003\340A\003\022D\n\014initi" + + "al_user\030\016 \001(\0132).google.cloud.alloydb.v1b" + + "eta.UserPasswordB\003\340A\004\022S\n\027automated_backu" + + "p_policy\030\021 \001(\01322.google.cloud.alloydb.v1" + + "beta.AutomatedBackupPolicy\022:\n\nssl_config" + + "\030\022 \001(\0132&.google.cloud.alloydb.v1beta.Ssl" + + "Config\022M\n\021encryption_config\030\023 \001(\0132-.goog" + + "le.cloud.alloydb.v1beta.EncryptionConfig" + + "B\003\340A\001\022I\n\017encryption_info\030\024 \001(\0132+.google." + + "cloud.alloydb.v1beta.EncryptionInfoB\003\340A\003" + + "\022Z\n\030continuous_backup_config\030\033 \001(\01323.goo" + + "gle.cloud.alloydb.v1beta.ContinuousBacku" + + "pConfigB\003\340A\001\022V\n\026continuous_backup_info\030\034" + + " \001(\01321.google.cloud.alloydb.v1beta.Conti" + + "nuousBackupInfoB\003\340A\003\022N\n\020secondary_config" + + "\030\026 \001(\01324.google.cloud.alloydb.v1beta.Clu" + + "ster.SecondaryConfig\022O\n\016primary_config\030\027" + + " \001(\01322.google.cloud.alloydb.v1beta.Clust" + + "er.PrimaryConfigB\003\340A\003\032/\n\017SecondaryConfig" + + "\022\034\n\024primary_cluster_name\030\001 \001(\t\0325\n\rPrimar" + + "yConfig\022$\n\027secondary_cluster_names\030\001 \003(\t" + + "B\003\340A\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005val" + + "ue\030\002 \001(\t:\0028\001\0322\n\020AnnotationsEntry\022\013\n\003key\030" + + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\234\001\n\005State\022\025\n\021ST" + + "ATE_UNSPECIFIED\020\000\022\t\n\005READY\020\001\022\013\n\007STOPPED\020" + + "\002\022\t\n\005EMPTY\020\003\022\014\n\010CREATING\020\004\022\014\n\010DELETING\020\005" + + "\022\n\n\006FAILED\020\006\022\021\n\rBOOTSTRAPPING\020\007\022\017\n\013MAINT" + + "ENANCE\020\010\022\r\n\tPROMOTING\020\t\"G\n\013ClusterType\022\034" + + "\n\030CLUSTER_TYPE_UNSPECIFIED\020\000\022\013\n\007PRIMARY\020" + + "\001\022\r\n\tSECONDARY\020\002:b\352A_\n\036alloydb.googleapi" + + "s.com/Cluster\022:projects/{project}/locati" + + "ons/{location}/clusters/{cluster}R\001\001B\010\n\006" + + "source\"\337\020\n\010Instance\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\024" + + "\n\014display_name\030\002 \001(\t\022\020\n\003uid\030\003 \001(\tB\003\340A\003\0224" + + "\n\013create_time\030\004 \001(\0132\032.google.protobuf.Ti" + + "mestampB\003\340A\003\0224\n\013update_time\030\005 \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\003\0224\n\013delete_tim" + + "e\030\006 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + "\022A\n\006labels\030\007 \003(\01321.google.cloud.alloydb." + + "v1beta.Instance.LabelsEntry\022?\n\005state\030\010 \001" + + "(\0162+.google.cloud.alloydb.v1beta.Instanc" + + "e.StateB\003\340A\003\022N\n\rinstance_type\030\t \001(\01622.go" + + "ogle.cloud.alloydb.v1beta.Instance.Insta" + + "nceTypeB\003\340A\002\022K\n\016machine_config\030\n \001(\01323.g" + + "oogle.cloud.alloydb.v1beta.Instance.Mach" + + "ineConfig\022Q\n\021availability_type\030\013 \001(\01626.g" + + "oogle.cloud.alloydb.v1beta.Instance.Avai" + + "labilityType\022\020\n\010gce_zone\030\014 \001(\t\022P\n\016databa" + + "se_flags\030\r \003(\01328.google.cloud.alloydb.v1" + + "beta.Instance.DatabaseFlagsEntry\022F\n\rwrit" + + "able_node\030\023 \001(\0132*.google.cloud.alloydb.v" + + "1beta.Instance.NodeB\003\340A\003\022>\n\005nodes\030\024 \003(\0132" + + "*.google.cloud.alloydb.v1beta.Instance.N" + + "odeB\003\340A\003\022`\n\025query_insights_config\030\025 \001(\0132" + + "A.google.cloud.alloydb.v1beta.Instance.Q" + + "ueryInsightsInstanceConfig\022N\n\020read_pool_" + + "config\030\016 \001(\01324.google.cloud.alloydb.v1be" + + "ta.Instance.ReadPoolConfig\022\027\n\nip_address" + + "\030\017 \001(\tB\003\340A\003\022\030\n\013reconciling\030\020 \001(\010B\003\340A\003\022\014\n" + + "\004etag\030\021 \001(\t\022K\n\013annotations\030\022 \003(\01326.googl" + + "e.cloud.alloydb.v1beta.Instance.Annotati" + + "onsEntry\032\"\n\rMachineConfig\022\021\n\tcpu_count\030\001" + + " \001(\005\032>\n\004Node\022\017\n\007zone_id\030\001 \001(\t\022\n\n\002id\030\002 \001(" + + "\t\022\n\n\002ip\030\003 \001(\t\022\r\n\005state\030\004 \001(\t\032\372\001\n\033QueryIn" + + "sightsInstanceConfig\022$\n\027record_applicati" + + "on_tags\030\002 \001(\010H\000\210\001\001\022\"\n\025record_client_addr" + + "ess\030\003 \001(\010H\001\210\001\001\022\033\n\023query_string_length\030\004 " + + "\001(\r\022#\n\026query_plans_per_minute\030\005 \001(\rH\002\210\001\001" + + "B\032\n\030_record_application_tagsB\030\n\026_record_" + + "client_addressB\031\n\027_query_plans_per_minut" + + "e\032$\n\016ReadPoolConfig\022\022\n\nnode_count\030\001 \001(\005\032" + + "-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" + + "(\t:\0028\001\0324\n\022DatabaseFlagsEntry\022\013\n\003key\030\001 \001(" + + "\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020AnnotationsEntry" + + "\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\221\001\n\005Sta" + + "te\022\025\n\021STATE_UNSPECIFIED\020\000\022\t\n\005READY\020\001\022\013\n\007" + + "STOPPED\020\002\022\014\n\010CREATING\020\003\022\014\n\010DELETING\020\004\022\017\n" + + "\013MAINTENANCE\020\005\022\n\n\006FAILED\020\006\022\021\n\rBOOTSTRAPP" + + "ING\020\010\022\r\n\tPROMOTING\020\t\"X\n\014InstanceType\022\035\n\031" + + "INSTANCE_TYPE_UNSPECIFIED\020\000\022\013\n\007PRIMARY\020\001" + + "\022\r\n\tREAD_POOL\020\002\022\r\n\tSECONDARY\020\003\"N\n\020Availa" + + "bilityType\022!\n\035AVAILABILITY_TYPE_UNSPECIF" + + "IED\020\000\022\t\n\005ZONAL\020\001\022\014\n\010REGIONAL\020\002:x\352Au\n\037all" + + "oydb.googleapis.com/Instance\022Oprojects/{" + + "project}/locations/{location}/clusters/{" + + "cluster}/instances/{instance}R\001\001\"\204\002\n\016Con" + + "nectionInfo\022\014\n\004name\030\001 \001(\t\022\027\n\nip_address\030" + + "\002 \001(\tB\003\340A\003\022\"\n\025pem_certificate_chain\030\003 \003(" + + "\tB\003\340A\003\022\031\n\014instance_uid\030\004 \001(\tB\003\340A\003:\213\001\352A\207\001" + + "\n%alloydb.googleapis.com/ConnectionInfo\022" + + "^projects/{project}/locations/{location}" + + "/clusters/{cluster}/instances/{instance}" + + "/connectionInfo\"\311\t\n\006Backup\022\021\n\004name\030\001 \001(\t" + + "B\003\340A\003\022\024\n\014display_name\030\002 \001(\t\022\020\n\003uid\030\003 \001(\t" + + "B\003\340A\003\0224\n\013create_time\030\004 \001(\0132\032.google.prot" + + "obuf.TimestampB\003\340A\003\0224\n\013update_time\030\005 \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\0224\n\013del" + + "ete_time\030\017 \001(\0132\032.google.protobuf.Timesta" + + "mpB\003\340A\003\022?\n\006labels\030\006 \003(\0132/.google.cloud.a" + + "lloydb.v1beta.Backup.LabelsEntry\022=\n\005stat" + + "e\030\007 \001(\0162).google.cloud.alloydb.v1beta.Ba" + + "ckup.StateB\003\340A\003\0226\n\004type\030\010 \001(\0162(.google.c" + + "loud.alloydb.v1beta.Backup.Type\022\023\n\013descr" + + "iption\030\t \001(\t\022\030\n\013cluster_uid\030\022 \001(\tB\003\340A\003\022<" + + "\n\014cluster_name\030\n \001(\tB&\340A\002\372A \n\036alloydb.go" + + "ogleapis.com/Cluster\022\030\n\013reconciling\030\013 \001(" + + "\010B\003\340A\003\022M\n\021encryption_config\030\014 \001(\0132-.goog" + + "le.cloud.alloydb.v1beta.EncryptionConfig" + + "B\003\340A\001\022I\n\017encryption_info\030\r \001(\0132+.google." + + "cloud.alloydb.v1beta.EncryptionInfoB\003\340A\003" + + "\022\014\n\004etag\030\016 \001(\t\022I\n\013annotations\030\020 \003(\01324.go" + + "ogle.cloud.alloydb.v1beta.Backup.Annotat" + + "ionsEntry\022\027\n\nsize_bytes\030\021 \001(\003B\003\340A\003\0224\n\013ex" + + "piry_time\030\023 \001(\0132\032.google.protobuf.Timest" + + "ampB\003\340A\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" + + "value\030\002 \001(\t:\0028\001\0322\n\020AnnotationsEntry\022\013\n\003k" + + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"Q\n\005State\022\025\n\021" + + "STATE_UNSPECIFIED\020\000\022\t\n\005READY\020\001\022\014\n\010CREATI" + + "NG\020\002\022\n\n\006FAILED\020\003\022\014\n\010DELETING\020\004\"J\n\004Type\022\024" + + "\n\020TYPE_UNSPECIFIED\020\000\022\r\n\tON_DEMAND\020\001\022\r\n\tA" + + "UTOMATED\020\002\022\016\n\nCONTINUOUS\020\003:_\352A\\\n\035alloydb" + + ".googleapis.com/Backup\0228projects/{projec" + + "t}/locations/{location}/backups/{backup}" + + "R\001\001\"\330\006\n\025SupportedDatabaseFlag\022d\n\023string_" + + "restrictions\030\007 \001(\0132E.google.cloud.alloyd" + + "b.v1beta.SupportedDatabaseFlag.StringRes" + + "trictionsH\000\022f\n\024integer_restrictions\030\010 \001(" + + "\0132F.google.cloud.alloydb.v1beta.Supporte" + + "dDatabaseFlag.IntegerRestrictionsH\000\022\014\n\004n" + + "ame\030\001 \001(\t\022\021\n\tflag_name\030\002 \001(\t\022P\n\nvalue_ty" + + "pe\030\003 \001(\0162<.google.cloud.alloydb.v1beta.S" + + "upportedDatabaseFlag.ValueType\022\037\n\027accept" + + "s_multiple_values\030\004 \001(\010\022K\n\025supported_db_" + + "versions\030\005 \003(\0162,.google.cloud.alloydb.v1" + + "beta.DatabaseVersion\022\033\n\023requires_db_rest" + + "art\030\006 \001(\010\032,\n\022StringRestrictions\022\026\n\016allow" + + "ed_values\030\001 \003(\t\032u\n\023IntegerRestrictions\022." + + "\n\tmin_value\030\001 \001(\0132\033.google.protobuf.Int6" + + "4Value\022.\n\tmax_value\030\002 \001(\0132\033.google.proto" + + "buf.Int64Value\"U\n\tValueType\022\032\n\026VALUE_TYP" + + "E_UNSPECIFIED\020\000\022\n\n\006STRING\020\001\022\013\n\007INTEGER\020\002" + + "\022\t\n\005FLOAT\020\003\022\010\n\004NONE\020\004:g\352Ad\n,alloydb.goog" + + "leapis.com/SupportedDatabaseFlag\0224projec" + + "ts/{project}/locations/{location}/flags/" + + "{flag}B\016\n\014restrictions*Y\n\017DatabaseVersio" + + "n\022 \n\034DATABASE_VERSION_UNSPECIFIED\020\000\022\023\n\013P" + + "OSTGRES_13\020\001\032\002\010\001\022\017\n\013POSTGRES_14\020\002*^\n\014Ins" + + "tanceView\022\035\n\031INSTANCE_VIEW_UNSPECIFIED\020\000" + + "\022\027\n\023INSTANCE_VIEW_BASIC\020\001\022\026\n\022INSTANCE_VI" + + "EW_FULL\020\002B\306\003\n\037com.google.cloud.alloydb.v" + + "1betaB\016ResourcesProtoP\001Z9cloud.google.co" + + "m/go/alloydb/apiv1beta/alloydbpb;alloydb" + + "pb\252\002\033Google.Cloud.AlloyDb.V1Beta\312\002\033Googl" + + "e\\Cloud\\AlloyDb\\V1beta\352\002\036Google::Cloud::" + + "AlloyDb::V1beta\352A\246\001\n(cloudkms.googleapis" + + ".com/CryptoKeyVersion\022zprojects/{project" + + "}/locations/{location}/keyRings/{key_rin" + + "g}/cryptoKeys/{crypto_key}/cryptoKeyVers" + + "ions/{crypto_key_version}\352AN\n\036compute.go" + + "ogleapis.com/Network\022,projects/{project}" + + "/global/networks/{network}b\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.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + com.google.type.DayOfWeekProto.getDescriptor(), + com.google.type.TimeOfDayProto.getDescriptor(), + }); + internal_static_google_cloud_alloydb_v1beta_UserPassword_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_alloydb_v1beta_UserPassword_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_UserPassword_descriptor, + new java.lang.String[] { + "User", "Password", + }); + internal_static_google_cloud_alloydb_v1beta_MigrationSource_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_alloydb_v1beta_MigrationSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_MigrationSource_descriptor, + new java.lang.String[] { + "HostPort", "ReferenceId", "SourceType", + }); + internal_static_google_cloud_alloydb_v1beta_EncryptionConfig_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_alloydb_v1beta_EncryptionConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_EncryptionConfig_descriptor, + new java.lang.String[] { + "KmsKeyName", + }); + internal_static_google_cloud_alloydb_v1beta_EncryptionInfo_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_alloydb_v1beta_EncryptionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_EncryptionInfo_descriptor, + new java.lang.String[] { + "EncryptionType", "KmsKeyVersions", + }); + internal_static_google_cloud_alloydb_v1beta_SslConfig_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_alloydb_v1beta_SslConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_SslConfig_descriptor, + new java.lang.String[] { + "SslMode", "CaSource", + }); + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_descriptor, + new java.lang.String[] { + "WeeklySchedule", + "TimeBasedRetention", + "QuantityBasedRetention", + "Enabled", + "BackupWindow", + "EncryptionConfig", + "Location", + "Labels", + "Schedule", + "Retention", + "Enabled", + }); + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_WeeklySchedule_descriptor = + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_WeeklySchedule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_WeeklySchedule_descriptor, + new java.lang.String[] { + "StartTimes", "DaysOfWeek", + }); + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_TimeBasedRetention_descriptor = + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_TimeBasedRetention_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_TimeBasedRetention_descriptor, + new java.lang.String[] { + "RetentionPeriod", + }); + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_QuantityBasedRetention_descriptor = + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_QuantityBasedRetention_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_QuantityBasedRetention_descriptor, + new java.lang.String[] { + "Count", + }); + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_descriptor + .getNestedTypes() + .get(3); + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_AutomatedBackupPolicy_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1beta_ContinuousBackupConfig_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_alloydb_v1beta_ContinuousBackupConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_ContinuousBackupConfig_descriptor, + new java.lang.String[] { + "Enabled", "RecoveryWindowDays", "EncryptionConfig", "Enabled", + }); + internal_static_google_cloud_alloydb_v1beta_ContinuousBackupInfo_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_alloydb_v1beta_ContinuousBackupInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_ContinuousBackupInfo_descriptor, + new java.lang.String[] { + "EncryptionInfo", "EnabledTime", "Schedule", + }); + internal_static_google_cloud_alloydb_v1beta_BackupSource_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_alloydb_v1beta_BackupSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_BackupSource_descriptor, + new java.lang.String[] { + "BackupUid", "BackupName", + }); + internal_static_google_cloud_alloydb_v1beta_ContinuousBackupSource_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_alloydb_v1beta_ContinuousBackupSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_ContinuousBackupSource_descriptor, + new java.lang.String[] { + "Cluster", "PointInTime", + }); + internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_alloydb_v1beta_Cluster_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor, + new java.lang.String[] { + "BackupSource", + "MigrationSource", + "Name", + "DisplayName", + "Uid", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Labels", + "State", + "ClusterType", + "DatabaseVersion", + "Network", + "Etag", + "Annotations", + "Reconciling", + "InitialUser", + "AutomatedBackupPolicy", + "SslConfig", + "EncryptionConfig", + "EncryptionInfo", + "ContinuousBackupConfig", + "ContinuousBackupInfo", + "SecondaryConfig", + "PrimaryConfig", + "Source", + }); + internal_static_google_cloud_alloydb_v1beta_Cluster_SecondaryConfig_descriptor = + internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_alloydb_v1beta_Cluster_SecondaryConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Cluster_SecondaryConfig_descriptor, + new java.lang.String[] { + "PrimaryClusterName", + }); + internal_static_google_cloud_alloydb_v1beta_Cluster_PrimaryConfig_descriptor = + internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_alloydb_v1beta_Cluster_PrimaryConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Cluster_PrimaryConfig_descriptor, + new java.lang.String[] { + "SecondaryClusterNames", + }); + internal_static_google_cloud_alloydb_v1beta_Cluster_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_alloydb_v1beta_Cluster_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Cluster_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1beta_Cluster_AnnotationsEntry_descriptor = + internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor.getNestedTypes().get(3); + internal_static_google_cloud_alloydb_v1beta_Cluster_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Cluster_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1beta_Instance_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_alloydb_v1beta_Instance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Instance_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Uid", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Labels", + "State", + "InstanceType", + "MachineConfig", + "AvailabilityType", + "GceZone", + "DatabaseFlags", + "WritableNode", + "Nodes", + "QueryInsightsConfig", + "ReadPoolConfig", + "IpAddress", + "Reconciling", + "Etag", + "Annotations", + }); + internal_static_google_cloud_alloydb_v1beta_Instance_MachineConfig_descriptor = + internal_static_google_cloud_alloydb_v1beta_Instance_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_alloydb_v1beta_Instance_MachineConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Instance_MachineConfig_descriptor, + new java.lang.String[] { + "CpuCount", + }); + internal_static_google_cloud_alloydb_v1beta_Instance_Node_descriptor = + internal_static_google_cloud_alloydb_v1beta_Instance_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_alloydb_v1beta_Instance_Node_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Instance_Node_descriptor, + new java.lang.String[] { + "ZoneId", "Id", "Ip", "State", + }); + internal_static_google_cloud_alloydb_v1beta_Instance_QueryInsightsInstanceConfig_descriptor = + internal_static_google_cloud_alloydb_v1beta_Instance_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_alloydb_v1beta_Instance_QueryInsightsInstanceConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Instance_QueryInsightsInstanceConfig_descriptor, + new java.lang.String[] { + "RecordApplicationTags", + "RecordClientAddress", + "QueryStringLength", + "QueryPlansPerMinute", + "RecordApplicationTags", + "RecordClientAddress", + "QueryPlansPerMinute", + }); + internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_descriptor = + internal_static_google_cloud_alloydb_v1beta_Instance_descriptor.getNestedTypes().get(3); + internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_descriptor, + new java.lang.String[] { + "NodeCount", + }); + internal_static_google_cloud_alloydb_v1beta_Instance_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1beta_Instance_descriptor.getNestedTypes().get(4); + internal_static_google_cloud_alloydb_v1beta_Instance_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Instance_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1beta_Instance_DatabaseFlagsEntry_descriptor = + internal_static_google_cloud_alloydb_v1beta_Instance_descriptor.getNestedTypes().get(5); + internal_static_google_cloud_alloydb_v1beta_Instance_DatabaseFlagsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Instance_DatabaseFlagsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1beta_Instance_AnnotationsEntry_descriptor = + internal_static_google_cloud_alloydb_v1beta_Instance_descriptor.getNestedTypes().get(6); + internal_static_google_cloud_alloydb_v1beta_Instance_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Instance_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1beta_ConnectionInfo_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_alloydb_v1beta_ConnectionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_ConnectionInfo_descriptor, + new java.lang.String[] { + "Name", "IpAddress", "PemCertificateChain", "InstanceUid", + }); + internal_static_google_cloud_alloydb_v1beta_Backup_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_alloydb_v1beta_Backup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Backup_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Uid", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Labels", + "State", + "Type", + "Description", + "ClusterUid", + "ClusterName", + "Reconciling", + "EncryptionConfig", + "EncryptionInfo", + "Etag", + "Annotations", + "SizeBytes", + "ExpiryTime", + }); + internal_static_google_cloud_alloydb_v1beta_Backup_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1beta_Backup_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_alloydb_v1beta_Backup_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Backup_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1beta_Backup_AnnotationsEntry_descriptor = + internal_static_google_cloud_alloydb_v1beta_Backup_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_alloydb_v1beta_Backup_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Backup_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_descriptor, + new java.lang.String[] { + "StringRestrictions", + "IntegerRestrictions", + "Name", + "FlagName", + "ValueType", + "AcceptsMultipleValues", + "SupportedDbVersions", + "RequiresDbRestart", + "Restrictions", + }); + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_StringRestrictions_descriptor = + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_StringRestrictions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_StringRestrictions_descriptor, + new java.lang.String[] { + "AllowedValues", + }); + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_IntegerRestrictions_descriptor = + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_IntegerRestrictions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_IntegerRestrictions_descriptor, + new java.lang.String[] { + "MinValue", "MaxValue", + }); + 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.resourceDefinition); + 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.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + com.google.type.DayOfWeekProto.getDescriptor(); + com.google.type.TimeOfDayProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/RestartInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/RestartInstanceRequest.java new file mode 100644 index 000000000000..5e681f461684 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/RestartInstanceRequest.java @@ -0,0 +1,984 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** Protobuf type {@code google.cloud.alloydb.v1beta.RestartInstanceRequest} */ +public final class RestartInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.RestartInstanceRequest) + RestartInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RestartInstanceRequest.newBuilder() to construct. + private RestartInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestartInstanceRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestartInstanceRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_RestartInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_RestartInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.RestartInstanceRequest.class, + com.google.cloud.alloydb.v1beta.RestartInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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 resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * 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_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the restart.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + 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.alloydb.v1beta.RestartInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.RestartInstanceRequest other = + (com.google.cloud.alloydb.v1beta.RestartInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.RestartInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.RestartInstanceRequest 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.alloydb.v1beta.RestartInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.RestartInstanceRequest 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.alloydb.v1beta.RestartInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.RestartInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.RestartInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.RestartInstanceRequest 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.alloydb.v1beta.RestartInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.RestartInstanceRequest 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.alloydb.v1beta.RestartInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.RestartInstanceRequest 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.alloydb.v1beta.RestartInstanceRequest 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.alloydb.v1beta.RestartInstanceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.RestartInstanceRequest) + com.google.cloud.alloydb.v1beta.RestartInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_RestartInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_RestartInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.RestartInstanceRequest.class, + com.google.cloud.alloydb.v1beta.RestartInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.RestartInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_RestartInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.RestartInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.RestartInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.RestartInstanceRequest build() { + com.google.cloud.alloydb.v1beta.RestartInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.RestartInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1beta.RestartInstanceRequest result = + new com.google.cloud.alloydb.v1beta.RestartInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.RestartInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.alloydb.v1beta.RestartInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.RestartInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.RestartInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1beta.RestartInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + 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 java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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 resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the restart.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the restart.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the restart.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = 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.alloydb.v1beta.RestartInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.RestartInstanceRequest) + private static final com.google.cloud.alloydb.v1beta.RestartInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.RestartInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1beta.RestartInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestartInstanceRequest 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.alloydb.v1beta.RestartInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/RestartInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/RestartInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..39fb47a6a575 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/RestartInstanceRequestOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface RestartInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.RestartInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the restart.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/RestoreClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/RestoreClusterRequest.java new file mode 100644 index 000000000000..7716a1ff3a23 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/RestoreClusterRequest.java @@ -0,0 +1,2172 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for restoring a Cluster from a backup or another cluster at a given
+ * point in time.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.RestoreClusterRequest} + */ +public final class RestoreClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.RestoreClusterRequest) + RestoreClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RestoreClusterRequest.newBuilder() to construct. + private RestoreClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestoreClusterRequest() { + parent_ = ""; + clusterId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestoreClusterRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_RestoreClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_RestoreClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.RestoreClusterRequest.class, + com.google.cloud.alloydb.v1beta.RestoreClusterRequest.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BACKUP_SOURCE(4), + CONTINUOUS_BACKUP_SOURCE(8), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 4: + return BACKUP_SOURCE; + case 8: + return CONTINUOUS_BACKUP_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int BACKUP_SOURCE_FIELD_NUMBER = 4; + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + * + * @return Whether the backupSource field is set. + */ + @java.lang.Override + public boolean hasBackupSource() { + return sourceCase_ == 4; + } + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + * + * @return The backupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BackupSource getBackupSource() { + if (sourceCase_ == 4) { + return (com.google.cloud.alloydb.v1beta.BackupSource) source_; + } + return com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance(); + } + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BackupSourceOrBuilder getBackupSourceOrBuilder() { + if (sourceCase_ == 4) { + return (com.google.cloud.alloydb.v1beta.BackupSource) source_; + } + return com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance(); + } + + public static final int CONTINUOUS_BACKUP_SOURCE_FIELD_NUMBER = 8; + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + * + * @return Whether the continuousBackupSource field is set. + */ + @java.lang.Override + public boolean hasContinuousBackupSource() { + return sourceCase_ == 8; + } + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + * + * @return The continuousBackupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupSource getContinuousBackupSource() { + if (sourceCase_ == 8) { + return (com.google.cloud.alloydb.v1beta.ContinuousBackupSource) source_; + } + return com.google.cloud.alloydb.v1beta.ContinuousBackupSource.getDefaultInstance(); + } + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupSourceOrBuilder + getContinuousBackupSourceOrBuilder() { + if (sourceCase_ == 8) { + return (com.google.cloud.alloydb.v1beta.ContinuousBackupSource) source_; + } + return com.google.cloud.alloydb.v1beta.ContinuousBackupSource.getDefaultInstance(); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * 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 CLUSTER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + @java.lang.Override + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + 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(); + clusterId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1beta.Cluster cluster_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + @java.lang.Override + public boolean hasCluster() { + return cluster_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster getCluster() { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 6; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the import
+   * request.
+   * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clusterId_); + } + if (cluster_ != null) { + output.writeMessage(3, getCluster()); + } + if (sourceCase_ == 4) { + output.writeMessage(4, (com.google.cloud.alloydb.v1beta.BackupSource) source_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(6, validateOnly_); + } + if (sourceCase_ == 8) { + output.writeMessage(8, (com.google.cloud.alloydb.v1beta.ContinuousBackupSource) source_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clusterId_); + } + if (cluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCluster()); + } + if (sourceCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.alloydb.v1beta.BackupSource) source_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, validateOnly_); + } + if (sourceCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.alloydb.v1beta.ContinuousBackupSource) source_); + } + 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.alloydb.v1beta.RestoreClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.RestoreClusterRequest other = + (com.google.cloud.alloydb.v1beta.RestoreClusterRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getClusterId().equals(other.getClusterId())) return false; + if (hasCluster() != other.hasCluster()) return false; + if (hasCluster()) { + if (!getCluster().equals(other.getCluster())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 4: + if (!getBackupSource().equals(other.getBackupSource())) return false; + break; + case 8: + if (!getContinuousBackupSource().equals(other.getContinuousBackupSource())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getClusterId().hashCode(); + if (hasCluster()) { + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + switch (sourceCase_) { + case 4: + hash = (37 * hash) + BACKUP_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getBackupSource().hashCode(); + break; + case 8: + hash = (37 * hash) + CONTINUOUS_BACKUP_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getContinuousBackupSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.RestoreClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.RestoreClusterRequest 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.alloydb.v1beta.RestoreClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.RestoreClusterRequest 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.alloydb.v1beta.RestoreClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.RestoreClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.RestoreClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.RestoreClusterRequest 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.alloydb.v1beta.RestoreClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.RestoreClusterRequest 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.alloydb.v1beta.RestoreClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.RestoreClusterRequest 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.alloydb.v1beta.RestoreClusterRequest 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; + } + /** + * + * + *
+   * Message for restoring a Cluster from a backup or another cluster at a given
+   * point in time.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.RestoreClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.RestoreClusterRequest) + com.google.cloud.alloydb.v1beta.RestoreClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_RestoreClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_RestoreClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.RestoreClusterRequest.class, + com.google.cloud.alloydb.v1beta.RestoreClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.RestoreClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (backupSourceBuilder_ != null) { + backupSourceBuilder_.clear(); + } + if (continuousBackupSourceBuilder_ != null) { + continuousBackupSourceBuilder_.clear(); + } + parent_ = ""; + clusterId_ = ""; + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_RestoreClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.RestoreClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.RestoreClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.RestoreClusterRequest build() { + com.google.cloud.alloydb.v1beta.RestoreClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.RestoreClusterRequest buildPartial() { + com.google.cloud.alloydb.v1beta.RestoreClusterRequest result = + new com.google.cloud.alloydb.v1beta.RestoreClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.RestoreClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.clusterId_ = clusterId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + private void buildPartialOneofs(com.google.cloud.alloydb.v1beta.RestoreClusterRequest result) { + result.sourceCase_ = sourceCase_; + result.source_ = this.source_; + if (sourceCase_ == 4 && backupSourceBuilder_ != null) { + result.source_ = backupSourceBuilder_.build(); + } + if (sourceCase_ == 8 && continuousBackupSourceBuilder_ != null) { + result.source_ = continuousBackupSourceBuilder_.build(); + } + } + + @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.alloydb.v1beta.RestoreClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.RestoreClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.RestoreClusterRequest other) { + if (other == com.google.cloud.alloydb.v1beta.RestoreClusterRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getClusterId().isEmpty()) { + clusterId_ = other.clusterId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasCluster()) { + mergeCluster(other.getCluster()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + switch (other.getSourceCase()) { + case BACKUP_SOURCE: + { + mergeBackupSource(other.getBackupSource()); + break; + } + case CONTINUOUS_BACKUP_SOURCE: + { + mergeContinuousBackupSource(other.getContinuousBackupSource()); + break; + } + case SOURCE_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: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 18: + { + clusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 26: + { + input.readMessage(getClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 26 + case 34: + { + input.readMessage(getBackupSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 4; + break; + } // case 34 + case 42: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 48: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 48 + case 66: + { + input.readMessage( + getContinuousBackupSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 8; + break; + } // case 66 + 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 sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.BackupSource, + com.google.cloud.alloydb.v1beta.BackupSource.Builder, + com.google.cloud.alloydb.v1beta.BackupSourceOrBuilder> + backupSourceBuilder_; + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + * + * @return Whether the backupSource field is set. + */ + @java.lang.Override + public boolean hasBackupSource() { + return sourceCase_ == 4; + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + * + * @return The backupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BackupSource getBackupSource() { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 4) { + return (com.google.cloud.alloydb.v1beta.BackupSource) source_; + } + return com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance(); + } else { + if (sourceCase_ == 4) { + return backupSourceBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + */ + public Builder setBackupSource(com.google.cloud.alloydb.v1beta.BackupSource value) { + if (backupSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + backupSourceBuilder_.setMessage(value); + } + sourceCase_ = 4; + return this; + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + */ + public Builder setBackupSource( + com.google.cloud.alloydb.v1beta.BackupSource.Builder builderForValue) { + if (backupSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + backupSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 4; + return this; + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + */ + public Builder mergeBackupSource(com.google.cloud.alloydb.v1beta.BackupSource value) { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 4 + && source_ != com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance()) { + source_ = + com.google.cloud.alloydb.v1beta.BackupSource.newBuilder( + (com.google.cloud.alloydb.v1beta.BackupSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 4) { + backupSourceBuilder_.mergeFrom(value); + } else { + backupSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 4; + return this; + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + */ + public Builder clearBackupSource() { + if (backupSourceBuilder_ == null) { + if (sourceCase_ == 4) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 4) { + sourceCase_ = 0; + source_ = null; + } + backupSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + */ + public com.google.cloud.alloydb.v1beta.BackupSource.Builder getBackupSourceBuilder() { + return getBackupSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BackupSourceOrBuilder getBackupSourceOrBuilder() { + if ((sourceCase_ == 4) && (backupSourceBuilder_ != null)) { + return backupSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 4) { + return (com.google.cloud.alloydb.v1beta.BackupSource) source_; + } + return com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Backup source.
+     * 
+ * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.BackupSource, + com.google.cloud.alloydb.v1beta.BackupSource.Builder, + com.google.cloud.alloydb.v1beta.BackupSourceOrBuilder> + getBackupSourceFieldBuilder() { + if (backupSourceBuilder_ == null) { + if (!(sourceCase_ == 4)) { + source_ = com.google.cloud.alloydb.v1beta.BackupSource.getDefaultInstance(); + } + backupSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.BackupSource, + com.google.cloud.alloydb.v1beta.BackupSource.Builder, + com.google.cloud.alloydb.v1beta.BackupSourceOrBuilder>( + (com.google.cloud.alloydb.v1beta.BackupSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 4; + onChanged(); + return backupSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.ContinuousBackupSource, + com.google.cloud.alloydb.v1beta.ContinuousBackupSource.Builder, + com.google.cloud.alloydb.v1beta.ContinuousBackupSourceOrBuilder> + continuousBackupSourceBuilder_; + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + * + * + * @return Whether the continuousBackupSource field is set. + */ + @java.lang.Override + public boolean hasContinuousBackupSource() { + return sourceCase_ == 8; + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + * + * + * @return The continuousBackupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupSource getContinuousBackupSource() { + if (continuousBackupSourceBuilder_ == null) { + if (sourceCase_ == 8) { + return (com.google.cloud.alloydb.v1beta.ContinuousBackupSource) source_; + } + return com.google.cloud.alloydb.v1beta.ContinuousBackupSource.getDefaultInstance(); + } else { + if (sourceCase_ == 8) { + return continuousBackupSourceBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1beta.ContinuousBackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + * + */ + public Builder setContinuousBackupSource( + com.google.cloud.alloydb.v1beta.ContinuousBackupSource value) { + if (continuousBackupSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + continuousBackupSourceBuilder_.setMessage(value); + } + sourceCase_ = 8; + return this; + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + * + */ + public Builder setContinuousBackupSource( + com.google.cloud.alloydb.v1beta.ContinuousBackupSource.Builder builderForValue) { + if (continuousBackupSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + continuousBackupSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 8; + return this; + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + * + */ + public Builder mergeContinuousBackupSource( + com.google.cloud.alloydb.v1beta.ContinuousBackupSource value) { + if (continuousBackupSourceBuilder_ == null) { + if (sourceCase_ == 8 + && source_ + != com.google.cloud.alloydb.v1beta.ContinuousBackupSource.getDefaultInstance()) { + source_ = + com.google.cloud.alloydb.v1beta.ContinuousBackupSource.newBuilder( + (com.google.cloud.alloydb.v1beta.ContinuousBackupSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 8) { + continuousBackupSourceBuilder_.mergeFrom(value); + } else { + continuousBackupSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 8; + return this; + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + * + */ + public Builder clearContinuousBackupSource() { + if (continuousBackupSourceBuilder_ == null) { + if (sourceCase_ == 8) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 8) { + sourceCase_ = 0; + source_ = null; + } + continuousBackupSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + * + */ + public com.google.cloud.alloydb.v1beta.ContinuousBackupSource.Builder + getContinuousBackupSourceBuilder() { + return getContinuousBackupSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ContinuousBackupSourceOrBuilder + getContinuousBackupSourceOrBuilder() { + if ((sourceCase_ == 8) && (continuousBackupSourceBuilder_ != null)) { + return continuousBackupSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 8) { + return (com.google.cloud.alloydb.v1beta.ContinuousBackupSource) source_; + } + return com.google.cloud.alloydb.v1beta.ContinuousBackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.ContinuousBackupSource, + com.google.cloud.alloydb.v1beta.ContinuousBackupSource.Builder, + com.google.cloud.alloydb.v1beta.ContinuousBackupSourceOrBuilder> + getContinuousBackupSourceFieldBuilder() { + if (continuousBackupSourceBuilder_ == null) { + if (!(sourceCase_ == 8)) { + source_ = com.google.cloud.alloydb.v1beta.ContinuousBackupSource.getDefaultInstance(); + } + continuousBackupSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.ContinuousBackupSource, + com.google.cloud.alloydb.v1beta.ContinuousBackupSource.Builder, + com.google.cloud.alloydb.v1beta.ContinuousBackupSourceOrBuilder>( + (com.google.cloud.alloydb.v1beta.ContinuousBackupSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 8; + onChanged(); + return continuousBackupSourceBuilder_; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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 parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Cluster.name field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object clusterId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearClusterId() { + clusterId_ = getDefaultInstance().getClusterId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1beta.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster, + com.google.cloud.alloydb.v1beta.Cluster.Builder, + com.google.cloud.alloydb.v1beta.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.alloydb.v1beta.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1beta.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1beta.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.alloydb.v1beta.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCluster() { + bitField0_ = (bitField0_ & ~0x00000010); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster, + com.google.cloud.alloydb.v1beta.Cluster.Builder, + com.google.cloud.alloydb.v1beta.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster, + com.google.cloud.alloydb.v1beta.Cluster.Builder, + com.google.cloud.alloydb.v1beta.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the import
+     * request.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the import
+     * request.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the import
+     * request.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000040); + validateOnly_ = 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.alloydb.v1beta.RestoreClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.RestoreClusterRequest) + private static final com.google.cloud.alloydb.v1beta.RestoreClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.RestoreClusterRequest(); + } + + public static com.google.cloud.alloydb.v1beta.RestoreClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestoreClusterRequest 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.alloydb.v1beta.RestoreClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/RestoreClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/RestoreClusterRequestOrBuilder.java new file mode 100644 index 000000000000..9c2f6fbdea24 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/RestoreClusterRequestOrBuilder.java @@ -0,0 +1,258 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface RestoreClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.RestoreClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + * + * @return Whether the backupSource field is set. + */ + boolean hasBackupSource(); + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + * + * @return The backupSource. + */ + com.google.cloud.alloydb.v1beta.BackupSource getBackupSource(); + /** + * + * + *
+   * Backup source.
+   * 
+ * + * .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + */ + com.google.cloud.alloydb.v1beta.BackupSourceOrBuilder getBackupSourceOrBuilder(); + + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + * + * @return Whether the continuousBackupSource field is set. + */ + boolean hasContinuousBackupSource(); + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + * + * @return The continuousBackupSource. + */ + com.google.cloud.alloydb.v1beta.ContinuousBackupSource getContinuousBackupSource(); + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + */ + com.google.cloud.alloydb.v1beta.ContinuousBackupSourceOrBuilder + getContinuousBackupSourceOrBuilder(); + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.alloydb.v1beta.Cluster getCluster(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1beta.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the import
+   * request.
+   * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + public com.google.cloud.alloydb.v1beta.RestoreClusterRequest.SourceCase getSourceCase(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ServiceProto.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ServiceProto.java new file mode 100644 index 000000000000..cbf8a1d68f37 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ServiceProto.java @@ -0,0 +1,844 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public final class ServiceProto { + private ServiceProto() {} + + 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_alloydb_v1beta_ListClustersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_ListClustersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_ListClustersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_ListClustersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_GetClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_GetClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_CreateSecondaryClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_CreateSecondaryClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_CreateClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_CreateClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_UpdateClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_UpdateClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_DeleteClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_DeleteClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_PromoteClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_PromoteClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_RestoreClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_RestoreClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_ListInstancesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_ListInstancesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_ListInstancesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_ListInstancesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_GetInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_GetInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_CreateSecondaryInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_CreateSecondaryInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequests_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequests_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_InstanceStatusesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_InstanceStatusesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstanceStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstanceStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_UpdateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_UpdateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_DeleteInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_DeleteInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_FailoverInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_FailoverInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_RestartInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_RestartInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_ListBackupsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_ListBackupsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_ListBackupsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_ListBackupsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_GetBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_GetBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_CreateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_CreateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_UpdateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_UpdateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_DeleteBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_DeleteBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_GetConnectionInfoRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_GetConnectionInfoRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_OperationMetadata_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/alloydb/v1beta/service.pr" + + "oto\022\033google.cloud.alloydb.v1beta\032\034google" + + "/api/annotations.proto\032\027google/api/clien" + + "t.proto\032\037google/api/field_behavior.proto" + + "\032\031google/api/resource.proto\032+google/clou" + + "d/alloydb/v1beta/resources.proto\032#google" + + "/longrunning/operations.proto\032\036google/pr" + + "otobuf/duration.proto\032\033google/protobuf/e" + + "mpty.proto\032 google/protobuf/field_mask.p" + + "roto\032\037google/protobuf/timestamp.proto\032\027g" + + "oogle/rpc/status.proto\"\245\001\n\023ListClustersR" + + "equest\0226\n\006parent\030\001 \001(\tB&\340A\002\372A \022\036alloydb." + + "googleapis.com/Cluster\022\026\n\tpage_size\030\002 \001(" + + "\005B\003\340A\001\022\022\n\npage_token\030\003 \001(\t\022\023\n\006filter\030\004 \001" + + "(\tB\003\340A\001\022\025\n\010order_by\030\005 \001(\tB\003\340A\001\"|\n\024ListCl" + + "ustersResponse\0226\n\010clusters\030\001 \003(\0132$.googl" + + "e.cloud.alloydb.v1beta.Cluster\022\027\n\017next_p" + + "age_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"I\n\021" + + "GetClusterRequest\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n" + + "\036alloydb.googleapis.com/Cluster\"\341\001\n\035Crea" + + "teSecondaryClusterRequest\0226\n\006parent\030\001 \001(" + + "\tB&\340A\002\372A \022\036alloydb.googleapis.com/Cluste" + + "r\022\027\n\ncluster_id\030\002 \001(\tB\003\340A\002\022:\n\007cluster\030\003 " + + "\001(\0132$.google.cloud.alloydb.v1beta.Cluste" + + "rB\003\340A\002\022\027\n\nrequest_id\030\005 \001(\tB\003\340A\001\022\032\n\rvalid" + + "ate_only\030\006 \001(\010B\003\340A\001\"\330\001\n\024CreateClusterReq" + + "uest\0226\n\006parent\030\001 \001(\tB&\340A\002\372A \022\036alloydb.go" + + "ogleapis.com/Cluster\022\027\n\ncluster_id\030\002 \001(\t" + + "B\003\340A\002\022:\n\007cluster\030\003 \001(\0132$.google.cloud.al" + + "loydb.v1beta.ClusterB\003\340A\002\022\027\n\nrequest_id\030" + + "\004 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\005 \001(\010B\003\340A\001\"\331" + + "\001\n\024UpdateClusterRequest\0224\n\013update_mask\030\001" + + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\022:\n" + + "\007cluster\030\002 \001(\0132$.google.cloud.alloydb.v1" + + "beta.ClusterB\003\340A\002\022\027\n\nrequest_id\030\003 \001(\tB\003\340" + + "A\001\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\001\022\032\n\rallow_" + + "missing\030\005 \001(\010B\003\340A\001\"\250\001\n\024DeleteClusterRequ" + + "est\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n\036alloydb.googl" + + "eapis.com/Cluster\022\027\n\nrequest_id\030\002 \001(\tB\003\340" + + "A\001\022\021\n\004etag\030\003 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\004" + + " \001(\010B\003\340A\001\022\022\n\005force\030\005 \001(\010B\003\340A\001\"\225\001\n\025Promot" + + "eClusterRequest\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n\036a" + + "lloydb.googleapis.com/Cluster\022\027\n\nrequest" + + "_id\030\002 \001(\tB\003\340A\001\022\021\n\004etag\030\003 \001(\tB\003\340A\001\022\032\n\rval" + + "idate_only\030\004 \001(\010B\003\340A\001\"\200\003\n\025RestoreCluster" + + "Request\022B\n\rbackup_source\030\004 \001(\0132).google." + + "cloud.alloydb.v1beta.BackupSourceH\000\022W\n\030c" + + "ontinuous_backup_source\030\010 \001(\01323.google.c" + + "loud.alloydb.v1beta.ContinuousBackupSour" + + "ceH\000\0226\n\006parent\030\001 \001(\tB&\340A\002\372A \022\036alloydb.go" + + "ogleapis.com/Cluster\022\027\n\ncluster_id\030\002 \001(\t" + + "B\003\340A\002\022:\n\007cluster\030\003 \001(\0132$.google.cloud.al" + + "loydb.v1beta.ClusterB\003\340A\002\022\027\n\nrequest_id\030" + + "\005 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\006 \001(\010B\003\340A\001B\010" + + "\n\006source\"\247\001\n\024ListInstancesRequest\0227\n\006par" + + "ent\030\001 \001(\tB\'\340A\002\372A!\022\037alloydb.googleapis.co" + + "m/Instance\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\022\n\npa" + + "ge_token\030\003 \001(\t\022\023\n\006filter\030\004 \001(\tB\003\340A\001\022\025\n\010o" + + "rder_by\030\005 \001(\tB\003\340A\001\"\177\n\025ListInstancesRespo" + + "nse\0228\n\tinstances\030\001 \003(\0132%.google.cloud.al" + + "loydb.v1beta.Instance\022\027\n\017next_page_token" + + "\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\204\001\n\022GetInsta" + + "nceRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037alloyd" + + "b.googleapis.com/Instance\0227\n\004view\030\002 \001(\0162" + + ").google.cloud.alloydb.v1beta.InstanceVi" + + "ew\"\335\001\n\025CreateInstanceRequest\0227\n\006parent\030\001" + + " \001(\tB\'\340A\002\372A!\022\037alloydb.googleapis.com/Ins" + + "tance\022\030\n\013instance_id\030\002 \001(\tB\003\340A\002\022<\n\010insta" + + "nce\030\003 \001(\0132%.google.cloud.alloydb.v1beta." + + "InstanceB\003\340A\002\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\022\032" + + "\n\rvalidate_only\030\005 \001(\010B\003\340A\001\"\346\001\n\036CreateSec" + + "ondaryInstanceRequest\0227\n\006parent\030\001 \001(\tB\'\340" + + "A\002\372A!\022\037alloydb.googleapis.com/Instance\022\030" + + "\n\013instance_id\030\002 \001(\tB\003\340A\002\022<\n\010instance\030\003 \001" + + "(\0132%.google.cloud.alloydb.v1beta.Instanc" + + "eB\003\340A\002\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\022\032\n\rvalid" + + "ate_only\030\005 \001(\010B\003\340A\001\"s\n\026CreateInstanceReq" + + "uests\022Y\n\030create_instance_requests\030\001 \003(\0132" + + "2.google.cloud.alloydb.v1beta.CreateInst" + + "anceRequestB\003\340A\002\"\273\001\n\033BatchCreateInstance" + + "sRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037alloyd" + + "b.googleapis.com/Instance\022J\n\010requests\030\002 " + + "\001(\01323.google.cloud.alloydb.v1beta.Create" + + "InstanceRequestsB\003\340A\002\022\027\n\nrequest_id\030\003 \001(" + + "\tB\003\340A\001\"X\n\034BatchCreateInstancesResponse\0228" + + "\n\tinstances\030\001 \003(\0132%.google.cloud.alloydb" + + ".v1beta.Instance\"\225\002\n\034BatchCreateInstance" + + "sMetadata\022\030\n\020instance_targets\030\001 \003(\t\022j\n\021i" + + "nstance_statuses\030\002 \003(\0132O.google.cloud.al" + + "loydb.v1beta.BatchCreateInstancesMetadat" + + "a.InstanceStatusesEntry\032o\n\025InstanceStatu" + + "sesEntry\022\013\n\003key\030\001 \001(\t\022E\n\005value\030\002 \001(\01326.g" + + "oogle.cloud.alloydb.v1beta.BatchCreateIn" + + "stanceStatus:\0028\001\"\330\002\n\031BatchCreateInstance" + + "Status\022K\n\005state\030\001 \001(\0162<.google.cloud.all" + + "oydb.v1beta.BatchCreateInstanceStatus.St" + + "ate\022\021\n\terror_msg\030\002 \001(\t\022!\n\005error\030\004 \001(\0132\022." + + "google.rpc.Status\022@\n\004type\030\003 \001(\01622.google" + + ".cloud.alloydb.v1beta.Instance.InstanceT" + + "ype\"v\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\022\n\016P" + + "ENDING_CREATE\020\001\022\t\n\005READY\020\002\022\014\n\010CREATING\020\003" + + "\022\014\n\010DELETING\020\004\022\n\n\006FAILED\020\005\022\017\n\013ROLLED_BAC" + + "K\020\006\"\334\001\n\025UpdateInstanceRequest\0224\n\013update_" + + "mask\030\001 \001(\0132\032.google.protobuf.FieldMaskB\003" + + "\340A\001\022<\n\010instance\030\002 \001(\0132%.google.cloud.all" + + "oydb.v1beta.InstanceB\003\340A\002\022\027\n\nrequest_id\030" + + "\003 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\001\022\032" + + "\n\rallow_missing\030\005 \001(\010B\003\340A\001\"\226\001\n\025DeleteIns" + + "tanceRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037allo" + + "ydb.googleapis.com/Instance\022\027\n\nrequest_i" + + "d\030\002 \001(\tB\003\340A\001\022\021\n\004etag\030\003 \001(\tB\003\340A\001\022\032\n\rvalid" + + "ate_only\030\004 \001(\010B\003\340A\001\"\205\001\n\027FailoverInstance" + + "Request\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037alloydb.g" + + "oogleapis.com/Instance\022\027\n\nrequest_id\030\002 \001" + + "(\tB\003\340A\001\022\032\n\rvalidate_only\030\003 \001(\010B\003\340A\001\"\204\001\n\026" + + "RestartInstanceRequest\0225\n\004name\030\001 \001(\tB\'\340A" + + "\002\372A!\n\037alloydb.googleapis.com/Instance\022\027\n" + + "\nrequest_id\030\002 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030" + + "\003 \001(\010B\003\340A\001\"\224\001\n\022ListBackupsRequest\0225\n\006par" + + "ent\030\001 \001(\tB%\340A\002\372A\037\022\035alloydb.googleapis.co" + + "m/Backup\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_toke" + + "n\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\022\020\n\010order_by\030\005 \001(" + + "\t\"y\n\023ListBackupsResponse\0224\n\007backups\030\001 \003(" + + "\0132#.google.cloud.alloydb.v1beta.Backup\022\027" + + "\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003" + + " \003(\t\"G\n\020GetBackupRequest\0223\n\004name\030\001 \001(\tB%" + + "\340A\002\372A\037\n\035alloydb.googleapis.com/Backup\"\323\001" + + "\n\023CreateBackupRequest\0225\n\006parent\030\001 \001(\tB%\340" + + "A\002\372A\037\022\035alloydb.googleapis.com/Backup\022\026\n\t" + + "backup_id\030\002 \001(\tB\003\340A\002\0228\n\006backup\030\003 \001(\0132#.g" + + "oogle.cloud.alloydb.v1beta.BackupB\003\340A\002\022\027" + + "\n\nrequest_id\030\004 \001(\tB\003\340A\001\022\032\n\rvalidate_only" + + "\030\005 \001(\010B\003\340A\001\"\326\001\n\023UpdateBackupRequest\0224\n\013u" + + "pdate_mask\030\001 \001(\0132\032.google.protobuf.Field" + + "MaskB\003\340A\001\0228\n\006backup\030\002 \001(\0132#.google.cloud" + + ".alloydb.v1beta.BackupB\003\340A\002\022\027\n\nrequest_i" + + "d\030\003 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\001" + + "\022\032\n\rallow_missing\030\005 \001(\010B\003\340A\001\"\222\001\n\023DeleteB" + + "ackupRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035allo" + + "ydb.googleapis.com/Backup\022\027\n\nrequest_id\030" + + "\002 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\003 \001(\010B\003\340A\001\022\021" + + "\n\004etag\030\004 \001(\tB\003\340A\001\"\220\001\n!ListSupportedDatab" + + "aseFlagsRequest\022D\n\006parent\030\001 \001(\tB4\340A\002\372A.\022" + + ",alloydb.googleapis.com/SupportedDatabas" + + "eFlag\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003" + + " \001(\t\"\223\001\n\"ListSupportedDatabaseFlagsRespo" + + "nse\022T\n\030supported_database_flags\030\001 \003(\01322." + + "google.cloud.alloydb.v1beta.SupportedDat" + + "abaseFlag\022\027\n\017next_page_token\030\002 \001(\t\"\300\001\n G" + + "enerateClientCertificateRequest\0226\n\006paren" + + "t\030\001 \001(\tB&\340A\002\372A \n\036alloydb.googleapis.com/" + + "Cluster\022\027\n\nrequest_id\030\002 \001(\tB\003\340A\001\022\024\n\007pem_" + + "csr\030\003 \001(\tB\003\340A\001\0225\n\rcert_duration\030\004 \001(\0132\031." + + "google.protobuf.DurationB\003\340A\001\"e\n!Generat" + + "eClientCertificateResponse\022\034\n\017pem_certif" + + "icate\030\001 \001(\tB\003\340A\003\022\"\n\025pem_certificate_chai" + + "n\030\002 \003(\tB\003\340A\003\"l\n\030GetConnectionInfoRequest" + + "\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037alloydb.google" + + "apis.com/Instance\022\027\n\nrequest_id\030\002 \001(\tB\003\340" + + "A\001\"\377\002\n\021OperationMetadata\022i\n\037batch_create" + + "_instances_metadata\030\010 \001(\01329.google.cloud" + + ".alloydb.v1beta.BatchCreateInstancesMeta" + + "dataB\003\340A\003H\000\0224\n\013create_time\030\001 \001(\0132\032.googl" + + "e.protobuf.TimestampB\003\340A\003\0221\n\010end_time\030\002 " + + "\001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\023\n\006" + + "target\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\033\n\016" + + "status_message\030\005 \001(\tB\003\340A\003\022#\n\026requested_c" + + "ancellation\030\006 \001(\010B\003\340A\003\022\030\n\013api_version\030\007 " + + "\001(\tB\003\340A\003B\022\n\020request_specific2\277+\n\014AlloyDB" + + "Admin\022\266\001\n\014ListClusters\0220.google.cloud.al" + + "loydb.v1beta.ListClustersRequest\0321.googl" + + "e.cloud.alloydb.v1beta.ListClustersRespo" + + "nse\"A\202\323\344\223\0022\0220/v1beta/{parent=projects/*/" + + "locations/*}/clusters\332A\006parent\022\243\001\n\nGetCl" + + "uster\022..google.cloud.alloydb.v1beta.GetC" + + "lusterRequest\032$.google.cloud.alloydb.v1b" + + "eta.Cluster\"?\202\323\344\223\0022\0220/v1beta/{name=proje" + + "cts/*/locations/*/clusters/*}\332A\004name\022\337\001\n" + + "\rCreateCluster\0221.google.cloud.alloydb.v1" + + "beta.CreateClusterRequest\032\035.google.longr" + + "unning.Operation\"|\202\323\344\223\002;\"0/v1beta/{paren" + + "t=projects/*/locations/*}/clusters:\007clus" + + "ter\332A\031parent,cluster,cluster_id\312A\034\n\007Clus" + + "ter\022\021OperationMetadata\022\341\001\n\rUpdateCluster" + + "\0221.google.cloud.alloydb.v1beta.UpdateClu" + + "sterRequest\032\035.google.longrunning.Operati" + + "on\"~\202\323\344\223\002C28/v1beta/{cluster.name=projec" + + "ts/*/locations/*/clusters/*}:\007cluster\332A\023" + + "cluster,update_mask\312A\034\n\007Cluster\022\021Operati" + + "onMetadata\022\317\001\n\rDeleteCluster\0221.google.cl" + + "oud.alloydb.v1beta.DeleteClusterRequest\032" + + "\035.google.longrunning.Operation\"l\202\323\344\223\0022*0" + + "/v1beta/{name=projects/*/locations/*/clu" + + "sters/*}\332A\004name\312A*\n\025google.protobuf.Empt" + + "y\022\021OperationMetadata\022\316\001\n\016PromoteCluster\022" + + "2.google.cloud.alloydb.v1beta.PromoteClu" + + "sterRequest\032\035.google.longrunning.Operati" + + "on\"i\202\323\344\223\002=\"8/v1beta/{name=projects/*/loc" + + "ations/*/clusters/*}:promote:\001*\332A\004name\312A" + + "\034\n\007Cluster\022\021OperationMetadata\022\307\001\n\016Restor" + + "eCluster\0222.google.cloud.alloydb.v1beta.R" + + "estoreClusterRequest\032\035.google.longrunnin" + + "g.Operation\"b\202\323\344\223\002=\"8/v1beta/{parent=pro" + + "jects/*/locations/*}/clusters:restore:\001*" + + "\312A\034\n\007Cluster\022\021OperationMetadata\022\202\002\n\026Crea" + + "teSecondaryCluster\022:.google.cloud.alloyd" + + "b.v1beta.CreateSecondaryClusterRequest\032\035" + + ".google.longrunning.Operation\"\214\001\202\323\344\223\002K\"@" + + "/v1beta/{parent=projects/*/locations/*}/" + + "clusters:createsecondary:\007cluster\332A\031pare" + + "nt,cluster,cluster_id\312A\034\n\007Cluster\022\021Opera" + + "tionMetadata\022\305\001\n\rListInstances\0221.google." + + "cloud.alloydb.v1beta.ListInstancesReques" + + "t\0322.google.cloud.alloydb.v1beta.ListInst" + + "ancesResponse\"M\202\323\344\223\002>\022\022*\202\323\344\223\0021\022//v1beta/{name" + + "=projects/*/locations/*/backups/*}\332A\004nam" + + "e\022\330\001\n\014CreateBackup\0220.google.cloud.alloyd" + + "b.v1beta.CreateBackupRequest\032\035.google.lo" + + "ngrunning.Operation\"w\202\323\344\223\0029\"//v1beta/{pa" + + "rent=projects/*/locations/*}/backups:\006ba" + + "ckup\332A\027parent,backup,backup_id\312A\033\n\006Backu" + + "p\022\021OperationMetadata\022\332\001\n\014UpdateBackup\0220." + + "google.cloud.alloydb.v1beta.UpdateBackup" + + "Request\032\035.google.longrunning.Operation\"y" + + "\202\323\344\223\002@26/v1beta/{backup.name=projects/*/" + + "locations/*/backups/*}:\006backup\332A\022backup," + + "update_mask\312A\033\n\006Backup\022\021OperationMetadat" + + "a\022\314\001\n\014DeleteBackup\0220.google.cloud.alloyd" + + "b.v1beta.DeleteBackupRequest\032\035.google.lo" + + "ngrunning.Operation\"k\202\323\344\223\0021*//v1beta/{na" + + "me=projects/*/locations/*/backups/*}\332A\004n" + + "ame\312A*\n\025google.protobuf.Empty\022\021Operation" + + "Metadata\022\356\001\n\032ListSupportedDatabaseFlags\022" + + ">.google.cloud.alloydb.v1beta.ListSuppor" + + "tedDatabaseFlagsRequest\032?.google.cloud.a" + + "lloydb.v1beta.ListSupportedDatabaseFlags" + + "Response\"O\202\323\344\223\002@\022>/v1beta/{parent=projec" + + "ts/*/locations/*}/supportedDatabaseFlags" + + "\332A\006parent\022\374\001\n\031GenerateClientCertificate\022" + + "=.google.cloud.alloydb.v1beta.GenerateCl" + + "ientCertificateRequest\032>.google.cloud.al" + + "loydb.v1beta.GenerateClientCertificateRe" + + "sponse\"`\202\323\344\223\002Q\"L/v1beta/{parent=projects" + + "/*/locations/*/clusters/*}:generateClien" + + "tCertificate:\001*\332A\006parent\022\327\001\n\021GetConnecti" + + "onInfo\0225.google.cloud.alloydb.v1beta.Get" + + "ConnectionInfoRequest\032+.google.cloud.all" + + "oydb.v1beta.ConnectionInfo\"^\202\323\344\223\002O\022M/v1b" + + "eta/{parent=projects/*/locations/*/clust" + + "ers/*/instances/*}/connectionInfo\332A\006pare" + + "nt\032J\312A\026alloydb.googleapis.com\322A.https://" + + "www.googleapis.com/auth/cloud-platformB\311" + + "\001\n\037com.google.cloud.alloydb.v1betaB\014Serv" + + "iceProtoP\001Z9cloud.google.com/go/alloydb/" + + "apiv1beta/alloydbpb;alloydbpb\252\002\033Google.C" + + "loud.AlloyDb.V1Beta\312\002\033Google\\Cloud\\Alloy" + + "Db\\V1beta\352\002\036Google::Cloud::AlloyDb::V1be" + + "tab\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.alloydb.v1beta.ResourcesProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_cloud_alloydb_v1beta_ListClustersRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_alloydb_v1beta_ListClustersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_ListClustersRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_alloydb_v1beta_ListClustersResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_alloydb_v1beta_ListClustersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_ListClustersResponse_descriptor, + new java.lang.String[] { + "Clusters", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_alloydb_v1beta_GetClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_alloydb_v1beta_GetClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_GetClusterRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_alloydb_v1beta_CreateSecondaryClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_alloydb_v1beta_CreateSecondaryClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_CreateSecondaryClusterRequest_descriptor, + new java.lang.String[] { + "Parent", "ClusterId", "Cluster", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1beta_CreateClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_alloydb_v1beta_CreateClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_CreateClusterRequest_descriptor, + new java.lang.String[] { + "Parent", "ClusterId", "Cluster", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1beta_UpdateClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_alloydb_v1beta_UpdateClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_UpdateClusterRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Cluster", "RequestId", "ValidateOnly", "AllowMissing", + }); + internal_static_google_cloud_alloydb_v1beta_DeleteClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_alloydb_v1beta_DeleteClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_DeleteClusterRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "Etag", "ValidateOnly", "Force", + }); + internal_static_google_cloud_alloydb_v1beta_PromoteClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_alloydb_v1beta_PromoteClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_PromoteClusterRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "Etag", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1beta_RestoreClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_alloydb_v1beta_RestoreClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_RestoreClusterRequest_descriptor, + new java.lang.String[] { + "BackupSource", + "ContinuousBackupSource", + "Parent", + "ClusterId", + "Cluster", + "RequestId", + "ValidateOnly", + "Source", + }); + internal_static_google_cloud_alloydb_v1beta_ListInstancesRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_alloydb_v1beta_ListInstancesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_ListInstancesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_alloydb_v1beta_ListInstancesResponse_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_alloydb_v1beta_ListInstancesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_ListInstancesResponse_descriptor, + new java.lang.String[] { + "Instances", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_alloydb_v1beta_GetInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_alloydb_v1beta_GetInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_GetInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "View", + }); + internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequest_descriptor, + new java.lang.String[] { + "Parent", "InstanceId", "Instance", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1beta_CreateSecondaryInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_alloydb_v1beta_CreateSecondaryInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_CreateSecondaryInstanceRequest_descriptor, + new java.lang.String[] { + "Parent", "InstanceId", "Instance", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequests_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequests_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_CreateInstanceRequests_descriptor, + new java.lang.String[] { + "CreateInstanceRequests", + }); + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesRequest_descriptor, + new java.lang.String[] { + "Parent", "Requests", "RequestId", + }); + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesResponse_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesResponse_descriptor, + new java.lang.String[] { + "Instances", + }); + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_descriptor, + new java.lang.String[] { + "InstanceTargets", "InstanceStatuses", + }); + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_InstanceStatusesEntry_descriptor = + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_InstanceStatusesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstancesMetadata_InstanceStatusesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstanceStatus_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstanceStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_BatchCreateInstanceStatus_descriptor, + new java.lang.String[] { + "State", "ErrorMsg", "Error", "Type", + }); + internal_static_google_cloud_alloydb_v1beta_UpdateInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_alloydb_v1beta_UpdateInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_UpdateInstanceRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Instance", "RequestId", "ValidateOnly", "AllowMissing", + }); + internal_static_google_cloud_alloydb_v1beta_DeleteInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_alloydb_v1beta_DeleteInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_DeleteInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "Etag", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1beta_FailoverInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_alloydb_v1beta_FailoverInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_FailoverInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1beta_RestartInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_alloydb_v1beta_RestartInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_RestartInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1beta_ListBackupsRequest_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_alloydb_v1beta_ListBackupsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_ListBackupsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_alloydb_v1beta_ListBackupsResponse_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_alloydb_v1beta_ListBackupsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_ListBackupsResponse_descriptor, + new java.lang.String[] { + "Backups", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_alloydb_v1beta_GetBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_alloydb_v1beta_GetBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_GetBackupRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_alloydb_v1beta_CreateBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_alloydb_v1beta_CreateBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_CreateBackupRequest_descriptor, + new java.lang.String[] { + "Parent", "BackupId", "Backup", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1beta_UpdateBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_google_cloud_alloydb_v1beta_UpdateBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_UpdateBackupRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Backup", "RequestId", "ValidateOnly", "AllowMissing", + }); + internal_static_google_cloud_alloydb_v1beta_DeleteBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_google_cloud_alloydb_v1beta_DeleteBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_DeleteBackupRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "ValidateOnly", "Etag", + }); + internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsRequest_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsResponse_descriptor = + getDescriptor().getMessageTypes().get(30); + internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsResponse_descriptor, + new java.lang.String[] { + "SupportedDatabaseFlags", "NextPageToken", + }); + internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateRequest_descriptor = + getDescriptor().getMessageTypes().get(31); + internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateRequest_descriptor, + new java.lang.String[] { + "Parent", "RequestId", "PemCsr", "CertDuration", + }); + internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateResponse_descriptor = + getDescriptor().getMessageTypes().get(32); + internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateResponse_descriptor, + new java.lang.String[] { + "PemCertificate", "PemCertificateChain", + }); + internal_static_google_cloud_alloydb_v1beta_GetConnectionInfoRequest_descriptor = + getDescriptor().getMessageTypes().get(33); + internal_static_google_cloud_alloydb_v1beta_GetConnectionInfoRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_GetConnectionInfoRequest_descriptor, + new java.lang.String[] { + "Parent", "RequestId", + }); + internal_static_google_cloud_alloydb_v1beta_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(34); + internal_static_google_cloud_alloydb_v1beta_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_OperationMetadata_descriptor, + new java.lang.String[] { + "BatchCreateInstancesMetadata", + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + "RequestSpecific", + }); + 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); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + 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.alloydb.v1beta.ResourcesProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SslConfig.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SslConfig.java new file mode 100644 index 000000000000..ba52652bce92 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SslConfig.java @@ -0,0 +1,1111 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * SSL configuration for an AlloyDB Cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.SslConfig} + */ +public final class SslConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.SslConfig) + SslConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use SslConfig.newBuilder() to construct. + private SslConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SslConfig() { + sslMode_ = 0; + caSource_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SslConfig(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SslConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SslConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.SslConfig.class, + com.google.cloud.alloydb.v1beta.SslConfig.Builder.class); + } + + /** + * + * + *
+   * SSL mode options.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.SslConfig.SslMode} + */ + public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * SSL mode not specified. Defaults to SSL_MODE_ALLOW.
+     * 
+ * + * SSL_MODE_UNSPECIFIED = 0; + */ + SSL_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * SSL connections are optional. CA verification not enforced.
+     * 
+ * + * SSL_MODE_ALLOW = 1; + */ + SSL_MODE_ALLOW(1), + /** + * + * + *
+     * SSL connections are required. CA verification not enforced.
+     * Clients may use locally self-signed certificates (default psql client
+     * behavior).
+     * 
+ * + * SSL_MODE_REQUIRE = 2; + */ + SSL_MODE_REQUIRE(2), + /** + * + * + *
+     * SSL connections are required. CA verification enforced.
+     * Clients must have certificates signed by a Cluster CA, e.g. via
+     * GenerateClientCertificate.
+     * 
+ * + * SSL_MODE_VERIFY_CA = 3; + */ + SSL_MODE_VERIFY_CA(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * SSL mode not specified. Defaults to SSL_MODE_ALLOW.
+     * 
+ * + * SSL_MODE_UNSPECIFIED = 0; + */ + public static final int SSL_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * SSL connections are optional. CA verification not enforced.
+     * 
+ * + * SSL_MODE_ALLOW = 1; + */ + public static final int SSL_MODE_ALLOW_VALUE = 1; + /** + * + * + *
+     * SSL connections are required. CA verification not enforced.
+     * Clients may use locally self-signed certificates (default psql client
+     * behavior).
+     * 
+ * + * SSL_MODE_REQUIRE = 2; + */ + public static final int SSL_MODE_REQUIRE_VALUE = 2; + /** + * + * + *
+     * SSL connections are required. CA verification enforced.
+     * Clients must have certificates signed by a Cluster CA, e.g. via
+     * GenerateClientCertificate.
+     * 
+ * + * SSL_MODE_VERIFY_CA = 3; + */ + public static final int SSL_MODE_VERIFY_CA_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 SslMode 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 SslMode forNumber(int value) { + switch (value) { + case 0: + return SSL_MODE_UNSPECIFIED; + case 1: + return SSL_MODE_ALLOW; + case 2: + return SSL_MODE_REQUIRE; + case 3: + return SSL_MODE_VERIFY_CA; + 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 SslMode findValueByNumber(int number) { + return SslMode.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.alloydb.v1beta.SslConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final SslMode[] VALUES = values(); + + public static SslMode 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 SslMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.SslConfig.SslMode) + } + + /** + * + * + *
+   * Certificate Authority (CA) source for SSL/TLS certificates.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.SslConfig.CaSource} + */ + public enum CaSource implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Certificate Authority (CA) source not specified. Defaults to
+     * CA_SOURCE_MANAGED.
+     * 
+ * + * CA_SOURCE_UNSPECIFIED = 0; + */ + CA_SOURCE_UNSPECIFIED(0), + /** + * + * + *
+     * Certificate Authority (CA) managed by the AlloyDB Cluster.
+     * 
+ * + * CA_SOURCE_MANAGED = 1; + */ + CA_SOURCE_MANAGED(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Certificate Authority (CA) source not specified. Defaults to
+     * CA_SOURCE_MANAGED.
+     * 
+ * + * CA_SOURCE_UNSPECIFIED = 0; + */ + public static final int CA_SOURCE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Certificate Authority (CA) managed by the AlloyDB Cluster.
+     * 
+ * + * CA_SOURCE_MANAGED = 1; + */ + public static final int CA_SOURCE_MANAGED_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 CaSource 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 CaSource forNumber(int value) { + switch (value) { + case 0: + return CA_SOURCE_UNSPECIFIED; + case 1: + return CA_SOURCE_MANAGED; + 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 CaSource findValueByNumber(int number) { + return CaSource.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.alloydb.v1beta.SslConfig.getDescriptor().getEnumTypes().get(1); + } + + private static final CaSource[] VALUES = values(); + + public static CaSource 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 CaSource(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.SslConfig.CaSource) + } + + public static final int SSL_MODE_FIELD_NUMBER = 1; + private int sslMode_ = 0; + /** + * + * + *
+   * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for sslMode. + */ + @java.lang.Override + public int getSslModeValue() { + return sslMode_; + } + /** + * + * + *
+   * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sslMode. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SslConfig.SslMode getSslMode() { + com.google.cloud.alloydb.v1beta.SslConfig.SslMode result = + com.google.cloud.alloydb.v1beta.SslConfig.SslMode.forNumber(sslMode_); + return result == null ? com.google.cloud.alloydb.v1beta.SslConfig.SslMode.UNRECOGNIZED : result; + } + + public static final int CA_SOURCE_FIELD_NUMBER = 2; + private int caSource_ = 0; + /** + * + * + *
+   * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+   * supported currently, and is the default value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for caSource. + */ + @java.lang.Override + public int getCaSourceValue() { + return caSource_; + } + /** + * + * + *
+   * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+   * supported currently, and is the default value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The caSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SslConfig.CaSource getCaSource() { + com.google.cloud.alloydb.v1beta.SslConfig.CaSource result = + com.google.cloud.alloydb.v1beta.SslConfig.CaSource.forNumber(caSource_); + return result == null + ? com.google.cloud.alloydb.v1beta.SslConfig.CaSource.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 (sslMode_ + != com.google.cloud.alloydb.v1beta.SslConfig.SslMode.SSL_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, sslMode_); + } + if (caSource_ + != com.google.cloud.alloydb.v1beta.SslConfig.CaSource.CA_SOURCE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, caSource_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sslMode_ + != com.google.cloud.alloydb.v1beta.SslConfig.SslMode.SSL_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, sslMode_); + } + if (caSource_ + != com.google.cloud.alloydb.v1beta.SslConfig.CaSource.CA_SOURCE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, caSource_); + } + 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.alloydb.v1beta.SslConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.SslConfig other = + (com.google.cloud.alloydb.v1beta.SslConfig) obj; + + if (sslMode_ != other.sslMode_) return false; + if (caSource_ != other.caSource_) 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) + SSL_MODE_FIELD_NUMBER; + hash = (53 * hash) + sslMode_; + hash = (37 * hash) + CA_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + caSource_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.SslConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.SslConfig 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.alloydb.v1beta.SslConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.SslConfig 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.alloydb.v1beta.SslConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.SslConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.SslConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.SslConfig 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.alloydb.v1beta.SslConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.SslConfig 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.alloydb.v1beta.SslConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.SslConfig 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.alloydb.v1beta.SslConfig 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; + } + /** + * + * + *
+   * SSL configuration for an AlloyDB Cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.SslConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.SslConfig) + com.google.cloud.alloydb.v1beta.SslConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SslConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SslConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.SslConfig.class, + com.google.cloud.alloydb.v1beta.SslConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.SslConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sslMode_ = 0; + caSource_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SslConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SslConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.SslConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SslConfig build() { + com.google.cloud.alloydb.v1beta.SslConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SslConfig buildPartial() { + com.google.cloud.alloydb.v1beta.SslConfig result = + new com.google.cloud.alloydb.v1beta.SslConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.SslConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sslMode_ = sslMode_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.caSource_ = caSource_; + } + } + + @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.alloydb.v1beta.SslConfig) { + return mergeFrom((com.google.cloud.alloydb.v1beta.SslConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.SslConfig other) { + if (other == com.google.cloud.alloydb.v1beta.SslConfig.getDefaultInstance()) return this; + if (other.sslMode_ != 0) { + setSslModeValue(other.getSslModeValue()); + } + if (other.caSource_ != 0) { + setCaSourceValue(other.getCaSourceValue()); + } + 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: + { + sslMode_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + caSource_ = input.readEnum(); + 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 int sslMode_ = 0; + /** + * + * + *
+     * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for sslMode. + */ + @java.lang.Override + public int getSslModeValue() { + return sslMode_; + } + /** + * + * + *
+     * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for sslMode to set. + * @return This builder for chaining. + */ + public Builder setSslModeValue(int value) { + sslMode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sslMode. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SslConfig.SslMode getSslMode() { + com.google.cloud.alloydb.v1beta.SslConfig.SslMode result = + com.google.cloud.alloydb.v1beta.SslConfig.SslMode.forNumber(sslMode_); + return result == null + ? com.google.cloud.alloydb.v1beta.SslConfig.SslMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The sslMode to set. + * @return This builder for chaining. + */ + public Builder setSslMode(com.google.cloud.alloydb.v1beta.SslConfig.SslMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + sslMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSslMode() { + bitField0_ = (bitField0_ & ~0x00000001); + sslMode_ = 0; + onChanged(); + return this; + } + + private int caSource_ = 0; + /** + * + * + *
+     * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+     * supported currently, and is the default value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for caSource. + */ + @java.lang.Override + public int getCaSourceValue() { + return caSource_; + } + /** + * + * + *
+     * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+     * supported currently, and is the default value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for caSource to set. + * @return This builder for chaining. + */ + public Builder setCaSourceValue(int value) { + caSource_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+     * supported currently, and is the default value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The caSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SslConfig.CaSource getCaSource() { + com.google.cloud.alloydb.v1beta.SslConfig.CaSource result = + com.google.cloud.alloydb.v1beta.SslConfig.CaSource.forNumber(caSource_); + return result == null + ? com.google.cloud.alloydb.v1beta.SslConfig.CaSource.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+     * supported currently, and is the default value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The caSource to set. + * @return This builder for chaining. + */ + public Builder setCaSource(com.google.cloud.alloydb.v1beta.SslConfig.CaSource value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + caSource_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+     * supported currently, and is the default value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearCaSource() { + bitField0_ = (bitField0_ & ~0x00000002); + caSource_ = 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.alloydb.v1beta.SslConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.SslConfig) + private static final com.google.cloud.alloydb.v1beta.SslConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.SslConfig(); + } + + public static com.google.cloud.alloydb.v1beta.SslConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SslConfig 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.alloydb.v1beta.SslConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SslConfigOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SslConfigOrBuilder.java new file mode 100644 index 000000000000..50c7b3cc2ef9 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SslConfigOrBuilder.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/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface SslConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.SslConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for sslMode. + */ + int getSslModeValue(); + /** + * + * + *
+   * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sslMode. + */ + com.google.cloud.alloydb.v1beta.SslConfig.SslMode getSslMode(); + + /** + * + * + *
+   * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+   * supported currently, and is the default value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for caSource. + */ + int getCaSourceValue(); + /** + * + * + *
+   * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
+   * supported currently, and is the default value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The caSource. + */ + com.google.cloud.alloydb.v1beta.SslConfig.CaSource getCaSource(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SupportedDatabaseFlag.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SupportedDatabaseFlag.java new file mode 100644 index 000000000000..2bb6e32243f5 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SupportedDatabaseFlag.java @@ -0,0 +1,4389 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * SupportedDatabaseFlag gives general information about a database flag,
+ * like type and allowed values. This is a static value that is defined
+ * on the server side, and it cannot be modified by callers.
+ * To set the Database flags on a particular Instance, a caller should modify
+ * the Instance.database_flags field.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.SupportedDatabaseFlag} + */ +public final class SupportedDatabaseFlag extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.SupportedDatabaseFlag) + SupportedDatabaseFlagOrBuilder { + private static final long serialVersionUID = 0L; + // Use SupportedDatabaseFlag.newBuilder() to construct. + private SupportedDatabaseFlag(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SupportedDatabaseFlag() { + name_ = ""; + flagName_ = ""; + valueType_ = 0; + supportedDbVersions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SupportedDatabaseFlag(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.class, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Builder.class); + } + + /** + * + * + *
+   * ValueType describes the semantic type of the value that the flag accepts.
+   * Regardless of the ValueType, the Instance.database_flags field accepts the
+   * stringified version of the value, i.e. "20" or "3.14".
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType} + */ + public enum ValueType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * This is an unknown flag type.
+     * 
+ * + * VALUE_TYPE_UNSPECIFIED = 0; + */ + VALUE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * String type flag.
+     * 
+ * + * STRING = 1; + */ + STRING(1), + /** + * + * + *
+     * Integer type flag.
+     * 
+ * + * INTEGER = 2; + */ + INTEGER(2), + /** + * + * + *
+     * Float type flag.
+     * 
+ * + * FLOAT = 3; + */ + FLOAT(3), + /** + * + * + *
+     * Denotes that the flag does not accept any values.
+     * 
+ * + * NONE = 4; + */ + NONE(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * This is an unknown flag type.
+     * 
+ * + * VALUE_TYPE_UNSPECIFIED = 0; + */ + public static final int VALUE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * String type flag.
+     * 
+ * + * STRING = 1; + */ + public static final int STRING_VALUE = 1; + /** + * + * + *
+     * Integer type flag.
+     * 
+ * + * INTEGER = 2; + */ + public static final int INTEGER_VALUE = 2; + /** + * + * + *
+     * Float type flag.
+     * 
+ * + * FLOAT = 3; + */ + public static final int FLOAT_VALUE = 3; + /** + * + * + *
+     * Denotes that the flag does not accept any values.
+     * 
+ * + * NONE = 4; + */ + public static final int NONE_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 ValueType 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 ValueType forNumber(int value) { + switch (value) { + case 0: + return VALUE_TYPE_UNSPECIFIED; + case 1: + return STRING; + case 2: + return INTEGER; + case 3: + return FLOAT; + case 4: + return NONE; + 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 ValueType findValueByNumber(int number) { + return ValueType.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.alloydb.v1beta.SupportedDatabaseFlag.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ValueType[] VALUES = values(); + + public static ValueType 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 ValueType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType) + } + + public interface StringRestrictionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return A list containing the allowedValues. + */ + java.util.List getAllowedValuesList(); + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return The count of allowedValues. + */ + int getAllowedValuesCount(); + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the element to return. + * @return The allowedValues at the given index. + */ + java.lang.String getAllowedValues(int index); + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the allowedValues at the given index. + */ + com.google.protobuf.ByteString getAllowedValuesBytes(int index); + } + /** + * + * + *
+   * Restrictions on STRING type values
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} + */ + public static final class StringRestrictions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) + StringRestrictionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use StringRestrictions.newBuilder() to construct. + private StringRestrictions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StringRestrictions() { + allowedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StringRestrictions(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_StringRestrictions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_StringRestrictions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.class, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.Builder + .class); + } + + public static final int ALLOWED_VALUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList allowedValues_; + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return A list containing the allowedValues. + */ + public com.google.protobuf.ProtocolStringList getAllowedValuesList() { + return allowedValues_; + } + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return The count of allowedValues. + */ + public int getAllowedValuesCount() { + return allowedValues_.size(); + } + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the element to return. + * @return The allowedValues at the given index. + */ + public java.lang.String getAllowedValues(int index) { + return allowedValues_.get(index); + } + /** + * + * + *
+     * The list of allowed values, if bounded. This field will be empty
+     * if there is a unbounded number of allowed values.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the allowedValues at the given index. + */ + public com.google.protobuf.ByteString getAllowedValuesBytes(int index) { + return allowedValues_.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 < allowedValues_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allowedValues_.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 < allowedValues_.size(); i++) { + dataSize += computeStringSizeNoTag(allowedValues_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowedValuesList().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.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions other = + (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) obj; + + if (!getAllowedValuesList().equals(other.getAllowedValuesList())) 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 (getAllowedValuesCount() > 0) { + hash = (37 * hash) + ALLOWED_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + 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.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + 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.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + 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.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + 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.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + 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.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions 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; + } + /** + * + * + *
+     * Restrictions on STRING type values
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_StringRestrictions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_StringRestrictions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.class, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.Builder + .class); + } + + // Construct using + // com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + allowedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_StringRestrictions_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions build() { + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + buildPartial() { + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions result = + new com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions result) { + if (((bitField0_ & 0x00000001) != 0)) { + allowedValues_ = allowedValues_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.allowedValues_ = allowedValues_; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions result) { + int from_bitField0_ = bitField0_; + } + + @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.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) { + return mergeFrom( + (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions other) { + if (other + == com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance()) return this; + if (!other.allowedValues_.isEmpty()) { + if (allowedValues_.isEmpty()) { + allowedValues_ = other.allowedValues_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAllowedValuesIsMutable(); + allowedValues_.addAll(other.allowedValues_); + } + 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(); + ensureAllowedValuesIsMutable(); + allowedValues_.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 allowedValues_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAllowedValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + allowedValues_ = new com.google.protobuf.LazyStringArrayList(allowedValues_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @return A list containing the allowedValues. + */ + public com.google.protobuf.ProtocolStringList getAllowedValuesList() { + return allowedValues_.getUnmodifiableView(); + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @return The count of allowedValues. + */ + public int getAllowedValuesCount() { + return allowedValues_.size(); + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the element to return. + * @return The allowedValues at the given index. + */ + public java.lang.String getAllowedValues(int index) { + return allowedValues_.get(index); + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the allowedValues at the given index. + */ + public com.google.protobuf.ByteString getAllowedValuesBytes(int index) { + return allowedValues_.getByteString(index); + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index to set the value at. + * @param value The allowedValues to set. + * @return This builder for chaining. + */ + public Builder setAllowedValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedValuesIsMutable(); + allowedValues_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param value The allowedValues to add. + * @return This builder for chaining. + */ + public Builder addAllowedValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedValuesIsMutable(); + allowedValues_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param values The allowedValues to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedValues(java.lang.Iterable values) { + ensureAllowedValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedValues_); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @return This builder for chaining. + */ + public Builder clearAllowedValues() { + allowedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of allowed values, if bounded. This field will be empty
+       * if there is a unbounded number of allowed values.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param value The bytes of the allowedValues to add. + * @return This builder for chaining. + */ + public Builder addAllowedValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowedValuesIsMutable(); + allowedValues_.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.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) + private static final com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions(); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringRestrictions 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.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface IntegerRestrictionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return Whether the minValue field is set. + */ + boolean hasMinValue(); + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return The minValue. + */ + com.google.protobuf.Int64Value getMinValue(); + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + com.google.protobuf.Int64ValueOrBuilder getMinValueOrBuilder(); + + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return Whether the maxValue field is set. + */ + boolean hasMaxValue(); + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return The maxValue. + */ + com.google.protobuf.Int64Value getMaxValue(); + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + com.google.protobuf.Int64ValueOrBuilder getMaxValueOrBuilder(); + } + /** + * + * + *
+   * Restrictions on INTEGER type values.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} + */ + public static final class IntegerRestrictions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) + IntegerRestrictionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use IntegerRestrictions.newBuilder() to construct. + private IntegerRestrictions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IntegerRestrictions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IntegerRestrictions(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_IntegerRestrictions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_IntegerRestrictions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.class, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.Builder + .class); + } + + public static final int MIN_VALUE_FIELD_NUMBER = 1; + private com.google.protobuf.Int64Value minValue_; + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return Whether the minValue field is set. + */ + @java.lang.Override + public boolean hasMinValue() { + return minValue_ != null; + } + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return The minValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getMinValue() { + return minValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : minValue_; + } + /** + * + * + *
+     * The minimum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getMinValueOrBuilder() { + return minValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : minValue_; + } + + public static final int MAX_VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.Int64Value maxValue_; + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return Whether the maxValue field is set. + */ + @java.lang.Override + public boolean hasMaxValue() { + return maxValue_ != null; + } + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return The maxValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getMaxValue() { + return maxValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : maxValue_; + } + /** + * + * + *
+     * The maximum value that can be specified, if applicable.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getMaxValueOrBuilder() { + return maxValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : maxValue_; + } + + 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 (minValue_ != null) { + output.writeMessage(1, getMinValue()); + } + if (maxValue_ != null) { + output.writeMessage(2, getMaxValue()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minValue_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMinValue()); + } + if (maxValue_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMaxValue()); + } + 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.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions other = + (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) obj; + + if (hasMinValue() != other.hasMinValue()) return false; + if (hasMinValue()) { + if (!getMinValue().equals(other.getMinValue())) return false; + } + if (hasMaxValue() != other.hasMaxValue()) return false; + if (hasMaxValue()) { + if (!getMaxValue().equals(other.getMaxValue())) 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 (hasMinValue()) { + hash = (37 * hash) + MIN_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getMinValue().hashCode(); + } + if (hasMaxValue()) { + hash = (37 * hash) + MAX_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getMaxValue().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + 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.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + 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.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + 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.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + 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.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + 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.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions 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; + } + /** + * + * + *
+     * Restrictions on INTEGER type values.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_IntegerRestrictions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_IntegerRestrictions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.class, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.Builder + .class); + } + + // Construct using + // com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minValue_ = null; + if (minValueBuilder_ != null) { + minValueBuilder_.dispose(); + minValueBuilder_ = null; + } + maxValue_ = null; + if (maxValueBuilder_ != null) { + maxValueBuilder_.dispose(); + maxValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_IntegerRestrictions_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions build() { + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + buildPartial() { + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions result = + new com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.minValue_ = minValueBuilder_ == null ? minValue_ : minValueBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxValue_ = maxValueBuilder_ == null ? maxValue_ : maxValueBuilder_.build(); + } + } + + @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.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) { + return mergeFrom( + (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions other) { + if (other + == com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance()) return this; + if (other.hasMinValue()) { + mergeMinValue(other.getMinValue()); + } + if (other.hasMaxValue()) { + mergeMaxValue(other.getMaxValue()); + } + 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(getMinValueFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getMaxValueFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + 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.protobuf.Int64Value minValue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + minValueBuilder_; + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return Whether the minValue field is set. + */ + public boolean hasMinValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + * + * @return The minValue. + */ + public com.google.protobuf.Int64Value getMinValue() { + if (minValueBuilder_ == null) { + return minValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : minValue_; + } else { + return minValueBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public Builder setMinValue(com.google.protobuf.Int64Value value) { + if (minValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minValue_ = value; + } else { + minValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public Builder setMinValue(com.google.protobuf.Int64Value.Builder builderForValue) { + if (minValueBuilder_ == null) { + minValue_ = builderForValue.build(); + } else { + minValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public Builder mergeMinValue(com.google.protobuf.Int64Value value) { + if (minValueBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && minValue_ != null + && minValue_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getMinValueBuilder().mergeFrom(value); + } else { + minValue_ = value; + } + } else { + minValueBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public Builder clearMinValue() { + bitField0_ = (bitField0_ & ~0x00000001); + minValue_ = null; + if (minValueBuilder_ != null) { + minValueBuilder_.dispose(); + minValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public com.google.protobuf.Int64Value.Builder getMinValueBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMinValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + public com.google.protobuf.Int64ValueOrBuilder getMinValueOrBuilder() { + if (minValueBuilder_ != null) { + return minValueBuilder_.getMessageOrBuilder(); + } else { + return minValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : minValue_; + } + } + /** + * + * + *
+       * The minimum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value min_value = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + getMinValueFieldBuilder() { + if (minValueBuilder_ == null) { + minValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getMinValue(), getParentForChildren(), isClean()); + minValue_ = null; + } + return minValueBuilder_; + } + + private com.google.protobuf.Int64Value maxValue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + maxValueBuilder_; + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return Whether the maxValue field is set. + */ + public boolean hasMaxValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + * + * @return The maxValue. + */ + public com.google.protobuf.Int64Value getMaxValue() { + if (maxValueBuilder_ == null) { + return maxValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : maxValue_; + } else { + return maxValueBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public Builder setMaxValue(com.google.protobuf.Int64Value value) { + if (maxValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maxValue_ = value; + } else { + maxValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public Builder setMaxValue(com.google.protobuf.Int64Value.Builder builderForValue) { + if (maxValueBuilder_ == null) { + maxValue_ = builderForValue.build(); + } else { + maxValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public Builder mergeMaxValue(com.google.protobuf.Int64Value value) { + if (maxValueBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && maxValue_ != null + && maxValue_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getMaxValueBuilder().mergeFrom(value); + } else { + maxValue_ = value; + } + } else { + maxValueBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public Builder clearMaxValue() { + bitField0_ = (bitField0_ & ~0x00000002); + maxValue_ = null; + if (maxValueBuilder_ != null) { + maxValueBuilder_.dispose(); + maxValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public com.google.protobuf.Int64Value.Builder getMaxValueBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getMaxValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + public com.google.protobuf.Int64ValueOrBuilder getMaxValueOrBuilder() { + if (maxValueBuilder_ != null) { + return maxValueBuilder_.getMessageOrBuilder(); + } else { + return maxValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : maxValue_; + } + } + /** + * + * + *
+       * The maximum value that can be specified, if applicable.
+       * 
+ * + * .google.protobuf.Int64Value max_value = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + getMaxValueFieldBuilder() { + if (maxValueBuilder_ == null) { + maxValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getMaxValue(), getParentForChildren(), isClean()); + maxValue_ = null; + } + return maxValueBuilder_; + } + + @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.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) + private static final com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions(); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IntegerRestrictions 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.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int restrictionsCase_ = 0; + private java.lang.Object restrictions_; + + public enum RestrictionsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STRING_RESTRICTIONS(7), + INTEGER_RESTRICTIONS(8), + RESTRICTIONS_NOT_SET(0); + private final int value; + + private RestrictionsCase(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 RestrictionsCase valueOf(int value) { + return forNumber(value); + } + + public static RestrictionsCase forNumber(int value) { + switch (value) { + case 7: + return STRING_RESTRICTIONS; + case 8: + return INTEGER_RESTRICTIONS; + case 0: + return RESTRICTIONS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RestrictionsCase getRestrictionsCase() { + return RestrictionsCase.forNumber(restrictionsCase_); + } + + public static final int STRING_RESTRICTIONS_FIELD_NUMBER = 7; + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return Whether the stringRestrictions field is set. + */ + @java.lang.Override + public boolean hasStringRestrictions() { + return restrictionsCase_ == 7; + } + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return The stringRestrictions. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + getStringRestrictions() { + if (restrictionsCase_ == 7) { + return (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictionsOrBuilder + getStringRestrictionsOrBuilder() { + if (restrictionsCase_ == 7) { + return (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + + public static final int INTEGER_RESTRICTIONS_FIELD_NUMBER = 8; + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return Whether the integerRestrictions field is set. + */ + @java.lang.Override + public boolean hasIntegerRestrictions() { + return restrictionsCase_ == 8; + } + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return The integerRestrictions. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + getIntegerRestrictions() { + if (restrictionsCase_ == 8) { + return (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder + getIntegerRestrictionsOrBuilder() { + if (restrictionsCase_ == 8) { + return (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * The name of the flag resource, following Google Cloud conventions, e.g.:
+   *  * projects/{project}/locations/{location}/flags/{flag}
+   * This field currently has no semantic meaning.
+   * 
+ * + * 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 name of the flag resource, following Google Cloud conventions, e.g.:
+   *  * projects/{project}/locations/{location}/flags/{flag}
+   * This field currently has no semantic meaning.
+   * 
+ * + * 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 FLAG_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object flagName_ = ""; + /** + * + * + *
+   * The name of the database flag, e.g. "max_allowed_packets".
+   * The is a possibly key for the Instance.database_flags map field.
+   * 
+ * + * string flag_name = 2; + * + * @return The flagName. + */ + @java.lang.Override + public java.lang.String getFlagName() { + java.lang.Object ref = flagName_; + 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(); + flagName_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the database flag, e.g. "max_allowed_packets".
+   * The is a possibly key for the Instance.database_flags map field.
+   * 
+ * + * string flag_name = 2; + * + * @return The bytes for flagName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFlagNameBytes() { + java.lang.Object ref = flagName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + flagName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_TYPE_FIELD_NUMBER = 3; + private int valueType_ = 0; + /** + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The enum numeric value on the wire for valueType. + */ + @java.lang.Override + public int getValueTypeValue() { + return valueType_; + } + /** + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The valueType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType getValueType() { + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType result = + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType.forNumber(valueType_); + return result == null + ? com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType.UNRECOGNIZED + : result; + } + + public static final int ACCEPTS_MULTIPLE_VALUES_FIELD_NUMBER = 4; + private boolean acceptsMultipleValues_ = false; + /** + * + * + *
+   * Whether the database flag accepts multiple values. If true,
+   * a comma-separated list of stringified values may be specified.
+   * 
+ * + * bool accepts_multiple_values = 4; + * + * @return The acceptsMultipleValues. + */ + @java.lang.Override + public boolean getAcceptsMultipleValues() { + return acceptsMultipleValues_; + } + + public static final int SUPPORTED_DB_VERSIONS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List supportedDbVersions_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.alloydb.v1beta.DatabaseVersion> + supportedDbVersions_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.alloydb.v1beta.DatabaseVersion>() { + public com.google.cloud.alloydb.v1beta.DatabaseVersion convert(java.lang.Integer from) { + com.google.cloud.alloydb.v1beta.DatabaseVersion result = + com.google.cloud.alloydb.v1beta.DatabaseVersion.forNumber(from); + return result == null + ? com.google.cloud.alloydb.v1beta.DatabaseVersion.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the supportedDbVersions. + */ + @java.lang.Override + public java.util.List + getSupportedDbVersionsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.alloydb.v1beta.DatabaseVersion>( + supportedDbVersions_, supportedDbVersions_converter_); + } + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @return The count of supportedDbVersions. + */ + @java.lang.Override + public int getSupportedDbVersionsCount() { + return supportedDbVersions_.size(); + } + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the element to return. + * @return The supportedDbVersions at the given index. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DatabaseVersion getSupportedDbVersions(int index) { + return supportedDbVersions_converter_.convert(supportedDbVersions_.get(index)); + } + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the enum numeric values on the wire for supportedDbVersions. + */ + @java.lang.Override + public java.util.List getSupportedDbVersionsValueList() { + return supportedDbVersions_; + } + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of supportedDbVersions at the given index. + */ + @java.lang.Override + public int getSupportedDbVersionsValue(int index) { + return supportedDbVersions_.get(index); + } + + private int supportedDbVersionsMemoizedSerializedSize; + + public static final int REQUIRES_DB_RESTART_FIELD_NUMBER = 6; + private boolean requiresDbRestart_ = false; + /** + * + * + *
+   * Whether setting or updating this flag on an Instance requires a database
+   * restart. If a flag that requires database restart is set, the backend
+   * will automatically restart the database (making sure to satisfy any
+   * availability SLO's).
+   * 
+ * + * bool requires_db_restart = 6; + * + * @return The requiresDbRestart. + */ + @java.lang.Override + public boolean getRequiresDbRestart() { + return requiresDbRestart_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(flagName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, flagName_); + } + if (valueType_ + != com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType.VALUE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, valueType_); + } + if (acceptsMultipleValues_ != false) { + output.writeBool(4, acceptsMultipleValues_); + } + if (getSupportedDbVersionsList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(supportedDbVersionsMemoizedSerializedSize); + } + for (int i = 0; i < supportedDbVersions_.size(); i++) { + output.writeEnumNoTag(supportedDbVersions_.get(i)); + } + if (requiresDbRestart_ != false) { + output.writeBool(6, requiresDbRestart_); + } + if (restrictionsCase_ == 7) { + output.writeMessage( + 7, + (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) restrictions_); + } + if (restrictionsCase_ == 8) { + output.writeMessage( + 8, + (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_); + } + 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(flagName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, flagName_); + } + if (valueType_ + != com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType.VALUE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, valueType_); + } + if (acceptsMultipleValues_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, acceptsMultipleValues_); + } + { + int dataSize = 0; + for (int i = 0; i < supportedDbVersions_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(supportedDbVersions_.get(i)); + } + size += dataSize; + if (!getSupportedDbVersionsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + supportedDbVersionsMemoizedSerializedSize = dataSize; + } + if (requiresDbRestart_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requiresDbRestart_); + } + if (restrictionsCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, + (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) + restrictions_); + } + if (restrictionsCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, + (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_); + } + 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.alloydb.v1beta.SupportedDatabaseFlag)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag other = + (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag) obj; + + if (!getName().equals(other.getName())) return false; + if (!getFlagName().equals(other.getFlagName())) return false; + if (valueType_ != other.valueType_) return false; + if (getAcceptsMultipleValues() != other.getAcceptsMultipleValues()) return false; + if (!supportedDbVersions_.equals(other.supportedDbVersions_)) return false; + if (getRequiresDbRestart() != other.getRequiresDbRestart()) return false; + if (!getRestrictionsCase().equals(other.getRestrictionsCase())) return false; + switch (restrictionsCase_) { + case 7: + if (!getStringRestrictions().equals(other.getStringRestrictions())) return false; + break; + case 8: + if (!getIntegerRestrictions().equals(other.getIntegerRestrictions())) 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) + FLAG_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFlagName().hashCode(); + hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + valueType_; + hash = (37 * hash) + ACCEPTS_MULTIPLE_VALUES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAcceptsMultipleValues()); + if (getSupportedDbVersionsCount() > 0) { + hash = (37 * hash) + SUPPORTED_DB_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + supportedDbVersions_.hashCode(); + } + hash = (37 * hash) + REQUIRES_DB_RESTART_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequiresDbRestart()); + switch (restrictionsCase_) { + case 7: + hash = (37 * hash) + STRING_RESTRICTIONS_FIELD_NUMBER; + hash = (53 * hash) + getStringRestrictions().hashCode(); + break; + case 8: + hash = (37 * hash) + INTEGER_RESTRICTIONS_FIELD_NUMBER; + hash = (53 * hash) + getIntegerRestrictions().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag 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.alloydb.v1beta.SupportedDatabaseFlag parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag 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.alloydb.v1beta.SupportedDatabaseFlag parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag 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.alloydb.v1beta.SupportedDatabaseFlag parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag 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.alloydb.v1beta.SupportedDatabaseFlag parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag 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.alloydb.v1beta.SupportedDatabaseFlag 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; + } + /** + * + * + *
+   * SupportedDatabaseFlag gives general information about a database flag,
+   * like type and allowed values. This is a static value that is defined
+   * on the server side, and it cannot be modified by callers.
+   * To set the Database flags on a particular Instance, a caller should modify
+   * the Instance.database_flags field.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.SupportedDatabaseFlag} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.SupportedDatabaseFlag) + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlagOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.class, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (stringRestrictionsBuilder_ != null) { + stringRestrictionsBuilder_.clear(); + } + if (integerRestrictionsBuilder_ != null) { + integerRestrictionsBuilder_.clear(); + } + name_ = ""; + flagName_ = ""; + valueType_ = 0; + acceptsMultipleValues_ = false; + supportedDbVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + requiresDbRestart_ = false; + restrictionsCase_ = 0; + restrictions_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag build() { + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag buildPartial() { + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag result = + new com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag result) { + if (((bitField0_ & 0x00000040) != 0)) { + supportedDbVersions_ = java.util.Collections.unmodifiableList(supportedDbVersions_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.supportedDbVersions_ = supportedDbVersions_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.flagName_ = flagName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.valueType_ = valueType_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.acceptsMultipleValues_ = acceptsMultipleValues_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.requiresDbRestart_ = requiresDbRestart_; + } + } + + private void buildPartialOneofs(com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag result) { + result.restrictionsCase_ = restrictionsCase_; + result.restrictions_ = this.restrictions_; + if (restrictionsCase_ == 7 && stringRestrictionsBuilder_ != null) { + result.restrictions_ = stringRestrictionsBuilder_.build(); + } + if (restrictionsCase_ == 8 && integerRestrictionsBuilder_ != null) { + result.restrictions_ = integerRestrictionsBuilder_.build(); + } + } + + @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.alloydb.v1beta.SupportedDatabaseFlag) { + return mergeFrom((com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag other) { + if (other == com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFlagName().isEmpty()) { + flagName_ = other.flagName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.valueType_ != 0) { + setValueTypeValue(other.getValueTypeValue()); + } + if (other.getAcceptsMultipleValues() != false) { + setAcceptsMultipleValues(other.getAcceptsMultipleValues()); + } + if (!other.supportedDbVersions_.isEmpty()) { + if (supportedDbVersions_.isEmpty()) { + supportedDbVersions_ = other.supportedDbVersions_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.addAll(other.supportedDbVersions_); + } + onChanged(); + } + if (other.getRequiresDbRestart() != false) { + setRequiresDbRestart(other.getRequiresDbRestart()); + } + switch (other.getRestrictionsCase()) { + case STRING_RESTRICTIONS: + { + mergeStringRestrictions(other.getStringRestrictions()); + break; + } + case INTEGER_RESTRICTIONS: + { + mergeIntegerRestrictions(other.getIntegerRestrictions()); + break; + } + case RESTRICTIONS_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(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 18: + { + flagName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 24: + { + valueType_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 24 + case 32: + { + acceptsMultipleValues_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 32 + case 40: + { + int tmpRaw = input.readEnum(); + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.add(tmpRaw); + break; + } // case 40 + case 42: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 42 + case 48: + { + requiresDbRestart_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 48 + case 58: + { + input.readMessage( + getStringRestrictionsFieldBuilder().getBuilder(), extensionRegistry); + restrictionsCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage( + getIntegerRestrictionsFieldBuilder().getBuilder(), extensionRegistry); + restrictionsCase_ = 8; + break; + } // case 66 + 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 restrictionsCase_ = 0; + private java.lang.Object restrictions_; + + public RestrictionsCase getRestrictionsCase() { + return RestrictionsCase.forNumber(restrictionsCase_); + } + + public Builder clearRestrictions() { + restrictionsCase_ = 0; + restrictions_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.Builder, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictionsOrBuilder> + stringRestrictionsBuilder_; + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return Whether the stringRestrictions field is set. + */ + @java.lang.Override + public boolean hasStringRestrictions() { + return restrictionsCase_ == 7; + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return The stringRestrictions. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + getStringRestrictions() { + if (stringRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 7) { + return (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } else { + if (restrictionsCase_ == 7) { + return stringRestrictionsBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + public Builder setStringRestrictions( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions value) { + if (stringRestrictionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + restrictions_ = value; + onChanged(); + } else { + stringRestrictionsBuilder_.setMessage(value); + } + restrictionsCase_ = 7; + return this; + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + public Builder setStringRestrictions( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.Builder + builderForValue) { + if (stringRestrictionsBuilder_ == null) { + restrictions_ = builderForValue.build(); + onChanged(); + } else { + stringRestrictionsBuilder_.setMessage(builderForValue.build()); + } + restrictionsCase_ = 7; + return this; + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + public Builder mergeStringRestrictions( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions value) { + if (stringRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 7 + && restrictions_ + != com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance()) { + restrictions_ = + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.newBuilder( + (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) + restrictions_) + .mergeFrom(value) + .buildPartial(); + } else { + restrictions_ = value; + } + onChanged(); + } else { + if (restrictionsCase_ == 7) { + stringRestrictionsBuilder_.mergeFrom(value); + } else { + stringRestrictionsBuilder_.setMessage(value); + } + } + restrictionsCase_ = 7; + return this; + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + public Builder clearStringRestrictions() { + if (stringRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 7) { + restrictionsCase_ = 0; + restrictions_ = null; + onChanged(); + } + } else { + if (restrictionsCase_ == 7) { + restrictionsCase_ = 0; + restrictions_ = null; + } + stringRestrictionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.Builder + getStringRestrictionsBuilder() { + return getStringRestrictionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictionsOrBuilder + getStringRestrictionsOrBuilder() { + if ((restrictionsCase_ == 7) && (stringRestrictionsBuilder_ != null)) { + return stringRestrictionsBuilder_.getMessageOrBuilder(); + } else { + if (restrictionsCase_ == 7) { + return (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Restriction on STRING type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.Builder, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictionsOrBuilder> + getStringRestrictionsFieldBuilder() { + if (stringRestrictionsBuilder_ == null) { + if (!(restrictionsCase_ == 7)) { + restrictions_ = + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + .getDefaultInstance(); + } + stringRestrictionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.Builder, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictionsOrBuilder>( + (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) + restrictions_, + getParentForChildren(), + isClean()); + restrictions_ = null; + } + restrictionsCase_ = 7; + onChanged(); + return stringRestrictionsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.Builder, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder> + integerRestrictionsBuilder_; + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return Whether the integerRestrictions field is set. + */ + @java.lang.Override + public boolean hasIntegerRestrictions() { + return restrictionsCase_ == 8; + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return The integerRestrictions. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + getIntegerRestrictions() { + if (integerRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 8) { + return (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } else { + if (restrictionsCase_ == 8) { + return integerRestrictionsBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + public Builder setIntegerRestrictions( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions value) { + if (integerRestrictionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + restrictions_ = value; + onChanged(); + } else { + integerRestrictionsBuilder_.setMessage(value); + } + restrictionsCase_ = 8; + return this; + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + public Builder setIntegerRestrictions( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.Builder + builderForValue) { + if (integerRestrictionsBuilder_ == null) { + restrictions_ = builderForValue.build(); + onChanged(); + } else { + integerRestrictionsBuilder_.setMessage(builderForValue.build()); + } + restrictionsCase_ = 8; + return this; + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + public Builder mergeIntegerRestrictions( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions value) { + if (integerRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 8 + && restrictions_ + != com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance()) { + restrictions_ = + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.newBuilder( + (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_) + .mergeFrom(value) + .buildPartial(); + } else { + restrictions_ = value; + } + onChanged(); + } else { + if (restrictionsCase_ == 8) { + integerRestrictionsBuilder_.mergeFrom(value); + } else { + integerRestrictionsBuilder_.setMessage(value); + } + } + restrictionsCase_ = 8; + return this; + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + public Builder clearIntegerRestrictions() { + if (integerRestrictionsBuilder_ == null) { + if (restrictionsCase_ == 8) { + restrictionsCase_ = 0; + restrictions_ = null; + onChanged(); + } + } else { + if (restrictionsCase_ == 8) { + restrictionsCase_ = 0; + restrictions_ = null; + } + integerRestrictionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.Builder + getIntegerRestrictionsBuilder() { + return getIntegerRestrictionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder + getIntegerRestrictionsOrBuilder() { + if ((restrictionsCase_ == 8) && (integerRestrictionsBuilder_ != null)) { + return integerRestrictionsBuilder_.getMessageOrBuilder(); + } else { + if (restrictionsCase_ == 8) { + return (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_; + } + return com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Restriction on INTEGER type value.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.Builder, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder> + getIntegerRestrictionsFieldBuilder() { + if (integerRestrictionsBuilder_ == null) { + if (!(restrictionsCase_ == 8)) { + restrictions_ = + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + .getDefaultInstance(); + } + integerRestrictionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.Builder, + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder>( + (com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) + restrictions_, + getParentForChildren(), + isClean()); + restrictions_ = null; + } + restrictionsCase_ = 8; + onChanged(); + return integerRestrictionsBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the flag resource, following Google Cloud conventions, e.g.:
+     *  * projects/{project}/locations/{location}/flags/{flag}
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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 name of the flag resource, following Google Cloud conventions, e.g.:
+     *  * projects/{project}/locations/{location}/flags/{flag}
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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 name of the flag resource, following Google Cloud conventions, e.g.:
+     *  * projects/{project}/locations/{location}/flags/{flag}
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the flag resource, following Google Cloud conventions, e.g.:
+     *  * projects/{project}/locations/{location}/flags/{flag}
+     * This field currently has no semantic meaning.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the flag resource, following Google Cloud conventions, e.g.:
+     *  * projects/{project}/locations/{location}/flags/{flag}
+     * This field currently has no semantic meaning.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object flagName_ = ""; + /** + * + * + *
+     * The name of the database flag, e.g. "max_allowed_packets".
+     * The is a possibly key for the Instance.database_flags map field.
+     * 
+ * + * string flag_name = 2; + * + * @return The flagName. + */ + public java.lang.String getFlagName() { + java.lang.Object ref = flagName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + flagName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the database flag, e.g. "max_allowed_packets".
+     * The is a possibly key for the Instance.database_flags map field.
+     * 
+ * + * string flag_name = 2; + * + * @return The bytes for flagName. + */ + public com.google.protobuf.ByteString getFlagNameBytes() { + java.lang.Object ref = flagName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + flagName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the database flag, e.g. "max_allowed_packets".
+     * The is a possibly key for the Instance.database_flags map field.
+     * 
+ * + * string flag_name = 2; + * + * @param value The flagName to set. + * @return This builder for chaining. + */ + public Builder setFlagName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + flagName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the database flag, e.g. "max_allowed_packets".
+     * The is a possibly key for the Instance.database_flags map field.
+     * 
+ * + * string flag_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearFlagName() { + flagName_ = getDefaultInstance().getFlagName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the database flag, e.g. "max_allowed_packets".
+     * The is a possibly key for the Instance.database_flags map field.
+     * 
+ * + * string flag_name = 2; + * + * @param value The bytes for flagName to set. + * @return This builder for chaining. + */ + public Builder setFlagNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + flagName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private int valueType_ = 0; + /** + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The enum numeric value on the wire for valueType. + */ + @java.lang.Override + public int getValueTypeValue() { + return valueType_; + } + /** + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @param value The enum numeric value on the wire for valueType to set. + * @return This builder for chaining. + */ + public Builder setValueTypeValue(int value) { + valueType_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The valueType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType getValueType() { + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType result = + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType.forNumber(valueType_); + return result == null + ? com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType.UNRECOGNIZED + : result; + } + /** + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @param value The valueType to set. + * @return This builder for chaining. + */ + public Builder setValueType( + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + valueType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return This builder for chaining. + */ + public Builder clearValueType() { + bitField0_ = (bitField0_ & ~0x00000010); + valueType_ = 0; + onChanged(); + return this; + } + + private boolean acceptsMultipleValues_; + /** + * + * + *
+     * Whether the database flag accepts multiple values. If true,
+     * a comma-separated list of stringified values may be specified.
+     * 
+ * + * bool accepts_multiple_values = 4; + * + * @return The acceptsMultipleValues. + */ + @java.lang.Override + public boolean getAcceptsMultipleValues() { + return acceptsMultipleValues_; + } + /** + * + * + *
+     * Whether the database flag accepts multiple values. If true,
+     * a comma-separated list of stringified values may be specified.
+     * 
+ * + * bool accepts_multiple_values = 4; + * + * @param value The acceptsMultipleValues to set. + * @return This builder for chaining. + */ + public Builder setAcceptsMultipleValues(boolean value) { + + acceptsMultipleValues_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the database flag accepts multiple values. If true,
+     * a comma-separated list of stringified values may be specified.
+     * 
+ * + * bool accepts_multiple_values = 4; + * + * @return This builder for chaining. + */ + public Builder clearAcceptsMultipleValues() { + bitField0_ = (bitField0_ & ~0x00000020); + acceptsMultipleValues_ = false; + onChanged(); + return this; + } + + private java.util.List supportedDbVersions_ = + java.util.Collections.emptyList(); + + private void ensureSupportedDbVersionsIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + supportedDbVersions_ = new java.util.ArrayList(supportedDbVersions_); + bitField0_ |= 0x00000040; + } + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the supportedDbVersions. + */ + public java.util.List + getSupportedDbVersionsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.alloydb.v1beta.DatabaseVersion>( + supportedDbVersions_, supportedDbVersions_converter_); + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @return The count of supportedDbVersions. + */ + public int getSupportedDbVersionsCount() { + return supportedDbVersions_.size(); + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the element to return. + * @return The supportedDbVersions at the given index. + */ + public com.google.cloud.alloydb.v1beta.DatabaseVersion getSupportedDbVersions(int index) { + return supportedDbVersions_converter_.convert(supportedDbVersions_.get(index)); + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @param index The index to set the value at. + * @param value The supportedDbVersions to set. + * @return This builder for chaining. + */ + public Builder setSupportedDbVersions( + int index, com.google.cloud.alloydb.v1beta.DatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @param value The supportedDbVersions to add. + * @return This builder for chaining. + */ + public Builder addSupportedDbVersions(com.google.cloud.alloydb.v1beta.DatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @param values The supportedDbVersions to add. + * @return This builder for chaining. + */ + public Builder addAllSupportedDbVersions( + java.lang.Iterable values) { + ensureSupportedDbVersionsIsMutable(); + for (com.google.cloud.alloydb.v1beta.DatabaseVersion value : values) { + supportedDbVersions_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @return This builder for chaining. + */ + public Builder clearSupportedDbVersions() { + supportedDbVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the enum numeric values on the wire for supportedDbVersions. + */ + public java.util.List getSupportedDbVersionsValueList() { + return java.util.Collections.unmodifiableList(supportedDbVersions_); + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of supportedDbVersions at the given index. + */ + public int getSupportedDbVersionsValue(int index) { + return supportedDbVersions_.get(index); + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for supportedDbVersions to set. + * @return This builder for chaining. + */ + public Builder setSupportedDbVersionsValue(int index, int value) { + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @param value The enum numeric value on the wire for supportedDbVersions to add. + * @return This builder for chaining. + */ + public Builder addSupportedDbVersionsValue(int value) { + ensureSupportedDbVersionsIsMutable(); + supportedDbVersions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Major database engine versions for which this flag is supported.
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @param values The enum numeric values on the wire for supportedDbVersions to add. + * @return This builder for chaining. + */ + public Builder addAllSupportedDbVersionsValue(java.lang.Iterable values) { + ensureSupportedDbVersionsIsMutable(); + for (int value : values) { + supportedDbVersions_.add(value); + } + onChanged(); + return this; + } + + private boolean requiresDbRestart_; + /** + * + * + *
+     * Whether setting or updating this flag on an Instance requires a database
+     * restart. If a flag that requires database restart is set, the backend
+     * will automatically restart the database (making sure to satisfy any
+     * availability SLO's).
+     * 
+ * + * bool requires_db_restart = 6; + * + * @return The requiresDbRestart. + */ + @java.lang.Override + public boolean getRequiresDbRestart() { + return requiresDbRestart_; + } + /** + * + * + *
+     * Whether setting or updating this flag on an Instance requires a database
+     * restart. If a flag that requires database restart is set, the backend
+     * will automatically restart the database (making sure to satisfy any
+     * availability SLO's).
+     * 
+ * + * bool requires_db_restart = 6; + * + * @param value The requiresDbRestart to set. + * @return This builder for chaining. + */ + public Builder setRequiresDbRestart(boolean value) { + + requiresDbRestart_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether setting or updating this flag on an Instance requires a database
+     * restart. If a flag that requires database restart is set, the backend
+     * will automatically restart the database (making sure to satisfy any
+     * availability SLO's).
+     * 
+ * + * bool requires_db_restart = 6; + * + * @return This builder for chaining. + */ + public Builder clearRequiresDbRestart() { + bitField0_ = (bitField0_ & ~0x00000080); + requiresDbRestart_ = 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.alloydb.v1beta.SupportedDatabaseFlag) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.SupportedDatabaseFlag) + private static final com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag(); + } + + public static com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SupportedDatabaseFlag 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.alloydb.v1beta.SupportedDatabaseFlag getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SupportedDatabaseFlagName.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SupportedDatabaseFlagName.java new file mode 100644 index 000000000000..60a8387ef56c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SupportedDatabaseFlagName.java @@ -0,0 +1,218 @@ +/* + * 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.alloydb.v1beta; + +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 SupportedDatabaseFlagName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_FLAG = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/flags/{flag}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String flag; + + @Deprecated + protected SupportedDatabaseFlagName() { + project = null; + location = null; + flag = null; + } + + private SupportedDatabaseFlagName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + flag = Preconditions.checkNotNull(builder.getFlag()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFlag() { + return flag; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SupportedDatabaseFlagName of(String project, String location, String flag) { + return newBuilder().setProject(project).setLocation(location).setFlag(flag).build(); + } + + public static String format(String project, String location, String flag) { + return newBuilder().setProject(project).setLocation(location).setFlag(flag).build().toString(); + } + + public static SupportedDatabaseFlagName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_FLAG.validatedMatch( + formattedString, + "SupportedDatabaseFlagName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("flag")); + } + + 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 (SupportedDatabaseFlagName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_FLAG.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 (flag != null) { + fieldMapBuilder.put("flag", flag); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_FLAG.instantiate( + "project", project, "location", location, "flag", flag); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SupportedDatabaseFlagName that = ((SupportedDatabaseFlagName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.flag, that.flag); + } + 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(flag); + return h; + } + + /** Builder for projects/{project}/locations/{location}/flags/{flag}. */ + public static class Builder { + private String project; + private String location; + private String flag; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFlag() { + return flag; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setFlag(String flag) { + this.flag = flag; + return this; + } + + private Builder(SupportedDatabaseFlagName supportedDatabaseFlagName) { + this.project = supportedDatabaseFlagName.project; + this.location = supportedDatabaseFlagName.location; + this.flag = supportedDatabaseFlagName.flag; + } + + public SupportedDatabaseFlagName build() { + return new SupportedDatabaseFlagName(this); + } + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SupportedDatabaseFlagOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SupportedDatabaseFlagOrBuilder.java new file mode 100644 index 000000000000..dad091cab8f1 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SupportedDatabaseFlagOrBuilder.java @@ -0,0 +1,275 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface SupportedDatabaseFlagOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.SupportedDatabaseFlag) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return Whether the stringRestrictions field is set. + */ + boolean hasStringRestrictions(); + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + * + * @return The stringRestrictions. + */ + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions getStringRestrictions(); + /** + * + * + *
+   * Restriction on STRING type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * + */ + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictionsOrBuilder + getStringRestrictionsOrBuilder(); + + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return Whether the integerRestrictions field is set. + */ + boolean hasIntegerRestrictions(); + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + * + * @return The integerRestrictions. + */ + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + getIntegerRestrictions(); + /** + * + * + *
+   * Restriction on INTEGER type value.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * + */ + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictionsOrBuilder + getIntegerRestrictionsOrBuilder(); + + /** + * + * + *
+   * The name of the flag resource, following Google Cloud conventions, e.g.:
+   *  * projects/{project}/locations/{location}/flags/{flag}
+   * This field currently has no semantic meaning.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the flag resource, following Google Cloud conventions, e.g.:
+   *  * projects/{project}/locations/{location}/flags/{flag}
+   * This field currently has no semantic meaning.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The name of the database flag, e.g. "max_allowed_packets".
+   * The is a possibly key for the Instance.database_flags map field.
+   * 
+ * + * string flag_name = 2; + * + * @return The flagName. + */ + java.lang.String getFlagName(); + /** + * + * + *
+   * The name of the database flag, e.g. "max_allowed_packets".
+   * The is a possibly key for the Instance.database_flags map field.
+   * 
+ * + * string flag_name = 2; + * + * @return The bytes for flagName. + */ + com.google.protobuf.ByteString getFlagNameBytes(); + + /** + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The enum numeric value on the wire for valueType. + */ + int getValueTypeValue(); + /** + * .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value_type = 3; + * + * @return The valueType. + */ + com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType getValueType(); + + /** + * + * + *
+   * Whether the database flag accepts multiple values. If true,
+   * a comma-separated list of stringified values may be specified.
+   * 
+ * + * bool accepts_multiple_values = 4; + * + * @return The acceptsMultipleValues. + */ + boolean getAcceptsMultipleValues(); + + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the supportedDbVersions. + */ + java.util.List getSupportedDbVersionsList(); + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @return The count of supportedDbVersions. + */ + int getSupportedDbVersionsCount(); + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the element to return. + * @return The supportedDbVersions at the given index. + */ + com.google.cloud.alloydb.v1beta.DatabaseVersion getSupportedDbVersions(int index); + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @return A list containing the enum numeric values on the wire for supportedDbVersions. + */ + java.util.List getSupportedDbVersionsValueList(); + /** + * + * + *
+   * Major database engine versions for which this flag is supported.
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of supportedDbVersions at the given index. + */ + int getSupportedDbVersionsValue(int index); + + /** + * + * + *
+   * Whether setting or updating this flag on an Instance requires a database
+   * restart. If a flag that requires database restart is set, the backend
+   * will automatically restart the database (making sure to satisfy any
+   * availability SLO's).
+   * 
+ * + * bool requires_db_restart = 6; + * + * @return The requiresDbRestart. + */ + boolean getRequiresDbRestart(); + + public com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.RestrictionsCase + getRestrictionsCase(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateBackupRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateBackupRequest.java new file mode 100644 index 000000000000..e5d84e1f034e --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateBackupRequest.java @@ -0,0 +1,1494 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for updating a Backup
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.UpdateBackupRequest} + */ +public final class UpdateBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.UpdateBackupRequest) + UpdateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateBackupRequest.newBuilder() to construct. + private UpdateBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateBackupRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateBackupRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.UpdateBackupRequest.class, + com.google.cloud.alloydb.v1beta.UpdateBackupRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int BACKUP_FIELD_NUMBER = 2; + private com.google.cloud.alloydb.v1beta.Backup backup_; + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return backup_ != null; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Backup getBackup() { + return backup_ == null ? com.google.cloud.alloydb.v1beta.Backup.getDefaultInstance() : backup_; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.BackupOrBuilder getBackupOrBuilder() { + return backup_ == null ? com.google.cloud.alloydb.v1beta.Backup.getDefaultInstance() : backup_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_ = false; + /** + * + * + *
+   * Optional. If set to true, update succeeds even if instance is not found. In
+   * that case, a new backup is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (backup_ != null) { + output.writeMessage(2, getBackup()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (backup_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBackup()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + 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.alloydb.v1beta.UpdateBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.UpdateBackupRequest other = + (com.google.cloud.alloydb.v1beta.UpdateBackupRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) 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 (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.UpdateBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.UpdateBackupRequest 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.alloydb.v1beta.UpdateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.UpdateBackupRequest 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.alloydb.v1beta.UpdateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.UpdateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.UpdateBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.UpdateBackupRequest 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.alloydb.v1beta.UpdateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.UpdateBackupRequest 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.alloydb.v1beta.UpdateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.UpdateBackupRequest 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.alloydb.v1beta.UpdateBackupRequest 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; + } + /** + * + * + *
+   * Message for updating a Backup
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.UpdateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.UpdateBackupRequest) + com.google.cloud.alloydb.v1beta.UpdateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.UpdateBackupRequest.class, + com.google.cloud.alloydb.v1beta.UpdateBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.UpdateBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UpdateBackupRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.UpdateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UpdateBackupRequest build() { + com.google.cloud.alloydb.v1beta.UpdateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UpdateBackupRequest buildPartial() { + com.google.cloud.alloydb.v1beta.UpdateBackupRequest result = + new com.google.cloud.alloydb.v1beta.UpdateBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.UpdateBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backup_ = backupBuilder_ == null ? backup_ : backupBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @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.alloydb.v1beta.UpdateBackupRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.UpdateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.UpdateBackupRequest other) { + if (other == com.google.cloud.alloydb.v1beta.UpdateBackupRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getBackupFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Backup resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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.alloydb.v1beta.Backup backup_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Backup, + com.google.cloud.alloydb.v1beta.Backup.Builder, + com.google.cloud.alloydb.v1beta.BackupOrBuilder> + backupBuilder_; + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.cloud.alloydb.v1beta.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null + ? com.google.cloud.alloydb.v1beta.Backup.getDefaultInstance() + : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.alloydb.v1beta.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + } else { + backupBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.alloydb.v1beta.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.cloud.alloydb.v1beta.Backup value) { + if (backupBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && backup_ != null + && backup_ != com.google.cloud.alloydb.v1beta.Backup.getDefaultInstance()) { + getBackupBuilder().mergeFrom(value); + } else { + backup_ = value; + } + } else { + backupBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + bitField0_ = (bitField0_ & ~0x00000002); + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.Backup.Builder getBackupBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getBackupFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null + ? com.google.cloud.alloydb.v1beta.Backup.getDefaultInstance() + : backup_; + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Backup, + com.google.cloud.alloydb.v1beta.Backup.Builder, + com.google.cloud.alloydb.v1beta.BackupOrBuilder> + getBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Backup, + com.google.cloud.alloydb.v1beta.Backup.Builder, + com.google.cloud.alloydb.v1beta.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new backup is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new backup is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new backup is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000010); + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1beta.UpdateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.UpdateBackupRequest) + private static final com.google.cloud.alloydb.v1beta.UpdateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.UpdateBackupRequest(); + } + + public static com.google.cloud.alloydb.v1beta.UpdateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBackupRequest 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.alloydb.v1beta.UpdateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateBackupRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateBackupRequestOrBuilder.java new file mode 100644 index 000000000000..a6408b6c7fee --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateBackupRequestOrBuilder.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/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface UpdateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.UpdateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Backup resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.cloud.alloydb.v1beta.Backup getBackup(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1beta.BackupOrBuilder getBackupOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. If set to true, update succeeds even if instance is not found. In
+   * that case, a new backup is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateClusterRequest.java new file mode 100644 index 000000000000..3846561adc70 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateClusterRequest.java @@ -0,0 +1,1505 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for updating a Cluster
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.UpdateClusterRequest} + */ +public final class UpdateClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.UpdateClusterRequest) + UpdateClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateClusterRequest.newBuilder() to construct. + private UpdateClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateClusterRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateClusterRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.UpdateClusterRequest.class, + com.google.cloud.alloydb.v1beta.UpdateClusterRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int CLUSTER_FIELD_NUMBER = 2; + private com.google.cloud.alloydb.v1beta.Cluster cluster_; + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + @java.lang.Override + public boolean hasCluster() { + return cluster_ != null; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster getCluster() { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the update
+   * request.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_ = false; + /** + * + * + *
+   * Optional. If set to true, update succeeds even if cluster is not found. In
+   * that case, a new cluster is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (cluster_ != null) { + output.writeMessage(2, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (cluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + 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.alloydb.v1beta.UpdateClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.UpdateClusterRequest other = + (com.google.cloud.alloydb.v1beta.UpdateClusterRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasCluster() != other.hasCluster()) return false; + if (hasCluster()) { + if (!getCluster().equals(other.getCluster())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) 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 (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasCluster()) { + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.UpdateClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.UpdateClusterRequest 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.alloydb.v1beta.UpdateClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.UpdateClusterRequest 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.alloydb.v1beta.UpdateClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.UpdateClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.UpdateClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.UpdateClusterRequest 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.alloydb.v1beta.UpdateClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.UpdateClusterRequest 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.alloydb.v1beta.UpdateClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.UpdateClusterRequest 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.alloydb.v1beta.UpdateClusterRequest 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; + } + /** + * + * + *
+   * Message for updating a Cluster
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.UpdateClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.UpdateClusterRequest) + com.google.cloud.alloydb.v1beta.UpdateClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.UpdateClusterRequest.class, + com.google.cloud.alloydb.v1beta.UpdateClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.UpdateClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UpdateClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.UpdateClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UpdateClusterRequest build() { + com.google.cloud.alloydb.v1beta.UpdateClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UpdateClusterRequest buildPartial() { + com.google.cloud.alloydb.v1beta.UpdateClusterRequest result = + new com.google.cloud.alloydb.v1beta.UpdateClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.UpdateClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @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.alloydb.v1beta.UpdateClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.UpdateClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.UpdateClusterRequest other) { + if (other == com.google.cloud.alloydb.v1beta.UpdateClusterRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasCluster()) { + mergeCluster(other.getCluster()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Cluster resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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.alloydb.v1beta.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster, + com.google.cloud.alloydb.v1beta.Cluster.Builder, + com.google.cloud.alloydb.v1beta.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.alloydb.v1beta.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1beta.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1beta.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.alloydb.v1beta.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCluster() { + bitField0_ = (bitField0_ & ~0x00000002); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster, + com.google.cloud.alloydb.v1beta.Cluster.Builder, + com.google.cloud.alloydb.v1beta.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster, + com.google.cloud.alloydb.v1beta.Cluster.Builder, + com.google.cloud.alloydb.v1beta.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. If set to true, update succeeds even if cluster is not found. In
+     * that case, a new cluster is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if cluster is not found. In
+     * that case, a new cluster is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if cluster is not found. In
+     * that case, a new cluster is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000010); + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1beta.UpdateClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.UpdateClusterRequest) + private static final com.google.cloud.alloydb.v1beta.UpdateClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.UpdateClusterRequest(); + } + + public static com.google.cloud.alloydb.v1beta.UpdateClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateClusterRequest 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.alloydb.v1beta.UpdateClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateClusterRequestOrBuilder.java new file mode 100644 index 000000000000..0c869d7131c0 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateClusterRequestOrBuilder.java @@ -0,0 +1,190 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface UpdateClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.UpdateClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Cluster resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.alloydb.v1beta.Cluster getCluster(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1beta.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the update
+   * request.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. If set to true, update succeeds even if cluster is not found. In
+   * that case, a new cluster is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateInstanceRequest.java new file mode 100644 index 000000000000..a6243a39d6a7 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateInstanceRequest.java @@ -0,0 +1,1506 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for updating a Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.UpdateInstanceRequest} + */ +public final class UpdateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.UpdateInstanceRequest) + UpdateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateInstanceRequest.newBuilder() to construct. + private UpdateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateInstanceRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateInstanceRequest(); + } + + @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.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.UpdateInstanceRequest.class, + com.google.cloud.alloydb.v1beta.UpdateInstanceRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + private com.google.cloud.alloydb.v1beta.Instance instance_; + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return instance_ != null; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance getInstance() { + return instance_ == null + ? com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.InstanceOrBuilder getInstanceOrBuilder() { + return instance_ == null + ? com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance() + : instance_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the update
+   * request.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_ = false; + /** + * + * + *
+   * Optional. If set to true, update succeeds even if instance is not found. In
+   * that case, a new instance is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (instance_ != null) { + output.writeMessage(2, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (instance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + 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.alloydb.v1beta.UpdateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.UpdateInstanceRequest other = + (com.google.cloud.alloydb.v1beta.UpdateInstanceRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) 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 (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.UpdateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.UpdateInstanceRequest 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.alloydb.v1beta.UpdateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.UpdateInstanceRequest 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.alloydb.v1beta.UpdateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.UpdateInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.UpdateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.UpdateInstanceRequest 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.alloydb.v1beta.UpdateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.UpdateInstanceRequest 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.alloydb.v1beta.UpdateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.UpdateInstanceRequest 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.alloydb.v1beta.UpdateInstanceRequest 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; + } + /** + * + * + *
+   * Message for updating a Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.UpdateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.UpdateInstanceRequest) + com.google.cloud.alloydb.v1beta.UpdateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.UpdateInstanceRequest.class, + com.google.cloud.alloydb.v1beta.UpdateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.UpdateInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UpdateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.UpdateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UpdateInstanceRequest build() { + com.google.cloud.alloydb.v1beta.UpdateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UpdateInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1beta.UpdateInstanceRequest result = + new com.google.cloud.alloydb.v1beta.UpdateInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.UpdateInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @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.alloydb.v1beta.UpdateInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.UpdateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.UpdateInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1beta.UpdateInstanceRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Instance resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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.alloydb.v1beta.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance, + com.google.cloud.alloydb.v1beta.Instance.Builder, + com.google.cloud.alloydb.v1beta.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.alloydb.v1beta.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1beta.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + } else { + instanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1beta.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.alloydb.v1beta.Instance value) { + if (instanceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && instance_ != null + && instance_ != com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); + } else { + instance_ = value; + } + } else { + instanceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + bitField0_ = (bitField0_ & ~0x00000002); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.Instance.Builder getInstanceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.alloydb.v1beta.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance, + com.google.cloud.alloydb.v1beta.Instance.Builder, + com.google.cloud.alloydb.v1beta.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance, + com.google.cloud.alloydb.v1beta.Instance.Builder, + com.google.cloud.alloydb.v1beta.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the update
+     * request.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new instance is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new instance is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, update succeeds even if instance is not found. In
+     * that case, a new instance is created and `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000010); + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1beta.UpdateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.UpdateInstanceRequest) + private static final com.google.cloud.alloydb.v1beta.UpdateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.UpdateInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1beta.UpdateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateInstanceRequest 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.alloydb.v1beta.UpdateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..0715db12f2f8 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateInstanceRequestOrBuilder.java @@ -0,0 +1,190 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface UpdateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.UpdateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Instance resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.alloydb.v1beta.Instance getInstance(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1beta.InstanceOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the update
+   * request.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. If set to true, update succeeds even if instance is not found. In
+   * that case, a new instance is created and `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UserPassword.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UserPassword.java new file mode 100644 index 000000000000..70b759e921cc --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UserPassword.java @@ -0,0 +1,812 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * The username/password for a database user. Used for specifying initial
+ * users at cluster creation time.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.UserPassword} + */ +public final class UserPassword extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.UserPassword) + UserPasswordOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserPassword.newBuilder() to construct. + private UserPassword(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserPassword() { + user_ = ""; + password_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserPassword(); + } + + @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.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_UserPassword_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_UserPassword_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.UserPassword.class, + com.google.cloud.alloydb.v1beta.UserPassword.Builder.class); + } + + public static final int USER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object user_ = ""; + /** + * + * + *
+   * The database username.
+   * 
+ * + * string user = 1; + * + * @return The user. + */ + @java.lang.Override + public java.lang.String getUser() { + java.lang.Object ref = user_; + 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(); + user_ = s; + return s; + } + } + /** + * + * + *
+   * The database username.
+   * 
+ * + * string user = 1; + * + * @return The bytes for user. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + /** + * + * + *
+   * The initial password for the user.
+   * 
+ * + * string password = 2; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + 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(); + password_ = s; + return s; + } + } + /** + * + * + *
+   * The initial password for the user.
+   * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = 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(user_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, user_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); + } + 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(user_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, user_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); + } + 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.alloydb.v1beta.UserPassword)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.UserPassword other = + (com.google.cloud.alloydb.v1beta.UserPassword) obj; + + if (!getUser().equals(other.getUser())) return false; + if (!getPassword().equals(other.getPassword())) 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) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.UserPassword parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.UserPassword 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.alloydb.v1beta.UserPassword parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.UserPassword 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.alloydb.v1beta.UserPassword parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.UserPassword parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.UserPassword parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.UserPassword 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.alloydb.v1beta.UserPassword parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.UserPassword 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.alloydb.v1beta.UserPassword parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.UserPassword 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.alloydb.v1beta.UserPassword 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 username/password for a database user. Used for specifying initial
+   * users at cluster creation time.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.UserPassword} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.UserPassword) + com.google.cloud.alloydb.v1beta.UserPasswordOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_UserPassword_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_UserPassword_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.UserPassword.class, + com.google.cloud.alloydb.v1beta.UserPassword.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.UserPassword.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + user_ = ""; + password_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_UserPassword_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UserPassword getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.UserPassword.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UserPassword build() { + com.google.cloud.alloydb.v1beta.UserPassword result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UserPassword buildPartial() { + com.google.cloud.alloydb.v1beta.UserPassword result = + new com.google.cloud.alloydb.v1beta.UserPassword(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.UserPassword result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.user_ = user_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.password_ = password_; + } + } + + @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.alloydb.v1beta.UserPassword) { + return mergeFrom((com.google.cloud.alloydb.v1beta.UserPassword) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.UserPassword other) { + if (other == com.google.cloud.alloydb.v1beta.UserPassword.getDefaultInstance()) return this; + if (!other.getUser().isEmpty()) { + user_ = other.user_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000002; + 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: + { + user_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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 user_ = ""; + /** + * + * + *
+     * The database username.
+     * 
+ * + * string user = 1; + * + * @return The user. + */ + public java.lang.String getUser() { + java.lang.Object ref = user_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + user_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The database username.
+     * 
+ * + * string user = 1; + * + * @return The bytes for user. + */ + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The database username.
+     * 
+ * + * string user = 1; + * + * @param value The user to set. + * @return This builder for chaining. + */ + public Builder setUser(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The database username.
+     * 
+ * + * string user = 1; + * + * @return This builder for chaining. + */ + public Builder clearUser() { + user_ = getDefaultInstance().getUser(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The database username.
+     * 
+ * + * string user = 1; + * + * @param value The bytes for user to set. + * @return This builder for chaining. + */ + public Builder setUserBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + user_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + /** + * + * + *
+     * The initial password for the user.
+     * 
+ * + * string password = 2; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The initial password for the user.
+     * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The initial password for the user.
+     * 
+ * + * string password = 2; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The initial password for the user.
+     * 
+ * + * string password = 2; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The initial password for the user.
+     * 
+ * + * string password = 2; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000002; + 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.alloydb.v1beta.UserPassword) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.UserPassword) + private static final com.google.cloud.alloydb.v1beta.UserPassword DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.UserPassword(); + } + + public static com.google.cloud.alloydb.v1beta.UserPassword getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserPassword 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.alloydb.v1beta.UserPassword getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UserPasswordOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UserPasswordOrBuilder.java new file mode 100644 index 000000000000..f8b44de9647d --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UserPasswordOrBuilder.java @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface UserPasswordOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.UserPassword) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The database username.
+   * 
+ * + * string user = 1; + * + * @return The user. + */ + java.lang.String getUser(); + /** + * + * + *
+   * The database username.
+   * 
+ * + * string user = 1; + * + * @return The bytes for user. + */ + com.google.protobuf.ByteString getUserBytes(); + + /** + * + * + *
+   * The initial password for the user.
+   * 
+ * + * string password = 2; + * + * @return The password. + */ + java.lang.String getPassword(); + /** + * + * + *
+   * The initial password for the user.
+   * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/proto/google/cloud/alloydb/v1beta/resources.proto b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/proto/google/cloud/alloydb/v1beta/resources.proto new file mode 100644 index 000000000000..8f71c71fa2af --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/proto/google/cloud/alloydb/v1beta/resources.proto @@ -0,0 +1,1028 @@ +// 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.alloydb.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Beta"; +option go_package = "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.cloud.alloydb.v1beta"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1beta"; +option ruby_package = "Google::Cloud::AlloyDb::V1beta"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; + +// The supported database engine versions. +enum DatabaseVersion { + // This is an unknown database version. + DATABASE_VERSION_UNSPECIFIED = 0; + + // DEPRECATED - The database version is Postgres 13. + POSTGRES_13 = 1 [deprecated = true]; + + // The database version is Postgres 14. + POSTGRES_14 = 2; +} + +// View on Instance. Pass this enum to rpcs that returns an Instance message to +// control which subsets of fields to get. +enum InstanceView { + // INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + INSTANCE_VIEW_UNSPECIFIED = 0; + + // BASIC server responses for a primary or read instance include all the + // relevant instance details, excluding the details of each node in the + // instance. The default value. + INSTANCE_VIEW_BASIC = 1; + + // FULL response is equivalent to BASIC for primary instance (for now). + // For read pool instance, this includes details of each node in the pool. + INSTANCE_VIEW_FULL = 2; +} + +// The username/password for a database user. Used for specifying initial +// users at cluster creation time. +message UserPassword { + // The database username. + string user = 1; + + // The initial password for the user. + string password = 2; +} + +// Subset of the source instance configuration that is available when reading +// the cluster resource. +message MigrationSource { + // Denote the type of migration source that created this cluster. + enum MigrationSourceType { + // Migration source is unknown. + MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + + // DMS source means the cluster was created via DMS migration job. + DMS = 1; + } + + // Output only. The host and port of the on-premises instance in host:port + // format + string host_port = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Place holder for the external source identifier(e.g DMS job + // name) that created the cluster. + string reference_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Type of migration source. + MigrationSourceType source_type = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// EncryptionConfig describes the encryption config of a cluster or a backup +// that is encrypted with a CMEK (customer-managed encryption key). +message EncryptionConfig { + // The fully-qualified resource name of the KMS key. + // Each Cloud KMS key is regionalized and has the following format: + // projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + string kms_key_name = 1; +} + +// EncryptionInfo describes the encryption information of a cluster or a backup. +message EncryptionInfo { + // Possible encryption types. + enum Type { + // Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. + TYPE_UNSPECIFIED = 0; + + // The data is encrypted at rest with a key that is fully managed by Google. + // No key version will be populated. This is the default state. + GOOGLE_DEFAULT_ENCRYPTION = 1; + + // The data is encrypted at rest with a key that is managed by the customer. + // KMS key versions will be populated. + CUSTOMER_MANAGED_ENCRYPTION = 2; + } + + // Output only. Type of encryption. + Type encryption_type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud KMS key versions that are being used to protect the + // database or the backup. + repeated string kms_key_versions = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// SSL configuration for an AlloyDB Cluster. +message SslConfig { + // SSL mode options. + enum SslMode { + // SSL mode not specified. Defaults to SSL_MODE_ALLOW. + SSL_MODE_UNSPECIFIED = 0; + + // SSL connections are optional. CA verification not enforced. + SSL_MODE_ALLOW = 1; + + // SSL connections are required. CA verification not enforced. + // Clients may use locally self-signed certificates (default psql client + // behavior). + SSL_MODE_REQUIRE = 2; + + // SSL connections are required. CA verification enforced. + // Clients must have certificates signed by a Cluster CA, e.g. via + // GenerateClientCertificate. + SSL_MODE_VERIFY_CA = 3; + } + + // Certificate Authority (CA) source for SSL/TLS certificates. + enum CaSource { + // Certificate Authority (CA) source not specified. Defaults to + // CA_SOURCE_MANAGED. + CA_SOURCE_UNSPECIFIED = 0; + + // Certificate Authority (CA) managed by the AlloyDB Cluster. + CA_SOURCE_MANAGED = 1; + } + + // Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + SslMode ssl_mode = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + // supported currently, and is the default value. + CaSource ca_source = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message describing the user-specified automated backup policy. +// +// All fields in the automated backup policy are optional. Defaults for each +// field are provided if they are not set. +message AutomatedBackupPolicy { + // A weekly schedule starts a backup at prescribed start times within a + // day, for the specified days of the week. + // + // The weekly schedule message is flexible and can be used to create many + // types of schedules. For example, to have a daily backup that starts at + // 22:00, configure the `start_times` field to have one element "22:00" and + // the `days_of_week` field to have all seven days of the week. + message WeeklySchedule { + // The times during the day to start a backup. The start times are assumed + // to be in UTC and to be an exact hour (e.g., 04:00:00). + // + // If no start times are provided, a single fixed start time is chosen + // arbitrarily. + repeated google.type.TimeOfDay start_times = 1; + + // The days of the week to perform a backup. + // + // If this field is left empty, the default of every day of the week is + // used. + repeated google.type.DayOfWeek days_of_week = 2; + } + + // A time based retention policy specifies that all backups within a certain + // time period should be retained. + message TimeBasedRetention { + // The retention period. + google.protobuf.Duration retention_period = 1; + } + + // A quantity based policy specifies that a certain number of the most recent + // successful backups should be retained. + message QuantityBasedRetention { + // The number of backups to retain. + int32 count = 1; + } + + // The schedule for this automated backup policy. + // + // A schedule specifies times at which to start a backup. If a backup + // window is also provided, the backup is guaranteed to be started and + // completed within the start time plus the backup window. If the backup is + // not completed within the backup window it is marked as failed. + // + // If not set, the schedule defaults to a weekly schedule with one backup + // per day and a start time chosen arbitrarily. + oneof schedule { + // Weekly schedule for the Backup. + WeeklySchedule weekly_schedule = 2; + } + + // The retention policy for automated backups. + // + // The retention policy for a backup is fixed at the time the backup is + // created. Changes to this field only apply to new backups taken with the + // policy; the retentions of existing backups remain unchanged. + // + // If no retention policy is set, a default of 14 days is used. + oneof retention { + // Time-based Backup retention policy. + TimeBasedRetention time_based_retention = 4; + + // Quantity-based Backup retention policy to retain recent backups. + QuantityBasedRetention quantity_based_retention = 5; + } + + // Whether automated automated backups are enabled. If not set, defaults to + // true. + optional bool enabled = 1; + + // The length of the time window during which a backup can be + // taken. If a backup does not succeed within this time window, it will be + // canceled and considered failed. + // + // The backup window must be at least 5 minutes long. There is no upper bound + // on the window. If not set, it defaults to 1 hour. + google.protobuf.Duration backup_window = 3; + + // Optional. The encryption config can be specified to encrypt the + // backups with a customer-managed encryption key (CMEK). When this field is + // not specified, the backup will then use default encryption scheme to + // protect the user data. + EncryptionConfig encryption_config = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // The location where the backup will be stored. Currently, the only supported + // option is to store the backup in the same region as the cluster. + // + // If empty, defaults to the region of the cluster. + string location = 6; + + // Labels to apply to backups created using this configuration. + map labels = 7; +} + +// ContinuousBackupConfig describes the continuous backups recovery +// configurations of a cluster. +message ContinuousBackupConfig { + // Whether ContinuousBackup is enabled. + optional bool enabled = 1; + + // The number of days backups and logs will be retained, which determines the + // window of time that data is recoverable for. If not set, it defaults to 14 + // days. + int32 recovery_window_days = 4; + + // The encryption config can be specified to encrypt the + // backups with a customer-managed encryption key (CMEK). When this field is + // not specified, the backup will then use default encryption scheme to + // protect the user data. + EncryptionConfig encryption_config = 3; +} + +// ContinuousBackupInfo describes the continuous backup properties of a +// cluster. +message ContinuousBackupInfo { + // Output only. The encryption information for the WALs and backups required + // for ContinuousBackup. + EncryptionInfo encryption_info = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When ContinuousBackup was most recently enabled. Set to null + // if ContinuousBackup is not enabled. + google.protobuf.Timestamp enabled_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Days of the week on which a continuous backup is taken. Output + // only field. Ignored if passed into the request. + repeated google.type.DayOfWeek schedule = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message describing a BackupSource. +message BackupSource { + // Output only. The system-generated UID of the backup which was used to + // create this resource. The UID is generated when the backup is created, and + // it is retained until the backup is deleted. + string backup_uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The name of the backup resource with the format: + // * projects/{project}/locations/{region}/backups/{backup_id} + string backup_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; +} + +// Message describing a ContinuousBackupSource. +message ContinuousBackupSource { + // Required. The source cluster from which to restore. This cluster must have + // continuous backup enabled for this operation to succeed. For the required + // format, see the comment on the Cluster.name field. + string cluster = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The point in time to restore to. + google.protobuf.Timestamp point_in_time = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// A cluster is a collection of regional AlloyDB resources. It can include a +// primary instance and one or more read pool instances. +// All cluster resources share a storage layer, which scales as needed. +message Cluster { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Cluster" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}" + style: DECLARATIVE_FRIENDLY + }; + + // Configuration information for the secondary cluster. This should be set + // if and only if the cluster is of type SECONDARY. + message SecondaryConfig { + // The name of the primary cluster name with the format: + // * projects/{project}/locations/{region}/clusters/{cluster_id} + string primary_cluster_name = 1; + } + + // Configuration for the primary cluster. It has the list of clusters that are + // replicating from this cluster. This should be set if and only if the + // cluster is of type PRIMARY. + message PrimaryConfig { + // Output only. Names of the clusters that are replicating from this + // cluster. + repeated string secondary_cluster_names = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Cluster State + enum State { + // The state of the cluster is unknown. + STATE_UNSPECIFIED = 0; + + // The cluster is active and running. + READY = 1; + + // The cluster is stopped. All instances in the cluster are stopped. + // Customers can start a stopped cluster at any point and all their + // instances will come back to life with same names and IP resources. In + // this state, customer pays for storage. + // Associated backups could also be present in a stopped cluster. + STOPPED = 2; + + // The cluster is empty and has no associated resources. + // All instances, associated storage and backups have been deleted. + EMPTY = 3; + + // The cluster is being created. + CREATING = 4; + + // The cluster is being deleted. + DELETING = 5; + + // The creation of the cluster failed. + FAILED = 6; + + // The cluster is bootstrapping with data from some other source. + // Direct mutations to the cluster (e.g. adding read pool) are not allowed. + BOOTSTRAPPING = 7; + + // The cluster is under maintenance. AlloyDB regularly performs maintenance + // and upgrades on customer clusters. Updates on the cluster are + // not allowed while the cluster is in this state. + MAINTENANCE = 8; + + // The cluster is being promoted. + PROMOTING = 9; + } + + // Type of Cluster + enum ClusterType { + // The type of the cluster is unknown. + CLUSTER_TYPE_UNSPECIFIED = 0; + + // Primary cluster that support read and write operations. + PRIMARY = 1; + + // Secondary cluster that is replicating from another region. + // This only supports read. + SECONDARY = 2; + } + + // In case of an imported cluster, this field contains information about the + // source this cluster was imported from. + oneof source { + // Output only. Cluster created from backup. + BackupSource backup_source = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cluster created via DMS migration. + MigrationSource migration_source = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The name of the cluster resource with the format: + // * projects/{project}/locations/{region}/clusters/{cluster_id} + // where the cluster ID segment should satisfy the regex expression + // `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + // The prefix of the cluster resource name is the name of the parent resource: + // * projects/{project}/locations/{region} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Cluster. + string display_name = 2; + + // Output only. The system-generated UID of the resource. The UID is assigned + // when the resource is created, and it is retained until it is deleted. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 7; + + // Output only. The current serving state of the cluster. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of the cluster. This is an output-only field and it's + // populated at the Cluster creation time or the Cluster promotion + // time. The cluster type is determined by which RPC was used to create + // the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + ClusterType cluster_type = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The database engine major version. This is an output-only + // field and it's populated at the Cluster creation time. This field cannot be + // changed after cluster creation. + DatabaseVersion database_version = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The resource link for the VPC network in which cluster resources + // are created and from which they are accessible via Private IP. The network + // must belong to the same project as the cluster. It is specified in the + // form: "projects/{project_number}/global/networks/{network_id}". This is + // required to create a cluster. It can be updated, but it cannot be removed. + string network = 10 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 11; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 12; + + // Output only. Reconciling (https://google.aip.dev/128#reconciliation). + // Set to true if the current state of Cluster does not match the user's + // intended state, and the service is actively updating the resource to + // reconcile them. This can happen due to user-triggered updates or + // system actions like failover or maintenance. + bool reconciling = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Initial user to setup during cluster creation. Required. + // If used in `RestoreCluster` this is ignored. + UserPassword initial_user = 14 [(google.api.field_behavior) = INPUT_ONLY]; + + // The automated backup policy for this cluster. + // + // If no policy is provided then the default policy will be used. If backups + // are supported for the cluster, the default policy takes one backup a day, + // has a backup window of 1 hour, and retains backups for 14 days. + // For more information on the defaults, consult the + // documentation for the message type. + AutomatedBackupPolicy automated_backup_policy = 17; + + // SSL configuration for this AlloyDB Cluster. + SslConfig ssl_config = 18; + + // Optional. The encryption config can be specified to encrypt the data disks + // and other persistent data resources of a cluster with a + // customer-managed encryption key (CMEK). When this field is not + // specified, the cluster will then use default encryption scheme to + // protect the user data. + EncryptionConfig encryption_config = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The encryption information for the cluster. + EncryptionInfo encryption_info = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Continuous backup configuration for this cluster. + ContinuousBackupConfig continuous_backup_config = 27 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Continuous backup properties for this cluster. + ContinuousBackupInfo continuous_backup_info = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cross Region replication config specific to SECONDARY cluster. + SecondaryConfig secondary_config = 22; + + // Output only. Cross Region replication config specific to PRIMARY cluster. + PrimaryConfig primary_config = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// An Instance is a computing unit that an end customer can connect to. +// It's the main unit of computing resources in AlloyDB. +message Instance { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}" + style: DECLARATIVE_FRIENDLY + }; + + // MachineConfig describes the configuration of a machine. + message MachineConfig { + // The number of CPU's in the VM instance. + int32 cpu_count = 1; + } + + // Details of a single node in the instance. + // Nodes in an AlloyDB instance are ephemereal, they can change during + // update, failover, autohealing and resize operations. + message Node { + // The Compute Engine zone of the VM e.g. "us-central1-b". + string zone_id = 1; + + // The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + string id = 2; + + // The private IP address of the VM e.g. "10.57.0.34". + string ip = 3; + + // Determined by state of the compute VM and postgres-service health. + // Compute VM state can have values listed in + // https://cloud.google.com/compute/docs/instances/instance-life-cycle and + // postgres-service health can have values: HEALTHY and UNHEALTHY. + string state = 4; + } + + // QueryInsights Instance specific configuration. + message QueryInsightsInstanceConfig { + // Record application tags for an instance. + // This flag is turned "on" by default. + optional bool record_application_tags = 2; + + // Record client address for an instance. Client address is PII information. + // This flag is turned "on" by default. + optional bool record_client_address = 3; + + // Query string length. The default value is 1024. + // Any integer between 256 and 4500 is considered valid. + uint32 query_string_length = 4; + + // Number of query execution plans captured by Insights per minute + // for all queries combined. The default value is 5. + // Any integer between 0 and 20 is considered valid. + optional uint32 query_plans_per_minute = 5; + } + + // Configuration for a read pool instance. + message ReadPoolConfig { + // Read capacity, i.e. number of nodes in a read pool instance. + int32 node_count = 1; + } + + // Instance State + enum State { + // The state of the instance is unknown. + STATE_UNSPECIFIED = 0; + + // The instance is active and running. + READY = 1; + + // The instance is stopped. Instance name and IP resources are preserved. + STOPPED = 2; + + // The instance is being created. + CREATING = 3; + + // The instance is being deleted. + DELETING = 4; + + // The instance is down for maintenance. + MAINTENANCE = 5; + + // The creation of the instance failed or a fatal error occurred during + // an operation on the instance. + // Note: Instances in this state would tried to be auto-repaired. And + // Customers should be able to restart, update or delete these instances. + FAILED = 6; + + // Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that + // index unused in case that state also needs to exposed via consumer apis + // in future. + // The instance has been configured to sync data from some other source. + BOOTSTRAPPING = 8; + + // The instance is being promoted. + PROMOTING = 9; + } + + // Type of an Instance + enum InstanceType { + // The type of the instance is unknown. + INSTANCE_TYPE_UNSPECIFIED = 0; + + // PRIMARY instances support read and write operations. + PRIMARY = 1; + + // READ POOL instances support read operations only. Each read pool instance + // consists of one or more homogeneous nodes. + // * Read pool of size 1 can only have zonal availability. + // * Read pools with node count of 2 or more can have regional + // availability (nodes are present in 2 or more zones in a region). + READ_POOL = 2; + + // SECONDARY instances support read operations only. SECONDARY instance + // is a cross-region read replica + SECONDARY = 3; + } + + // The Availability type of an instance. Potential values: + //
ZONAL: The instance serves data from only one zone. + // Outages in that zone affect instance availability. + //
REGIONAL: The instance can serve data from more than one zone + // in a region (it is highly available). + enum AvailabilityType { + // This is an unknown Availability type. + AVAILABILITY_TYPE_UNSPECIFIED = 0; + + // Zonal available instance. + ZONAL = 1; + + // Regional (or Highly) available instance. + REGIONAL = 2; + } + + // Output only. The name of the instance resource with the format: + // * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} + // where the cluster and instance ID segments should satisfy the regex + // expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + // lowercase letters, numbers, and dashes, starting with a letter, and ending + // with a letter or number. For more details see https://google.aip.dev/122. + // The prefix of the instance resource name is the name of the parent + // resource: + // * projects/{project}/locations/{region}/clusters/{cluster_id} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Instance. + string display_name = 2; + + // Output only. The system-generated UID of the resource. The UID is assigned + // when the resource is created, and it is retained until it is deleted. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 7; + + // Output only. The current serving state of the instance. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The type of the instance. Specified at creation time. + InstanceType instance_type = 9 [(google.api.field_behavior) = REQUIRED]; + + // Configurations for the machines that host the underlying + // database engine. + MachineConfig machine_config = 10; + + // Availability type of an Instance. + // Defaults to REGIONAL for both primary and read instances. + // Note that primary and read instances can have different availability types. + AvailabilityType availability_type = 11; + + // The Compute Engine zone that the instance should serve from, per + // https://cloud.google.com/compute/docs/regions-zones + // This can ONLY be specified for ZONAL instances. + // If present for a REGIONAL instance, an error will be thrown. + // If this is absent for a ZONAL instance, instance is created in a random + // zone with available capacity. + string gce_zone = 12; + + // Database flags. Set at instance level. + // * They are copied from primary instance on read instance creation. + // * Read instances can set new or override existing flags that are relevant + // for reads, e.g. for enabling columnar cache on a read instance. Flags + // set on read instance may or may not be present on primary. + // + // + // This is a list of "key": "value" pairs. + // "key": The name of the flag. These flags are passed at instance setup time, + // so include both server options and system variables for Postgres. Flags are + // specified with underscores, not hyphens. + // "value": The value of the flag. Booleans are set to **on** for true + // and **off** for false. This field must be omitted if the flag + // doesn't take a value. + map database_flags = 13; + + // Output only. This is set for the read-write VM of the PRIMARY instance + // only. + Node writable_node = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of available read-only VMs in this instance, including + // the standby for a PRIMARY instance. + repeated Node nodes = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration for query insights. + QueryInsightsInstanceConfig query_insights_config = 21; + + // Read pool specific config. + ReadPoolConfig read_pool_config = 14; + + // Output only. The IP address for the Instance. + // This is the connection endpoint for an end-user application. + string ip_address = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reconciling (https://google.aip.dev/128#reconciliation). + // Set to true if the current state of Instance does not match the user's + // intended state, and the service is actively updating the resource to + // reconcile them. This can happen due to user-triggered updates or + // system actions like failover or maintenance. + bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 17; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 18; +} + +// ConnectionInfo singleton resource. +// https://google.aip.dev/156 +message ConnectionInfo { + option (google.api.resource) = { + type: "alloydb.googleapis.com/ConnectionInfo" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo" + }; + + // The name of the ConnectionInfo singleton resource, e.g.: + // projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + // This field currently has no semantic meaning. + string name = 1; + + // Output only. The IP address for the Instance. + // This is the connection endpoint for an end-user application. + string ip_address = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The pem-encoded chain that may be used to verify the X.509 + // certificate. Expected to be in issuer-to-root order according to RFC 5246. + repeated string pem_certificate_chain = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The unique ID of the Instance. + string instance_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message describing Backup object +message Backup { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backups/{backup}" + style: DECLARATIVE_FRIENDLY + }; + + // Backup State + enum State { + // The state of the backup is unknown. + STATE_UNSPECIFIED = 0; + + // The backup is ready. + READY = 1; + + // The backup is creating. + CREATING = 2; + + // The backup failed. + FAILED = 3; + + // The backup is being deleted. + DELETING = 4; + } + + // Backup Type + enum Type { + // Backup Type is unknown. + TYPE_UNSPECIFIED = 0; + + // ON_DEMAND backups that were triggered by the customer (e.g., not + // AUTOMATED). + ON_DEMAND = 1; + + // AUTOMATED backups triggered by the automated backups scheduler pursuant + // to an automated backup policy. + AUTOMATED = 2; + + // CONTINUOUS backups triggered by the automated backups scheduler + // due to a continuous backup policy. + CONTINUOUS = 3; + } + + // Output only. The name of the backup resource with the format: + // * projects/{project}/locations/{region}/backups/{backup_id} + // where the cluster and backup ID segments should satisfy the regex + // expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + // lowercase letters, numbers, and dashes, starting with a letter, and ending + // with a letter or number. For more details see https://google.aip.dev/122. + // The prefix of the backup resource name is the name of the parent + // resource: + // * projects/{project}/locations/{region} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Backup. + string display_name = 2; + + // Output only. The system-generated UID of the resource. The UID is assigned + // when the resource is created, and it is retained until it is deleted. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 6; + + // Output only. The current state of the backup. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The backup type, which suggests the trigger for the backup. + Type type = 8; + + // User-provided description of the backup. + string description = 9; + + // Output only. The system-generated UID of the cluster which was used to + // create this resource. + string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The full resource name of the backup source cluster + // (e.g., projects//locations//clusters/). + string cluster_name = 10 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + // true, indicates that the service is actively updating the resource. This + // can happen due to user-triggered updates or system actions like failover or + // maintenance. + bool reconciling = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The encryption config can be specified to encrypt the + // backup with a customer-managed encryption key (CMEK). When this field is + // not specified, the backup will then use default encryption scheme to + // protect the user data. + EncryptionConfig encryption_config = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The encryption information for the backup. + EncryptionInfo encryption_info = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 14; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 16; + + // Output only. The size of the backup in bytes. + int64 size_bytes = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which after the backup is eligible to be garbage + // collected. It is the duration specified by the backup's retention policy, + // added to the backup's create_time. + google.protobuf.Timestamp expiry_time = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// SupportedDatabaseFlag gives general information about a database flag, +// like type and allowed values. This is a static value that is defined +// on the server side, and it cannot be modified by callers. +// To set the Database flags on a particular Instance, a caller should modify +// the Instance.database_flags field. +message SupportedDatabaseFlag { + option (google.api.resource) = { + type: "alloydb.googleapis.com/SupportedDatabaseFlag" + pattern: "projects/{project}/locations/{location}/flags/{flag}" + }; + + // Restrictions on STRING type values + message StringRestrictions { + // The list of allowed values, if bounded. This field will be empty + // if there is a unbounded number of allowed values. + repeated string allowed_values = 1; + } + + // Restrictions on INTEGER type values. + message IntegerRestrictions { + // The minimum value that can be specified, if applicable. + google.protobuf.Int64Value min_value = 1; + + // The maximum value that can be specified, if applicable. + google.protobuf.Int64Value max_value = 2; + } + + // ValueType describes the semantic type of the value that the flag accepts. + // Regardless of the ValueType, the Instance.database_flags field accepts the + // stringified version of the value, i.e. "20" or "3.14". + enum ValueType { + // This is an unknown flag type. + VALUE_TYPE_UNSPECIFIED = 0; + + // String type flag. + STRING = 1; + + // Integer type flag. + INTEGER = 2; + + // Float type flag. + FLOAT = 3; + + // Denotes that the flag does not accept any values. + NONE = 4; + } + + // The restrictions on the flag value per type. + oneof restrictions { + // Restriction on STRING type value. + StringRestrictions string_restrictions = 7; + + // Restriction on INTEGER type value. + IntegerRestrictions integer_restrictions = 8; + } + + // The name of the flag resource, following Google Cloud conventions, e.g.: + // * projects/{project}/locations/{location}/flags/{flag} + // This field currently has no semantic meaning. + string name = 1; + + // The name of the database flag, e.g. "max_allowed_packets". + // The is a possibly key for the Instance.database_flags map field. + string flag_name = 2; + + ValueType value_type = 3; + + // Whether the database flag accepts multiple values. If true, + // a comma-separated list of stringified values may be specified. + bool accepts_multiple_values = 4; + + // Major database engine versions for which this flag is supported. + repeated DatabaseVersion supported_db_versions = 5; + + // Whether setting or updating this flag on an Instance requires a database + // restart. If a flag that requires database restart is set, the backend + // will automatically restart the database (making sure to satisfy any + // availability SLO's). + bool requires_db_restart = 6; +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/proto/google/cloud/alloydb/v1beta/service.proto b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/proto/google/cloud/alloydb/v1beta/service.proto new file mode 100644 index 000000000000..4b081d95bf6c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/proto/google/cloud/alloydb/v1beta/service.proto @@ -0,0 +1,1329 @@ +// 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.alloydb.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/alloydb/v1beta/resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Beta"; +option go_package = "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.alloydb.v1beta"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1beta"; +option ruby_package = "Google::Cloud::AlloyDb::V1beta"; + +// Service describing handlers for resources +service AlloyDBAdmin { + option (google.api.default_host) = "alloydb.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Clusters in a given project and location. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*}/clusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Cluster in a given project and location. + rpc CreateCluster(CreateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/clusters" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Cluster. + rpc UpdateCluster(UpdateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta/{cluster.name=projects/*/locations/*/clusters/*}" + body: "cluster" + }; + option (google.api.method_signature) = "cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Cluster. + rpc DeleteCluster(DeleteClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Promotes a SECONDARY cluster. This turns down replication + // from the PRIMARY cluster and promotes a secondary cluster + // into its own standalone cluster. + // Imperative only. + rpc PromoteCluster(PromoteClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/clusters/*}:promote" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new Cluster in a given project and location, with a volume + // restored from the provided source, either a backup ID or a point-in-time + // and a source cluster. + rpc RestoreCluster(RestoreClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/clusters:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Creates a cluster of type SECONDARY in the given location using + // the primary cluster as the source. + rpc CreateSecondaryCluster(CreateSecondaryClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/clusters:createsecondary" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Lists Instances in a given project and location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Instance in a given project and location. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new SECONDARY Instance in a given project and location. + rpc CreateSecondaryInstance(CreateSecondaryInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Creates new instances under the given project, location and cluster. + // There can be only one primary instance in a cluster. If the primary + // instance exists in the cluster as well as this request, then API will + // throw an error. + // The primary instance should exist before any read pool instance is + // created. If the primary instance is a part of the request payload, then + // the API will take care of creating instances in the correct order. + // This method is here to support Google-internal use cases, and is not meant + // for external customers to consume. Please do not start relying on it; its + // behavior is subject to change without notice. + rpc BatchCreateInstances(BatchCreateInstancesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate" + body: "requests" + }; + option (google.longrunning.operation_info) = { + response_type: "BatchCreateInstancesResponse" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Instance. + rpc UpdateInstance(UpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta/{instance.name=projects/*/locations/*/clusters/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Instance. + rpc DeleteInstance(DeleteInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Forces a Failover for a highly available instance. + // Failover promotes the HA standby instance as the new primary. + // Imperative only. + rpc FailoverInstance(FailoverInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:failover" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Restart an Instance in a cluster. + // Imperative only. + rpc RestartInstance(RestartInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:restart" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Lists Backups in a given project and location. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Backup in a given project and location. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup,backup_id"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Backup. + rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta/{backup.name=projects/*/locations/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists SupportedDatabaseFlags for a given project and location. + rpc ListSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest) + returns (ListSupportedDatabaseFlagsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags" + }; + option (google.api.method_signature) = "parent"; + } + + // Generate a client certificate signed by a Cluster CA. + // The sole purpose of this endpoint is to support the Auth Proxy client and + // the endpoint's behavior is subject to change without notice, so do not rely + // on its behavior remaining constant. Future changes will not break the Auth + // Proxy client. + rpc GenerateClientCertificate(GenerateClientCertificateRequest) + returns (GenerateClientCertificateResponse) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Get instance metadata used for a connection. + rpc GetConnectionInfo(GetConnectionInfoRequest) returns (ConnectionInfo) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Message for requesting list of Clusters +message ListClustersRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Cluster.name field. Additionally, you can perform an + // aggregated list operation by specifying a value with the following format: + // * projects/{project}/locations/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Clusters +message ListClustersResponse { + // The list of Cluster + repeated Cluster clusters = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Cluster +message GetClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; +} + +message CreateSecondaryClusterRequest { + // Required. The name of the parent resource (the primary cluster). For the + // required format, see the comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object (the secondary cluster). + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Configuration of the requesting object (the secondary cluster). + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the create + // request. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating a Cluster +message CreateClusterRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the create + // request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Cluster +message UpdateClusterRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Cluster resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Cluster cluster = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the update + // request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, update succeeds even if cluster is not found. In + // that case, a new cluster is created and `update_mask` is ignored. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Cluster +message DeleteClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the Cluster. + // If an etag is provided and does not match the current etag of the Cluster, + // deletion will be blocked and an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to cascade delete child instances for given cluster. + bool force = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for promoting a Cluster +message PromoteClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the Cluster. + // If an etag is provided and does not match the current etag of the Cluster, + // deletion will be blocked and an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for restoring a Cluster from a backup or another cluster at a given +// point in time. +message RestoreClusterRequest { + // Required. + // The source to import from. + oneof source { + // Backup source. + BackupSource backup_source = 4; + + // ContinuousBackup source. Continuous backup needs to be enabled in the + // source cluster for this operation to succeed. + ContinuousBackupSource continuous_backup_source = 8; + } + + // Required. The name of the parent resource. For the required format, see the + // comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the import + // request. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Instances +message ListInstancesRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. Additionally, you can perform an + // aggregated list operation by specifying a value with one of the following + // formats: + // * projects/{project}/locations/-/clusters/- + // * projects/{project}/locations/{region}/clusters/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Instances +message ListInstancesResponse { + // The list of Instance + repeated Instance instances = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Instance +message GetInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // The view of the instance to return. + InstanceView view = 2; +} + +// Message for creating a Instance +message CreateInstanceRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. ID of the requesting object. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the create + // request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating a Secondary Instance +message CreateSecondaryInstanceRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. ID of the requesting object. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the create + // request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// See usage below for notes. +message CreateInstanceRequests { + // Required. Primary and read replica instances to be created. This list + // should not be empty. + repeated CreateInstanceRequest create_instance_requests = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Message for creating a batch of instances under the specified cluster. +message BatchCreateInstancesRequest { + // Required. The name of the parent resource. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. Resources being created. + CreateInstanceRequests requests = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating batches of instances in a cluster. +message BatchCreateInstancesResponse { + // Created instances. + repeated Instance instances = 1; +} + +// Message for metadata that is specific to BatchCreateInstances API. +message BatchCreateInstancesMetadata { + // The instances being created in the API call. Each string in this list + // is the server defined resource path for target instances in the request + // and for the format of each string, see the comment on the Instance.name + // field. + repeated string instance_targets = 1; + + // A map representing state of the instances involved in the + // BatchCreateInstances operation during the operation execution. + // The instance state will be in STATE_UNSPECIFIED state if the instance has + // not yet been picked up for processing. + // The key of the map is the name of the instance resource. + // For the format, see the comment on the Instance.name field. + map instance_statuses = 2; +} + +// Message for current status of an instance in the BatchCreateInstances +// operation. +// For example, lets say a BatchCreateInstances workflow has 4 instances, +// Instance1 through Instance4. Lets also assume that 2 instances succeeded +// but the third failed to create and the 4th was never picked up for creation +// because of failure of the previous one. Then, resulting states would look +// something like: +// 1. Instance1 = ROLLED_BACK +// 2. Instance2 = ROLLED_BACK +// 3. Instance3 = FAILED +// 4. Instance4 = FAILED +// However, while the operation is running, the instance might be in other +// states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states +// / do not get further updated once the operation is done. +message BatchCreateInstanceStatus { + // State contains all valid instance states for the BatchCreateInstances + // operation. This is mainly used for status reporting through the LRO + // metadata. + enum State { + // The state of the instance is unknown. + STATE_UNSPECIFIED = 0; + + // Instance is pending creation and has not yet been picked up for + // processsing in the backend. + PENDING_CREATE = 1; + + // The instance is active and running. + READY = 2; + + // The instance is being created. + CREATING = 3; + + // The instance is being deleted. + DELETING = 4; + + // The creation of the instance failed or a fatal error occurred during + // an operation on the instance or a batch of instances. + FAILED = 5; + + // The instance was created successfully, but was rolled back and deleted + // due to some other failure during BatchCreateInstances operation. + ROLLED_BACK = 6; + } + + // The current state of an instance involved in the batch create operation. + // Once the operation is complete, the final state of the instances in the + // LRO can be one of: + // 1. ACTIVE, indicating that instances were created successfully + // 2. FAILED, indicating that a particular instance failed creation + // 3. ROLLED_BACK indicating that although the instance was created + // successfully, it had to be rolled back and deleted due to failure in + // other steps of the workflow. + State state = 1; + + // DEPRECATED - Use the error field instead. + // Error, if any error occurred and is available, during instance creation. + string error_msg = 2; + + // The RPC status of the instance creation operation. This field will be + // present if an error happened during the instance creation. + google.rpc.Status error = 4; + + Instance.InstanceType type = 3; +} + +// Message for updating a Instance +message UpdateInstanceRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Instance resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the update + // request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, update succeeds even if instance is not found. In + // that case, a new instance is created and `update_mask` is ignored. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Instance +message DeleteInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the Instance. + // If an etag is provided and does not match the current etag of the Instance, + // deletion will be blocked and an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for triggering failover on an Instance +message FailoverInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the failover. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +message RestartInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the restart. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Backups +message ListBackupsRequest { + // Required. Parent value for ListBackupsRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Backup" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results + string filter = 4; + + // Hint for how to order the results + string order_by = 5; +} + +// Message for response to listing Backups +message ListBackupsResponse { + // The list of Backup + repeated Backup backups = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Backup +message GetBackupRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; +} + +// Message for creating a Backup +message CreateBackupRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Backup" + } + ]; + + // Required. ID of the requesting object. + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Backup +message UpdateBackupRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Backup resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, update succeeds even if instance is not found. In + // that case, a new backup is created and `update_mask` is ignored. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Backup +message DeleteBackupRequest { + // Required. Name of the resource. For the required format, see the comment on + // the Backup.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the Backup. + // If an etag is provided and does not match the current etag of the Backup, + // deletion will be blocked and an ABORTED error will be returned. + string etag = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for listing the information about the supported Database flags. +message ListSupportedDatabaseFlagsRequest { + // Required. The name of the parent resource. The required format is: + // * projects/{project}/locations/{location} + // + // Regardless of the parent specified here, as long it is contains a valid + // project and location, the service will return a static list of supported + // flags resources. Note that we do not yet support region-specific + // flags. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/SupportedDatabaseFlag" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; +} + +// Message for response to listing SupportedDatabaseFlags. +message ListSupportedDatabaseFlagsResponse { + // The list of SupportedDatabaseFlags. + repeated SupportedDatabaseFlag supported_database_flags = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; +} + +// Message for requests to generate a client certificate signed by the Cluster +// CA. +message GenerateClientCertificateRequest { + // Required. The name of the parent resource. The required format is: + // * projects/{project}/locations/{location}/clusters/{cluster} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pem-encoded X.509 certificate signing request (CSR). + string pem_csr = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional hint to the endpoint to generate the client + // certificate with the requested duration. The duration can be from 1 hour to + // 24 hours. The endpoint may or may not honor the hint. If the hint is left + // unspecified or is not honored, then the endpoint will pick an appropriate + // default duration. + google.protobuf.Duration cert_duration = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Message returned by a GenerateClientCertificate operation. +message GenerateClientCertificateResponse { + // Output only. The pem-encoded, signed X.509 certificate. + string pem_certificate = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The pem-encoded chain that may be used to verify the X.509 + // certificate. Expected to be in issuer-to-root order according to RFC 5246. + repeated string pem_certificate_chain = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for GetConnectionInfo. +message GetConnectionInfoRequest { + // Required. The name of the parent resource. The required format is: + // projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Request specific metadata, if any. + oneof request_specific { + // Output only. BatchCreateInstances related metadata. + BatchCreateInstancesMetadata batch_create_instances_metadata = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstances.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstances.java new file mode 100644 index 000000000000..cadc62723123 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstances.java @@ -0,0 +1,53 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.CreateInstanceRequests; +import com.google.longrunning.Operation; + +public class AsyncBatchCreateInstances { + + public static void main(String[] args) throws Exception { + asyncBatchCreateInstances(); + } + + public static void asyncBatchCreateInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + alloyDBAdminClient.batchCreateInstancesCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstancesLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstancesLRO.java new file mode 100644 index 000000000000..a18a38309580 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstancesLRO.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.CreateInstanceRequests; +import com.google.cloud.alloydb.v1.OperationMetadata; + +public class AsyncBatchCreateInstancesLRO { + + public static void main(String[] args) throws Exception { + asyncBatchCreateInstancesLRO(); + } + + public static void asyncBatchCreateInstancesLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + alloyDBAdminClient.batchCreateInstancesOperationCallable().futureCall(request); + // Do something. + BatchCreateInstancesResponse response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/batchcreateinstances/SyncBatchCreateInstances.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/batchcreateinstances/SyncBatchCreateInstances.java new file mode 100644 index 000000000000..205cd9778b36 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/batchcreateinstances/SyncBatchCreateInstances.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.CreateInstanceRequests; + +public class SyncBatchCreateInstances { + + public static void main(String[] args) throws Exception { + syncBatchCreateInstances(); + } + + public static void syncBatchCreateInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + BatchCreateInstancesResponse response = + alloyDBAdminClient.batchCreateInstancesAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/create/SyncCreateSetCredentialsProvider.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..ccc77c9906a5 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.AlloyDBAdminSettings; +import com.google.cloud.alloydb.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AlloyDBAdminSettings alloyDBAdminSettings = + AlloyDBAdminSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings); + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_Create_SetCredentialsProvider_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/create/SyncCreateSetCredentialsProvider1.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..d89c0a8e26a2 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,39 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_Create_SetCredentialsProvider1_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.AlloyDBAdminSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AlloyDBAdminSettings alloyDBAdminSettings = AlloyDBAdminSettings.newHttpJsonBuilder().build(); + AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings); + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_Create_SetCredentialsProvider1_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/create/SyncCreateSetEndpoint.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..938b68d08ef0 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_Create_SetEndpoint_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.AlloyDBAdminSettings; +import com.google.cloud.alloydb.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AlloyDBAdminSettings alloyDBAdminSettings = + AlloyDBAdminSettings.newBuilder().setEndpoint(myEndpoint).build(); + AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings); + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_Create_SetEndpoint_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createbackup/AsyncCreateBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createbackup/AsyncCreateBackup.java new file mode 100644 index 000000000000..7bda9a474af1 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createbackup/AsyncCreateBackup.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.CreateBackupRequest; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateBackup { + + public static void main(String[] args) throws Exception { + asyncCreateBackup(); + } + + public static void asyncCreateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBackupId("backupId2121930365") + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.createBackupCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateBackup_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createbackup/AsyncCreateBackupLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createbackup/AsyncCreateBackupLRO.java new file mode 100644 index 000000000000..c036178a0990 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createbackup/AsyncCreateBackupLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateBackup_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.CreateBackupRequest; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.cloud.alloydb.v1.OperationMetadata; + +public class AsyncCreateBackupLRO { + + public static void main(String[] args) throws Exception { + asyncCreateBackupLRO(); + } + + public static void asyncCreateBackupLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBackupId("backupId2121930365") + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.createBackupOperationCallable().futureCall(request); + // Do something. + Backup response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateBackup_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createbackup/SyncCreateBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createbackup/SyncCreateBackup.java new file mode 100644 index 000000000000..0e8633aaca38 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createbackup/SyncCreateBackup.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateBackup_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.CreateBackupRequest; +import com.google.cloud.alloydb.v1.LocationName; + +public class SyncCreateBackup { + + public static void main(String[] args) throws Exception { + syncCreateBackup(); + } + + public static void syncCreateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBackupId("backupId2121930365") + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Backup response = alloyDBAdminClient.createBackupAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateBackup_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createbackup/SyncCreateBackupLocationnameBackupString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createbackup/SyncCreateBackupLocationnameBackupString.java new file mode 100644 index 000000000000..6991dc2f117a --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createbackup/SyncCreateBackupLocationnameBackupString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateBackup_LocationnameBackupString_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.LocationName; + +public class SyncCreateBackupLocationnameBackupString { + + public static void main(String[] args) throws Exception { + syncCreateBackupLocationnameBackupString(); + } + + public static void syncCreateBackupLocationnameBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + Backup response = alloyDBAdminClient.createBackupAsync(parent, backup, backupId).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateBackup_LocationnameBackupString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createbackup/SyncCreateBackupStringBackupString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createbackup/SyncCreateBackupStringBackupString.java new file mode 100644 index 000000000000..bcec57e4f15c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createbackup/SyncCreateBackupStringBackupString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateBackup_StringBackupString_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.LocationName; + +public class SyncCreateBackupStringBackupString { + + public static void main(String[] args) throws Exception { + syncCreateBackupStringBackupString(); + } + + public static void syncCreateBackupStringBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + Backup response = alloyDBAdminClient.createBackupAsync(parent, backup, backupId).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateBackup_StringBackupString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createcluster/AsyncCreateCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createcluster/AsyncCreateCluster.java new file mode 100644 index 000000000000..3c3ea8f64a1c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createcluster/AsyncCreateCluster.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.CreateClusterRequest; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateCluster { + + public static void main(String[] args) throws Exception { + asyncCreateCluster(); + } + + public static void asyncCreateCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.createClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createcluster/AsyncCreateClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createcluster/AsyncCreateClusterLRO.java new file mode 100644 index 000000000000..355b4adbd9cb --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createcluster/AsyncCreateClusterLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.CreateClusterRequest; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.cloud.alloydb.v1.OperationMetadata; + +public class AsyncCreateClusterLRO { + + public static void main(String[] args) throws Exception { + asyncCreateClusterLRO(); + } + + public static void asyncCreateClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.createClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createcluster/SyncCreateCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createcluster/SyncCreateCluster.java new file mode 100644 index 000000000000..c031560771a7 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createcluster/SyncCreateCluster.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateCluster_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.CreateClusterRequest; +import com.google.cloud.alloydb.v1.LocationName; + +public class SyncCreateCluster { + + public static void main(String[] args) throws Exception { + syncCreateCluster(); + } + + public static void syncCreateCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Cluster response = alloyDBAdminClient.createClusterAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createcluster/SyncCreateClusterLocationnameClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createcluster/SyncCreateClusterLocationnameClusterString.java new file mode 100644 index 000000000000..23883a29af14 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createcluster/SyncCreateClusterLocationnameClusterString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateCluster_LocationnameClusterString_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.LocationName; + +public class SyncCreateClusterLocationnameClusterString { + + public static void main(String[] args) throws Exception { + syncCreateClusterLocationnameClusterString(); + } + + public static void syncCreateClusterLocationnameClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = alloyDBAdminClient.createClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateCluster_LocationnameClusterString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createcluster/SyncCreateClusterStringClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createcluster/SyncCreateClusterStringClusterString.java new file mode 100644 index 000000000000..6e69b40dbd5b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createcluster/SyncCreateClusterStringClusterString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateCluster_StringClusterString_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.LocationName; + +public class SyncCreateClusterStringClusterString { + + public static void main(String[] args) throws Exception { + syncCreateClusterStringClusterString(); + } + + public static void syncCreateClusterStringClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = alloyDBAdminClient.createClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateCluster_StringClusterString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createinstance/AsyncCreateInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createinstance/AsyncCreateInstance.java new file mode 100644 index 000000000000..c793747e793b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createinstance/AsyncCreateInstance.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.CreateInstanceRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.longrunning.Operation; + +public class AsyncCreateInstance { + + public static void main(String[] args) throws Exception { + asyncCreateInstance(); + } + + public static void asyncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.createInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createinstance/AsyncCreateInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createinstance/AsyncCreateInstanceLRO.java new file mode 100644 index 000000000000..8566211cbd19 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createinstance/AsyncCreateInstanceLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.CreateInstanceRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.OperationMetadata; + +public class AsyncCreateInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncCreateInstanceLRO(); + } + + public static void asyncCreateInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.createInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createinstance/SyncCreateInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createinstance/SyncCreateInstance.java new file mode 100644 index 000000000000..9363701dd462 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createinstance/SyncCreateInstance.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateInstance_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.CreateInstanceRequest; +import com.google.cloud.alloydb.v1.Instance; + +public class SyncCreateInstance { + + public static void main(String[] args) throws Exception { + syncCreateInstance(); + } + + public static void syncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Instance response = alloyDBAdminClient.createInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createinstance/SyncCreateInstanceClusternameInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createinstance/SyncCreateInstanceClusternameInstanceString.java new file mode 100644 index 000000000000..934b86d037d1 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createinstance/SyncCreateInstanceClusternameInstanceString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateInstance_ClusternameInstanceString_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.Instance; + +public class SyncCreateInstanceClusternameInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateInstanceClusternameInstanceString(); + } + + public static void syncCreateInstanceClusternameInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = + alloyDBAdminClient.createInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateInstance_ClusternameInstanceString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createinstance/SyncCreateInstanceStringInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createinstance/SyncCreateInstanceStringInstanceString.java new file mode 100644 index 000000000000..af3ea2778f82 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createinstance/SyncCreateInstanceStringInstanceString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateInstance_StringInstanceString_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.Instance; + +public class SyncCreateInstanceStringInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateInstanceStringInstanceString(); + } + + public static void syncCreateInstanceStringInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = + alloyDBAdminClient.createInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateInstance_StringInstanceString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletebackup/AsyncDeleteBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletebackup/AsyncDeleteBackup.java new file mode 100644 index 000000000000..306462b3eca6 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletebackup/AsyncDeleteBackup.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.BackupName; +import com.google.cloud.alloydb.v1.DeleteBackupRequest; +import com.google.longrunning.Operation; + +public class AsyncDeleteBackup { + + public static void main(String[] args) throws Exception { + asyncDeleteBackup(); + } + + public static void asyncDeleteBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + ApiFuture future = alloyDBAdminClient.deleteBackupCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletebackup/AsyncDeleteBackupLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletebackup/AsyncDeleteBackupLRO.java new file mode 100644 index 000000000000..a46a0078b5f0 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletebackup/AsyncDeleteBackupLRO.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.BackupName; +import com.google.cloud.alloydb.v1.DeleteBackupRequest; +import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteBackupLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteBackupLRO(); + } + + public static void asyncDeleteBackupLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + OperationFuture future = + alloyDBAdminClient.deleteBackupOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletebackup/SyncDeleteBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletebackup/SyncDeleteBackup.java new file mode 100644 index 000000000000..f34b445eaeb9 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletebackup/SyncDeleteBackup.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.BackupName; +import com.google.cloud.alloydb.v1.DeleteBackupRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteBackup { + + public static void main(String[] args) throws Exception { + syncDeleteBackup(); + } + + public static void syncDeleteBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + alloyDBAdminClient.deleteBackupAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletebackup/SyncDeleteBackupBackupname.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletebackup/SyncDeleteBackupBackupname.java new file mode 100644 index 000000000000..646a677114a6 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletebackup/SyncDeleteBackupBackupname.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_Backupname_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.BackupName; +import com.google.protobuf.Empty; + +public class SyncDeleteBackupBackupname { + + public static void main(String[] args) throws Exception { + syncDeleteBackupBackupname(); + } + + public static void syncDeleteBackupBackupname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + alloyDBAdminClient.deleteBackupAsync(name).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_Backupname_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletebackup/SyncDeleteBackupString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletebackup/SyncDeleteBackupString.java new file mode 100644 index 000000000000..a125ec785b56 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletebackup/SyncDeleteBackupString.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.BackupName; +import com.google.protobuf.Empty; + +public class SyncDeleteBackupString { + + public static void main(String[] args) throws Exception { + syncDeleteBackupString(); + } + + public static void syncDeleteBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString(); + alloyDBAdminClient.deleteBackupAsync(name).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletecluster/AsyncDeleteCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletecluster/AsyncDeleteCluster.java new file mode 100644 index 000000000000..799598f505dd --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletecluster/AsyncDeleteCluster.java @@ -0,0 +1,53 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.DeleteClusterRequest; +import com.google.longrunning.Operation; + +public class AsyncDeleteCluster { + + public static void main(String[] args) throws Exception { + asyncDeleteCluster(); + } + + public static void asyncDeleteCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .setForce(true) + .build(); + ApiFuture future = alloyDBAdminClient.deleteClusterCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletecluster/AsyncDeleteClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletecluster/AsyncDeleteClusterLRO.java new file mode 100644 index 000000000000..8ff40602042a --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletecluster/AsyncDeleteClusterLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.DeleteClusterRequest; +import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteClusterLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteClusterLRO(); + } + + public static void asyncDeleteClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .setForce(true) + .build(); + OperationFuture future = + alloyDBAdminClient.deleteClusterOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletecluster/SyncDeleteCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletecluster/SyncDeleteCluster.java new file mode 100644 index 000000000000..f6d187ca5019 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletecluster/SyncDeleteCluster.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.DeleteClusterRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteCluster { + + public static void main(String[] args) throws Exception { + syncDeleteCluster(); + } + + public static void syncDeleteCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .setForce(true) + .build(); + alloyDBAdminClient.deleteClusterAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletecluster/SyncDeleteClusterClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletecluster/SyncDeleteClusterClustername.java new file mode 100644 index 000000000000..13f7c4edb4e1 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletecluster/SyncDeleteClusterClustername.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_Clustername_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.protobuf.Empty; + +public class SyncDeleteClusterClustername { + + public static void main(String[] args) throws Exception { + syncDeleteClusterClustername(); + } + + public static void syncDeleteClusterClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + alloyDBAdminClient.deleteClusterAsync(name).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletecluster/SyncDeleteClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletecluster/SyncDeleteClusterString.java new file mode 100644 index 000000000000..cd331d8e00a1 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deletecluster/SyncDeleteClusterString.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.protobuf.Empty; + +public class SyncDeleteClusterString { + + public static void main(String[] args) throws Exception { + syncDeleteClusterString(); + } + + public static void syncDeleteClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + alloyDBAdminClient.deleteClusterAsync(name).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteinstance/AsyncDeleteInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteinstance/AsyncDeleteInstance.java new file mode 100644 index 000000000000..eb8896e00513 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteinstance/AsyncDeleteInstance.java @@ -0,0 +1,53 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1.InstanceName; +import com.google.longrunning.Operation; + +public class AsyncDeleteInstance { + + public static void main(String[] args) throws Exception { + asyncDeleteInstance(); + } + + public static void asyncDeleteInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.deleteInstanceCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteinstance/AsyncDeleteInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteinstance/AsyncDeleteInstanceLRO.java new file mode 100644 index 000000000000..33f201e581e3 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteinstance/AsyncDeleteInstanceLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1.InstanceName; +import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteInstanceLRO(); + } + + public static void asyncDeleteInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.deleteInstanceOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteinstance/SyncDeleteInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteinstance/SyncDeleteInstance.java new file mode 100644 index 000000000000..1f425ee2fd05 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteinstance/SyncDeleteInstance.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1.InstanceName; +import com.google.protobuf.Empty; + +public class SyncDeleteInstance { + + public static void main(String[] args) throws Exception { + syncDeleteInstance(); + } + + public static void syncDeleteInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + alloyDBAdminClient.deleteInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteinstance/SyncDeleteInstanceInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteinstance/SyncDeleteInstanceInstancename.java new file mode 100644 index 000000000000..3af7ad6f1299 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteinstance/SyncDeleteInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_Instancename_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.InstanceName; +import com.google.protobuf.Empty; + +public class SyncDeleteInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncDeleteInstanceInstancename(); + } + + public static void syncDeleteInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + alloyDBAdminClient.deleteInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_Instancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteinstance/SyncDeleteInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteinstance/SyncDeleteInstanceString.java new file mode 100644 index 000000000000..579734c4277a --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteinstance/SyncDeleteInstanceString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.InstanceName; +import com.google.protobuf.Empty; + +public class SyncDeleteInstanceString { + + public static void main(String[] args) throws Exception { + syncDeleteInstanceString(); + } + + public static void syncDeleteInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + alloyDBAdminClient.deleteInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/failoverinstance/AsyncFailoverInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/failoverinstance/AsyncFailoverInstance.java new file mode 100644 index 000000000000..90ca62d85596 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/failoverinstance/AsyncFailoverInstance.java @@ -0,0 +1,53 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1.InstanceName; +import com.google.longrunning.Operation; + +public class AsyncFailoverInstance { + + public static void main(String[] args) throws Exception { + asyncFailoverInstance(); + } + + public static void asyncFailoverInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = + alloyDBAdminClient.failoverInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/failoverinstance/AsyncFailoverInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/failoverinstance/AsyncFailoverInstanceLRO.java new file mode 100644 index 000000000000..f92da2232858 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/failoverinstance/AsyncFailoverInstanceLRO.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; +import com.google.cloud.alloydb.v1.OperationMetadata; + +public class AsyncFailoverInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncFailoverInstanceLRO(); + } + + public static void asyncFailoverInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.failoverInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/failoverinstance/SyncFailoverInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/failoverinstance/SyncFailoverInstance.java new file mode 100644 index 000000000000..8ddd37135cc8 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/failoverinstance/SyncFailoverInstance.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; + +public class SyncFailoverInstance { + + public static void main(String[] args) throws Exception { + syncFailoverInstance(); + } + + public static void syncFailoverInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Instance response = alloyDBAdminClient.failoverInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/failoverinstance/SyncFailoverInstanceInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/failoverinstance/SyncFailoverInstanceInstancename.java new file mode 100644 index 000000000000..b78445424e60 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/failoverinstance/SyncFailoverInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_Instancename_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; + +public class SyncFailoverInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncFailoverInstanceInstancename(); + } + + public static void syncFailoverInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + Instance response = alloyDBAdminClient.failoverInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_Instancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/failoverinstance/SyncFailoverInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/failoverinstance/SyncFailoverInstanceString.java new file mode 100644 index 000000000000..7dd98a9740ac --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/failoverinstance/SyncFailoverInstanceString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; + +public class SyncFailoverInstanceString { + + public static void main(String[] args) throws Exception { + syncFailoverInstanceString(); + } + + public static void syncFailoverInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + Instance response = alloyDBAdminClient.failoverInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getbackup/AsyncGetBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getbackup/AsyncGetBackup.java new file mode 100644 index 000000000000..ce9bf2fce761 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getbackup/AsyncGetBackup.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.BackupName; +import com.google.cloud.alloydb.v1.GetBackupRequest; + +public class AsyncGetBackup { + + public static void main(String[] args) throws Exception { + asyncGetBackup(); + } + + public static void asyncGetBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetBackupRequest request = + GetBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .build(); + ApiFuture future = alloyDBAdminClient.getBackupCallable().futureCall(request); + // Do something. + Backup response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetBackup_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getbackup/SyncGetBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getbackup/SyncGetBackup.java new file mode 100644 index 000000000000..81cdc9b1e72b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getbackup/SyncGetBackup.java @@ -0,0 +1,46 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetBackup_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.BackupName; +import com.google.cloud.alloydb.v1.GetBackupRequest; + +public class SyncGetBackup { + + public static void main(String[] args) throws Exception { + syncGetBackup(); + } + + public static void syncGetBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetBackupRequest request = + GetBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .build(); + Backup response = alloyDBAdminClient.getBackup(request); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetBackup_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getbackup/SyncGetBackupBackupname.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getbackup/SyncGetBackupBackupname.java new file mode 100644 index 000000000000..929cff74eed0 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getbackup/SyncGetBackupBackupname.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetBackup_Backupname_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.BackupName; + +public class SyncGetBackupBackupname { + + public static void main(String[] args) throws Exception { + syncGetBackupBackupname(); + } + + public static void syncGetBackupBackupname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + Backup response = alloyDBAdminClient.getBackup(name); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetBackup_Backupname_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getbackup/SyncGetBackupString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getbackup/SyncGetBackupString.java new file mode 100644 index 000000000000..58aae0daaca7 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getbackup/SyncGetBackupString.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetBackup_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.BackupName; + +public class SyncGetBackupString { + + public static void main(String[] args) throws Exception { + syncGetBackupString(); + } + + public static void syncGetBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString(); + Backup response = alloyDBAdminClient.getBackup(name); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetBackup_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/AsyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/AsyncGetCluster.java new file mode 100644 index 000000000000..b506a29e7541 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/AsyncGetCluster.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.GetClusterRequest; + +public class AsyncGetCluster { + + public static void main(String[] args) throws Exception { + asyncGetCluster(); + } + + public static void asyncGetCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetClusterRequest request = + GetClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .build(); + ApiFuture future = alloyDBAdminClient.getClusterCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/SyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..8c6620ea04be --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/SyncGetCluster.java @@ -0,0 +1,46 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetCluster_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.GetClusterRequest; + +public class SyncGetCluster { + + public static void main(String[] args) throws Exception { + syncGetCluster(); + } + + public static void syncGetCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetClusterRequest request = + GetClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .build(); + Cluster response = alloyDBAdminClient.getCluster(request); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/SyncGetClusterClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/SyncGetClusterClustername.java new file mode 100644 index 000000000000..ffbf98bd6682 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/SyncGetClusterClustername.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetCluster_Clustername_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.ClusterName; + +public class SyncGetClusterClustername { + + public static void main(String[] args) throws Exception { + syncGetClusterClustername(); + } + + public static void syncGetClusterClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Cluster response = alloyDBAdminClient.getCluster(name); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetCluster_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/SyncGetClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/SyncGetClusterString.java new file mode 100644 index 000000000000..461c8738320e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/SyncGetClusterString.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetCluster_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.ClusterName; + +public class SyncGetClusterString { + + public static void main(String[] args) throws Exception { + syncGetClusterString(); + } + + public static void syncGetClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + Cluster response = alloyDBAdminClient.getCluster(name); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetCluster_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getinstance/AsyncGetInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getinstance/AsyncGetInstance.java new file mode 100644 index 000000000000..28a63ddcabdd --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getinstance/AsyncGetInstance.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.GetInstanceRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; +import com.google.cloud.alloydb.v1.InstanceView; + +public class AsyncGetInstance { + + public static void main(String[] args) throws Exception { + asyncGetInstance(); + } + + public static void asyncGetInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setView(InstanceView.forNumber(0)) + .build(); + ApiFuture future = alloyDBAdminClient.getInstanceCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getinstance/SyncGetInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getinstance/SyncGetInstance.java new file mode 100644 index 000000000000..53f88b7082aa --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getinstance/SyncGetInstance.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetInstance_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.GetInstanceRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; +import com.google.cloud.alloydb.v1.InstanceView; + +public class SyncGetInstance { + + public static void main(String[] args) throws Exception { + syncGetInstance(); + } + + public static void syncGetInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setView(InstanceView.forNumber(0)) + .build(); + Instance response = alloyDBAdminClient.getInstance(request); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getinstance/SyncGetInstanceInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getinstance/SyncGetInstanceInstancename.java new file mode 100644 index 000000000000..1a104a26f37f --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getinstance/SyncGetInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetInstance_Instancename_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; + +public class SyncGetInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncGetInstanceInstancename(); + } + + public static void syncGetInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + Instance response = alloyDBAdminClient.getInstance(name); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetInstance_Instancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getinstance/SyncGetInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getinstance/SyncGetInstanceString.java new file mode 100644 index 000000000000..a38db790893b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getinstance/SyncGetInstanceString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetInstance_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; + +public class SyncGetInstanceString { + + public static void main(String[] args) throws Exception { + syncGetInstanceString(); + } + + public static void syncGetInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + Instance response = alloyDBAdminClient.getInstance(name); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetInstance_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getlocation/AsyncGetLocation.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..751842ef8b55 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = alloyDBAdminClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetLocation_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getlocation/SyncGetLocation.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..2085ba0705c5 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetLocation_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = alloyDBAdminClient.getLocation(request); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetLocation_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listbackups/AsyncListBackups.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listbackups/AsyncListBackups.java new file mode 100644 index 000000000000..08d5154ae399 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listbackups/AsyncListBackups.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListBackups_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.ListBackupsRequest; +import com.google.cloud.alloydb.v1.LocationName; + +public class AsyncListBackups { + + public static void main(String[] args) throws Exception { + asyncListBackups(); + } + + public static void asyncListBackups() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = alloyDBAdminClient.listBackupsPagedCallable().futureCall(request); + // Do something. + for (Backup element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListBackups_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listbackups/AsyncListBackupsPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listbackups/AsyncListBackupsPaged.java new file mode 100644 index 000000000000..1d1524d3c4fb --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listbackups/AsyncListBackupsPaged.java @@ -0,0 +1,63 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListBackups_Paged_async] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.ListBackupsRequest; +import com.google.cloud.alloydb.v1.ListBackupsResponse; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListBackupsPaged { + + public static void main(String[] args) throws Exception { + asyncListBackupsPaged(); + } + + public static void asyncListBackupsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListBackupsResponse response = alloyDBAdminClient.listBackupsCallable().call(request); + for (Backup element : response.getBackupsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListBackups_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listbackups/SyncListBackups.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listbackups/SyncListBackups.java new file mode 100644 index 000000000000..a344e74e7a96 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listbackups/SyncListBackups.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListBackups_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.ListBackupsRequest; +import com.google.cloud.alloydb.v1.LocationName; + +public class SyncListBackups { + + public static void main(String[] args) throws Exception { + syncListBackups(); + } + + public static void syncListBackups() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Backup element : alloyDBAdminClient.listBackups(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListBackups_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listbackups/SyncListBackupsLocationname.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listbackups/SyncListBackupsLocationname.java new file mode 100644 index 000000000000..bfdd5b0fa824 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listbackups/SyncListBackupsLocationname.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListBackups_Locationname_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.LocationName; + +public class SyncListBackupsLocationname { + + public static void main(String[] args) throws Exception { + syncListBackupsLocationname(); + } + + public static void syncListBackupsLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListBackups_Locationname_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listbackups/SyncListBackupsString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listbackups/SyncListBackupsString.java new file mode 100644 index 000000000000..78c1a9ff16ee --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listbackups/SyncListBackupsString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListBackups_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.LocationName; + +public class SyncListBackupsString { + + public static void main(String[] args) throws Exception { + syncListBackupsString(); + } + + public static void syncListBackupsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListBackups_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listclusters/AsyncListClusters.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listclusters/AsyncListClusters.java new file mode 100644 index 000000000000..875ab96abe75 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listclusters/AsyncListClusters.java @@ -0,0 +1,56 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListClusters_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.ListClustersRequest; +import com.google.cloud.alloydb.v1.LocationName; + +public class AsyncListClusters { + + public static void main(String[] args) throws Exception { + asyncListClusters(); + } + + public static void asyncListClusters() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + alloyDBAdminClient.listClustersPagedCallable().futureCall(request); + // Do something. + for (Cluster element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListClusters_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listclusters/AsyncListClustersPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listclusters/AsyncListClustersPaged.java new file mode 100644 index 000000000000..4430ba374b4e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listclusters/AsyncListClustersPaged.java @@ -0,0 +1,63 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListClusters_Paged_async] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.ListClustersRequest; +import com.google.cloud.alloydb.v1.ListClustersResponse; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListClustersPaged { + + public static void main(String[] args) throws Exception { + asyncListClustersPaged(); + } + + public static void asyncListClustersPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListClustersResponse response = alloyDBAdminClient.listClustersCallable().call(request); + for (Cluster element : response.getClustersList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListClusters_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listclusters/SyncListClusters.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listclusters/SyncListClusters.java new file mode 100644 index 000000000000..ac7ca56203df --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listclusters/SyncListClusters.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListClusters_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.ListClustersRequest; +import com.google.cloud.alloydb.v1.LocationName; + +public class SyncListClusters { + + public static void main(String[] args) throws Exception { + syncListClusters(); + } + + public static void syncListClusters() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Cluster element : alloyDBAdminClient.listClusters(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListClusters_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listclusters/SyncListClustersLocationname.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listclusters/SyncListClustersLocationname.java new file mode 100644 index 000000000000..e2854e7dcf37 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listclusters/SyncListClustersLocationname.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListClusters_Locationname_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.LocationName; + +public class SyncListClustersLocationname { + + public static void main(String[] args) throws Exception { + syncListClustersLocationname(); + } + + public static void syncListClustersLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Cluster element : alloyDBAdminClient.listClusters(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListClusters_Locationname_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listclusters/SyncListClustersString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listclusters/SyncListClustersString.java new file mode 100644 index 000000000000..d4edc7ab23df --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listclusters/SyncListClustersString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListClusters_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.LocationName; + +public class SyncListClustersString { + + public static void main(String[] args) throws Exception { + syncListClustersString(); + } + + public static void syncListClustersString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Cluster element : alloyDBAdminClient.listClusters(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListClusters_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listinstances/AsyncListInstances.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listinstances/AsyncListInstances.java new file mode 100644 index 000000000000..f2f83feec9c6 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listinstances/AsyncListInstances.java @@ -0,0 +1,56 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListInstances_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.ListInstancesRequest; + +public class AsyncListInstances { + + public static void main(String[] args) throws Exception { + asyncListInstances(); + } + + public static void asyncListInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + alloyDBAdminClient.listInstancesPagedCallable().futureCall(request); + // Do something. + for (Instance element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListInstances_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listinstances/AsyncListInstancesPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listinstances/AsyncListInstancesPaged.java new file mode 100644 index 000000000000..99413a8a5489 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listinstances/AsyncListInstancesPaged.java @@ -0,0 +1,63 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListInstances_Paged_async] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.ListInstancesRequest; +import com.google.cloud.alloydb.v1.ListInstancesResponse; +import com.google.common.base.Strings; + +public class AsyncListInstancesPaged { + + public static void main(String[] args) throws Exception { + asyncListInstancesPaged(); + } + + public static void asyncListInstancesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListInstancesResponse response = alloyDBAdminClient.listInstancesCallable().call(request); + for (Instance element : response.getInstancesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListInstances_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listinstances/SyncListInstances.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listinstances/SyncListInstances.java new file mode 100644 index 000000000000..da495eb97c7b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listinstances/SyncListInstances.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListInstances_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.ListInstancesRequest; + +public class SyncListInstances { + + public static void main(String[] args) throws Exception { + syncListInstances(); + } + + public static void syncListInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Instance element : alloyDBAdminClient.listInstances(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListInstances_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listinstances/SyncListInstancesClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listinstances/SyncListInstancesClustername.java new file mode 100644 index 000000000000..266570ec6590 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listinstances/SyncListInstancesClustername.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListInstances_Clustername_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.Instance; + +public class SyncListInstancesClustername { + + public static void main(String[] args) throws Exception { + syncListInstancesClustername(); + } + + public static void syncListInstancesClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + for (Instance element : alloyDBAdminClient.listInstances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListInstances_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listinstances/SyncListInstancesString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listinstances/SyncListInstancesString.java new file mode 100644 index 000000000000..e8a808df07f8 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listinstances/SyncListInstancesString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListInstances_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.Instance; + +public class SyncListInstancesString { + + public static void main(String[] args) throws Exception { + syncListInstancesString(); + } + + public static void syncListInstancesString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + for (Instance element : alloyDBAdminClient.listInstances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListInstances_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listlocations/AsyncListLocations.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..73eaf5c04960 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + alloyDBAdminClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListLocations_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listlocations/AsyncListLocationsPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..861cd26940c0 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListLocations_Paged_async] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = alloyDBAdminClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListLocations_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listlocations/SyncListLocations.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..1e480bad55b7 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListLocations_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : alloyDBAdminClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListLocations_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlags.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlags.java new file mode 100644 index 000000000000..31324a515c2d --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlags.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.cloud.alloydb.v1.SupportedDatabaseFlag; + +public class AsyncListSupportedDatabaseFlags { + + public static void main(String[] args) throws Exception { + asyncListSupportedDatabaseFlags(); + } + + public static void asyncListSupportedDatabaseFlags() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + alloyDBAdminClient.listSupportedDatabaseFlagsPagedCallable().futureCall(request); + // Do something. + for (SupportedDatabaseFlag element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlagsPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlagsPaged.java new file mode 100644 index 000000000000..e66be984cdd1 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlagsPaged.java @@ -0,0 +1,62 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_Paged_async] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.cloud.alloydb.v1.SupportedDatabaseFlag; +import com.google.common.base.Strings; + +public class AsyncListSupportedDatabaseFlagsPaged { + + public static void main(String[] args) throws Exception { + asyncListSupportedDatabaseFlagsPaged(); + } + + public static void asyncListSupportedDatabaseFlagsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListSupportedDatabaseFlagsResponse response = + alloyDBAdminClient.listSupportedDatabaseFlagsCallable().call(request); + for (SupportedDatabaseFlag element : response.getSupportedDatabaseFlagsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlags.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlags.java new file mode 100644 index 000000000000..1a3d6df4e83e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlags.java @@ -0,0 +1,51 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.cloud.alloydb.v1.SupportedDatabaseFlag; + +public class SyncListSupportedDatabaseFlags { + + public static void main(String[] args) throws Exception { + syncListSupportedDatabaseFlags(); + } + + public static void syncListSupportedDatabaseFlags() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (SupportedDatabaseFlag element : + alloyDBAdminClient.listSupportedDatabaseFlags(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsLocationname.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsLocationname.java new file mode 100644 index 000000000000..da61e455b0f6 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsLocationname.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_Locationname_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.cloud.alloydb.v1.SupportedDatabaseFlag; + +public class SyncListSupportedDatabaseFlagsLocationname { + + public static void main(String[] args) throws Exception { + syncListSupportedDatabaseFlagsLocationname(); + } + + public static void syncListSupportedDatabaseFlagsLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (SupportedDatabaseFlag element : + alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_Locationname_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsString.java new file mode 100644 index 000000000000..0ac8101139d6 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.cloud.alloydb.v1.SupportedDatabaseFlag; + +public class SyncListSupportedDatabaseFlagsString { + + public static void main(String[] args) throws Exception { + syncListSupportedDatabaseFlagsString(); + } + + public static void syncListSupportedDatabaseFlagsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (SupportedDatabaseFlag element : + alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restartinstance/AsyncRestartInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restartinstance/AsyncRestartInstance.java new file mode 100644 index 000000000000..600fe2471ff3 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restartinstance/AsyncRestartInstance.java @@ -0,0 +1,53 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_RestartInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.InstanceName; +import com.google.cloud.alloydb.v1.RestartInstanceRequest; +import com.google.longrunning.Operation; + +public class AsyncRestartInstance { + + public static void main(String[] args) throws Exception { + asyncRestartInstance(); + } + + public static void asyncRestartInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestartInstanceRequest request = + RestartInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = + alloyDBAdminClient.restartInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_RestartInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restartinstance/AsyncRestartInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restartinstance/AsyncRestartInstanceLRO.java new file mode 100644 index 000000000000..60a2069f16a0 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restartinstance/AsyncRestartInstanceLRO.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_RestartInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; +import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.cloud.alloydb.v1.RestartInstanceRequest; + +public class AsyncRestartInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncRestartInstanceLRO(); + } + + public static void asyncRestartInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestartInstanceRequest request = + RestartInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.restartInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_RestartInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restartinstance/SyncRestartInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restartinstance/SyncRestartInstance.java new file mode 100644 index 000000000000..5f8a723d0d5b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restartinstance/SyncRestartInstance.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_RestartInstance_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; +import com.google.cloud.alloydb.v1.RestartInstanceRequest; + +public class SyncRestartInstance { + + public static void main(String[] args) throws Exception { + syncRestartInstance(); + } + + public static void syncRestartInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestartInstanceRequest request = + RestartInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Instance response = alloyDBAdminClient.restartInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_RestartInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restartinstance/SyncRestartInstanceInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restartinstance/SyncRestartInstanceInstancename.java new file mode 100644 index 000000000000..07e5d578f470 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restartinstance/SyncRestartInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_RestartInstance_Instancename_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; + +public class SyncRestartInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncRestartInstanceInstancename(); + } + + public static void syncRestartInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + Instance response = alloyDBAdminClient.restartInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_RestartInstance_Instancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restartinstance/SyncRestartInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restartinstance/SyncRestartInstanceString.java new file mode 100644 index 000000000000..5016c484cbbb --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restartinstance/SyncRestartInstanceString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_RestartInstance_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; + +public class SyncRestartInstanceString { + + public static void main(String[] args) throws Exception { + syncRestartInstanceString(); + } + + public static void syncRestartInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + Instance response = alloyDBAdminClient.restartInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_RestartInstance_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restorecluster/AsyncRestoreCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restorecluster/AsyncRestoreCluster.java new file mode 100644 index 000000000000..2e99de6d786f --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restorecluster/AsyncRestoreCluster.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.cloud.alloydb.v1.RestoreClusterRequest; +import com.google.longrunning.Operation; + +public class AsyncRestoreCluster { + + public static void main(String[] args) throws Exception { + asyncRestoreCluster(); + } + + public static void asyncRestoreCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.restoreClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restorecluster/AsyncRestoreClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restorecluster/AsyncRestoreClusterLRO.java new file mode 100644 index 000000000000..1af187b62072 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restorecluster/AsyncRestoreClusterLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.cloud.alloydb.v1.RestoreClusterRequest; + +public class AsyncRestoreClusterLRO { + + public static void main(String[] args) throws Exception { + asyncRestoreClusterLRO(); + } + + public static void asyncRestoreClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.restoreClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restorecluster/SyncRestoreCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restorecluster/SyncRestoreCluster.java new file mode 100644 index 000000000000..b6ee6be87868 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/restorecluster/SyncRestoreCluster.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.cloud.alloydb.v1.RestoreClusterRequest; + +public class SyncRestoreCluster { + + public static void main(String[] args) throws Exception { + syncRestoreCluster(); + } + + public static void syncRestoreCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Cluster response = alloyDBAdminClient.restoreClusterAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatebackup/AsyncUpdateBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatebackup/AsyncUpdateBackup.java new file mode 100644 index 000000000000..740de18bba2e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatebackup/AsyncUpdateBackup.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.UpdateBackupRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateBackup { + + public static void main(String[] args) throws Exception { + asyncUpdateBackup(); + } + + public static void asyncUpdateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + ApiFuture future = alloyDBAdminClient.updateBackupCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatebackup/AsyncUpdateBackupLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatebackup/AsyncUpdateBackupLRO.java new file mode 100644 index 000000000000..31516beebaf2 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatebackup/AsyncUpdateBackupLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.cloud.alloydb.v1.UpdateBackupRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateBackupLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateBackupLRO(); + } + + public static void asyncUpdateBackupLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + OperationFuture future = + alloyDBAdminClient.updateBackupOperationCallable().futureCall(request); + // Do something. + Backup response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatebackup/SyncUpdateBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatebackup/SyncUpdateBackup.java new file mode 100644 index 000000000000..2e6990789956 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatebackup/SyncUpdateBackup.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.cloud.alloydb.v1.UpdateBackupRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateBackup { + + public static void main(String[] args) throws Exception { + syncUpdateBackup(); + } + + public static void syncUpdateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + Backup response = alloyDBAdminClient.updateBackupAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatebackup/SyncUpdateBackupBackupFieldmask.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatebackup/SyncUpdateBackupBackupFieldmask.java new file mode 100644 index 000000000000..e415d3dd8e15 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatebackup/SyncUpdateBackupBackupFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_BackupFieldmask_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Backup; +import com.google.protobuf.FieldMask; + +public class SyncUpdateBackupBackupFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateBackupBackupFieldmask(); + } + + public static void syncUpdateBackupBackupFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Backup response = alloyDBAdminClient.updateBackupAsync(backup, updateMask).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_BackupFieldmask_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatecluster/AsyncUpdateCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatecluster/AsyncUpdateCluster.java new file mode 100644 index 000000000000..e48aebbefa35 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatecluster/AsyncUpdateCluster.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.UpdateClusterRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateCluster { + + public static void main(String[] args) throws Exception { + asyncUpdateCluster(); + } + + public static void asyncUpdateCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + ApiFuture future = alloyDBAdminClient.updateClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatecluster/AsyncUpdateClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatecluster/AsyncUpdateClusterLRO.java new file mode 100644 index 000000000000..be2e315126fa --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatecluster/AsyncUpdateClusterLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.cloud.alloydb.v1.UpdateClusterRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateClusterLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateClusterLRO(); + } + + public static void asyncUpdateClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + OperationFuture future = + alloyDBAdminClient.updateClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatecluster/SyncUpdateCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatecluster/SyncUpdateCluster.java new file mode 100644 index 000000000000..3eab6f6cad85 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatecluster/SyncUpdateCluster.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.UpdateClusterRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCluster { + + public static void main(String[] args) throws Exception { + syncUpdateCluster(); + } + + public static void syncUpdateCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + Cluster response = alloyDBAdminClient.updateClusterAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatecluster/SyncUpdateClusterClusterFieldmask.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatecluster/SyncUpdateClusterClusterFieldmask.java new file mode 100644 index 000000000000..3cd67e58c01c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updatecluster/SyncUpdateClusterClusterFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_ClusterFieldmask_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.protobuf.FieldMask; + +public class SyncUpdateClusterClusterFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateClusterClusterFieldmask(); + } + + public static void syncUpdateClusterClusterFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + Cluster cluster = Cluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Cluster response = alloyDBAdminClient.updateClusterAsync(cluster, updateMask).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_ClusterFieldmask_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateinstance/AsyncUpdateInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateinstance/AsyncUpdateInstance.java new file mode 100644 index 000000000000..57eaaa97f1a1 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateinstance/AsyncUpdateInstance.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.UpdateInstanceRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateInstance { + + public static void main(String[] args) throws Exception { + asyncUpdateInstance(); + } + + public static void asyncUpdateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + ApiFuture future = alloyDBAdminClient.updateInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateinstance/AsyncUpdateInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateinstance/AsyncUpdateInstanceLRO.java new file mode 100644 index 000000000000..af4f7a33c04e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateinstance/AsyncUpdateInstanceLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.cloud.alloydb.v1.UpdateInstanceRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateInstanceLRO(); + } + + public static void asyncUpdateInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + OperationFuture future = + alloyDBAdminClient.updateInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateinstance/SyncUpdateInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateinstance/SyncUpdateInstance.java new file mode 100644 index 000000000000..0927f47424cc --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateinstance/SyncUpdateInstance.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.UpdateInstanceRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateInstance { + + public static void main(String[] args) throws Exception { + syncUpdateInstance(); + } + + public static void syncUpdateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + Instance response = alloyDBAdminClient.updateInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateinstance/SyncUpdateInstanceInstanceFieldmask.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateinstance/SyncUpdateInstanceInstanceFieldmask.java new file mode 100644 index 000000000000..741fa4a732fd --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateinstance/SyncUpdateInstanceInstanceFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_InstanceFieldmask_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Instance; +import com.google.protobuf.FieldMask; + +public class SyncUpdateInstanceInstanceFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateInstanceInstanceFieldmask(); + } + + public static void syncUpdateInstanceInstanceFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Instance response = alloyDBAdminClient.updateInstanceAsync(instance, updateMask).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_InstanceFieldmask_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadminsettings/getcluster/SyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadminsettings/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..4002847eaffd --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadminsettings/getcluster/SyncGetCluster.java @@ -0,0 +1,48 @@ +/* + * 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.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdminSettings_GetCluster_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminSettings; +import java.time.Duration; + +public class SyncGetCluster { + + public static void main(String[] args) throws Exception { + syncGetCluster(); + } + + public static void syncGetCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AlloyDBAdminSettings.Builder alloyDBAdminSettingsBuilder = AlloyDBAdminSettings.newBuilder(); + alloyDBAdminSettingsBuilder + .getClusterSettings() + .setRetrySettings( + alloyDBAdminSettingsBuilder + .getClusterSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AlloyDBAdminSettings alloyDBAdminSettings = alloyDBAdminSettingsBuilder.build(); + } +} +// [END alloydb_v1_generated_AlloyDBAdminSettings_GetCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/stub/alloydbadminstubsettings/getcluster/SyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/stub/alloydbadminstubsettings/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..135ff2c55445 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/stub/alloydbadminstubsettings/getcluster/SyncGetCluster.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1.stub.samples; + +// [START alloydb_v1_generated_AlloyDBAdminStubSettings_GetCluster_sync] +import com.google.cloud.alloydb.v1.stub.AlloyDBAdminStubSettings; +import java.time.Duration; + +public class SyncGetCluster { + + public static void main(String[] args) throws Exception { + syncGetCluster(); + } + + public static void syncGetCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AlloyDBAdminStubSettings.Builder alloyDBAdminSettingsBuilder = + AlloyDBAdminStubSettings.newBuilder(); + alloyDBAdminSettingsBuilder + .getClusterSettings() + .setRetrySettings( + alloyDBAdminSettingsBuilder + .getClusterSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AlloyDBAdminStubSettings alloyDBAdminSettings = alloyDBAdminSettingsBuilder.build(); + } +} +// [END alloydb_v1_generated_AlloyDBAdminStubSettings_GetCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstances.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstances.java new file mode 100644 index 000000000000..cdcf21149149 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstances.java @@ -0,0 +1,53 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.CreateInstanceRequests; +import com.google.longrunning.Operation; + +public class AsyncBatchCreateInstances { + + public static void main(String[] args) throws Exception { + asyncBatchCreateInstances(); + } + + public static void asyncBatchCreateInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + alloyDBAdminClient.batchCreateInstancesCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstancesLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstancesLRO.java new file mode 100644 index 000000000000..8d53af49d052 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstancesLRO.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.CreateInstanceRequests; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; + +public class AsyncBatchCreateInstancesLRO { + + public static void main(String[] args) throws Exception { + asyncBatchCreateInstancesLRO(); + } + + public static void asyncBatchCreateInstancesLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + alloyDBAdminClient.batchCreateInstancesOperationCallable().futureCall(request); + // Do something. + BatchCreateInstancesResponse response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/batchcreateinstances/SyncBatchCreateInstances.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/batchcreateinstances/SyncBatchCreateInstances.java new file mode 100644 index 000000000000..54423953b6a7 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/batchcreateinstances/SyncBatchCreateInstances.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.CreateInstanceRequests; + +public class SyncBatchCreateInstances { + + public static void main(String[] args) throws Exception { + syncBatchCreateInstances(); + } + + public static void syncBatchCreateInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + BatchCreateInstancesResponse response = + alloyDBAdminClient.batchCreateInstancesAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/create/SyncCreateSetCredentialsProvider.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..f47bc671e4bd --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminSettings; +import com.google.cloud.alloydb.v1alpha.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AlloyDBAdminSettings alloyDBAdminSettings = + AlloyDBAdminSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings); + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_Create_SetCredentialsProvider_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/create/SyncCreateSetCredentialsProvider1.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..7fcc306083d1 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,39 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_Create_SetCredentialsProvider1_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AlloyDBAdminSettings alloyDBAdminSettings = AlloyDBAdminSettings.newHttpJsonBuilder().build(); + AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings); + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_Create_SetCredentialsProvider1_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/create/SyncCreateSetEndpoint.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..f7b25be31b49 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_Create_SetEndpoint_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminSettings; +import com.google.cloud.alloydb.v1alpha.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AlloyDBAdminSettings alloyDBAdminSettings = + AlloyDBAdminSettings.newBuilder().setEndpoint(myEndpoint).build(); + AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings); + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_Create_SetEndpoint_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createbackup/AsyncCreateBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createbackup/AsyncCreateBackup.java new file mode 100644 index 000000000000..73677956256c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createbackup/AsyncCreateBackup.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.CreateBackupRequest; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateBackup { + + public static void main(String[] args) throws Exception { + asyncCreateBackup(); + } + + public static void asyncCreateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBackupId("backupId2121930365") + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.createBackupCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createbackup/AsyncCreateBackupLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createbackup/AsyncCreateBackupLRO.java new file mode 100644 index 000000000000..5f30cc0bef45 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createbackup/AsyncCreateBackupLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.CreateBackupRequest; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; + +public class AsyncCreateBackupLRO { + + public static void main(String[] args) throws Exception { + asyncCreateBackupLRO(); + } + + public static void asyncCreateBackupLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBackupId("backupId2121930365") + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.createBackupOperationCallable().futureCall(request); + // Do something. + Backup response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createbackup/SyncCreateBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createbackup/SyncCreateBackup.java new file mode 100644 index 000000000000..1e4da93509a3 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createbackup/SyncCreateBackup.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.CreateBackupRequest; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class SyncCreateBackup { + + public static void main(String[] args) throws Exception { + syncCreateBackup(); + } + + public static void syncCreateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBackupId("backupId2121930365") + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Backup response = alloyDBAdminClient.createBackupAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createbackup/SyncCreateBackupLocationnameBackupString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createbackup/SyncCreateBackupLocationnameBackupString.java new file mode 100644 index 000000000000..d4842e60cc8c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createbackup/SyncCreateBackupLocationnameBackupString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_LocationnameBackupString_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class SyncCreateBackupLocationnameBackupString { + + public static void main(String[] args) throws Exception { + syncCreateBackupLocationnameBackupString(); + } + + public static void syncCreateBackupLocationnameBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + Backup response = alloyDBAdminClient.createBackupAsync(parent, backup, backupId).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_LocationnameBackupString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createbackup/SyncCreateBackupStringBackupString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createbackup/SyncCreateBackupStringBackupString.java new file mode 100644 index 000000000000..a172f62f6c30 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createbackup/SyncCreateBackupStringBackupString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_StringBackupString_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class SyncCreateBackupStringBackupString { + + public static void main(String[] args) throws Exception { + syncCreateBackupStringBackupString(); + } + + public static void syncCreateBackupStringBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + Backup response = alloyDBAdminClient.createBackupAsync(parent, backup, backupId).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_StringBackupString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createcluster/AsyncCreateCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createcluster/AsyncCreateCluster.java new file mode 100644 index 000000000000..67c11e0bac90 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createcluster/AsyncCreateCluster.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.CreateClusterRequest; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateCluster { + + public static void main(String[] args) throws Exception { + asyncCreateCluster(); + } + + public static void asyncCreateCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.createClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createcluster/AsyncCreateClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createcluster/AsyncCreateClusterLRO.java new file mode 100644 index 000000000000..c11f6c3dbcf1 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createcluster/AsyncCreateClusterLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.CreateClusterRequest; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; + +public class AsyncCreateClusterLRO { + + public static void main(String[] args) throws Exception { + asyncCreateClusterLRO(); + } + + public static void asyncCreateClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.createClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createcluster/SyncCreateCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createcluster/SyncCreateCluster.java new file mode 100644 index 000000000000..838272fd55d3 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createcluster/SyncCreateCluster.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.CreateClusterRequest; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class SyncCreateCluster { + + public static void main(String[] args) throws Exception { + syncCreateCluster(); + } + + public static void syncCreateCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Cluster response = alloyDBAdminClient.createClusterAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createcluster/SyncCreateClusterLocationnameClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createcluster/SyncCreateClusterLocationnameClusterString.java new file mode 100644 index 000000000000..b8d1dd04c9b2 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createcluster/SyncCreateClusterLocationnameClusterString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_LocationnameClusterString_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class SyncCreateClusterLocationnameClusterString { + + public static void main(String[] args) throws Exception { + syncCreateClusterLocationnameClusterString(); + } + + public static void syncCreateClusterLocationnameClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = alloyDBAdminClient.createClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_LocationnameClusterString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createcluster/SyncCreateClusterStringClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createcluster/SyncCreateClusterStringClusterString.java new file mode 100644 index 000000000000..61e163b41bdc --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createcluster/SyncCreateClusterStringClusterString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_StringClusterString_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class SyncCreateClusterStringClusterString { + + public static void main(String[] args) throws Exception { + syncCreateClusterStringClusterString(); + } + + public static void syncCreateClusterStringClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = alloyDBAdminClient.createClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_StringClusterString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createinstance/AsyncCreateInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createinstance/AsyncCreateInstance.java new file mode 100644 index 000000000000..4045927bd4c5 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createinstance/AsyncCreateInstance.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.CreateInstanceRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.longrunning.Operation; + +public class AsyncCreateInstance { + + public static void main(String[] args) throws Exception { + asyncCreateInstance(); + } + + public static void asyncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.createInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createinstance/AsyncCreateInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createinstance/AsyncCreateInstanceLRO.java new file mode 100644 index 000000000000..25c71305eb84 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createinstance/AsyncCreateInstanceLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.CreateInstanceRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; + +public class AsyncCreateInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncCreateInstanceLRO(); + } + + public static void asyncCreateInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.createInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createinstance/SyncCreateInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createinstance/SyncCreateInstance.java new file mode 100644 index 000000000000..69d49d54904f --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createinstance/SyncCreateInstance.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.CreateInstanceRequest; +import com.google.cloud.alloydb.v1alpha.Instance; + +public class SyncCreateInstance { + + public static void main(String[] args) throws Exception { + syncCreateInstance(); + } + + public static void syncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Instance response = alloyDBAdminClient.createInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createinstance/SyncCreateInstanceClusternameInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createinstance/SyncCreateInstanceClusternameInstanceString.java new file mode 100644 index 000000000000..5d9cf3c78b62 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createinstance/SyncCreateInstanceClusternameInstanceString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_ClusternameInstanceString_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.Instance; + +public class SyncCreateInstanceClusternameInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateInstanceClusternameInstanceString(); + } + + public static void syncCreateInstanceClusternameInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = + alloyDBAdminClient.createInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_ClusternameInstanceString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createinstance/SyncCreateInstanceStringInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createinstance/SyncCreateInstanceStringInstanceString.java new file mode 100644 index 000000000000..4978c6915690 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createinstance/SyncCreateInstanceStringInstanceString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_StringInstanceString_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.Instance; + +public class SyncCreateInstanceStringInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateInstanceStringInstanceString(); + } + + public static void syncCreateInstanceStringInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = + alloyDBAdminClient.createInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_StringInstanceString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryCluster.java new file mode 100644 index 000000000000..a6d41ca15099 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryCluster.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateSecondaryCluster { + + public static void main(String[] args) throws Exception { + asyncCreateSecondaryCluster(); + } + + public static void asyncCreateSecondaryCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryClusterRequest request = + CreateSecondaryClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = + alloyDBAdminClient.createSecondaryClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryClusterLRO.java new file mode 100644 index 000000000000..7afb8be00c51 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryClusterLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; + +public class AsyncCreateSecondaryClusterLRO { + + public static void main(String[] args) throws Exception { + asyncCreateSecondaryClusterLRO(); + } + + public static void asyncCreateSecondaryClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryClusterRequest request = + CreateSecondaryClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.createSecondaryClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondarycluster/SyncCreateSecondaryCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondarycluster/SyncCreateSecondaryCluster.java new file mode 100644 index 000000000000..d4f9d6177ced --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondarycluster/SyncCreateSecondaryCluster.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class SyncCreateSecondaryCluster { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryCluster(); + } + + public static void syncCreateSecondaryCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryClusterRequest request = + CreateSecondaryClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Cluster response = alloyDBAdminClient.createSecondaryClusterAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterLocationnameClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterLocationnameClusterString.java new file mode 100644 index 000000000000..413cab778fe4 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterLocationnameClusterString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_LocationnameClusterString_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class SyncCreateSecondaryClusterLocationnameClusterString { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryClusterLocationnameClusterString(); + } + + public static void syncCreateSecondaryClusterLocationnameClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = + alloyDBAdminClient.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_LocationnameClusterString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterStringClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterStringClusterString.java new file mode 100644 index 000000000000..65753030c531 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterStringClusterString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_StringClusterString_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class SyncCreateSecondaryClusterStringClusterString { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryClusterStringClusterString(); + } + + public static void syncCreateSecondaryClusterStringClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = + alloyDBAdminClient.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_StringClusterString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstance.java new file mode 100644 index 000000000000..d2dd45f0f550 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstance.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.longrunning.Operation; + +public class AsyncCreateSecondaryInstance { + + public static void main(String[] args) throws Exception { + asyncCreateSecondaryInstance(); + } + + public static void asyncCreateSecondaryInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryInstanceRequest request = + CreateSecondaryInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = + alloyDBAdminClient.createSecondaryInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstanceLRO.java new file mode 100644 index 000000000000..a3f920a363a6 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstanceLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; + +public class AsyncCreateSecondaryInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncCreateSecondaryInstanceLRO(); + } + + public static void asyncCreateSecondaryInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryInstanceRequest request = + CreateSecondaryInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.createSecondaryInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstance.java new file mode 100644 index 000000000000..1a589888327e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstance.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1alpha.Instance; + +public class SyncCreateSecondaryInstance { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryInstance(); + } + + public static void syncCreateSecondaryInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryInstanceRequest request = + CreateSecondaryInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Instance response = alloyDBAdminClient.createSecondaryInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceClusternameInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceClusternameInstanceString.java new file mode 100644 index 000000000000..d4362f0cb613 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceClusternameInstanceString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_ClusternameInstanceString_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.Instance; + +public class SyncCreateSecondaryInstanceClusternameInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryInstanceClusternameInstanceString(); + } + + public static void syncCreateSecondaryInstanceClusternameInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = + alloyDBAdminClient.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_ClusternameInstanceString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceStringInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceStringInstanceString.java new file mode 100644 index 000000000000..74e1d72fa9b0 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceStringInstanceString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_StringInstanceString_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.Instance; + +public class SyncCreateSecondaryInstanceStringInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryInstanceStringInstanceString(); + } + + public static void syncCreateSecondaryInstanceStringInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = + alloyDBAdminClient.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_StringInstanceString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletebackup/AsyncDeleteBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletebackup/AsyncDeleteBackup.java new file mode 100644 index 000000000000..ab335f104759 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletebackup/AsyncDeleteBackup.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.BackupName; +import com.google.cloud.alloydb.v1alpha.DeleteBackupRequest; +import com.google.longrunning.Operation; + +public class AsyncDeleteBackup { + + public static void main(String[] args) throws Exception { + asyncDeleteBackup(); + } + + public static void asyncDeleteBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + ApiFuture future = alloyDBAdminClient.deleteBackupCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletebackup/AsyncDeleteBackupLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletebackup/AsyncDeleteBackupLRO.java new file mode 100644 index 000000000000..f8d008641eb3 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletebackup/AsyncDeleteBackupLRO.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.BackupName; +import com.google.cloud.alloydb.v1alpha.DeleteBackupRequest; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteBackupLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteBackupLRO(); + } + + public static void asyncDeleteBackupLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + OperationFuture future = + alloyDBAdminClient.deleteBackupOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletebackup/SyncDeleteBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletebackup/SyncDeleteBackup.java new file mode 100644 index 000000000000..5e5f28f5efb1 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletebackup/SyncDeleteBackup.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.BackupName; +import com.google.cloud.alloydb.v1alpha.DeleteBackupRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteBackup { + + public static void main(String[] args) throws Exception { + syncDeleteBackup(); + } + + public static void syncDeleteBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + alloyDBAdminClient.deleteBackupAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletebackup/SyncDeleteBackupBackupname.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletebackup/SyncDeleteBackupBackupname.java new file mode 100644 index 000000000000..cf952f304c24 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletebackup/SyncDeleteBackupBackupname.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_Backupname_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.BackupName; +import com.google.protobuf.Empty; + +public class SyncDeleteBackupBackupname { + + public static void main(String[] args) throws Exception { + syncDeleteBackupBackupname(); + } + + public static void syncDeleteBackupBackupname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + alloyDBAdminClient.deleteBackupAsync(name).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_Backupname_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletebackup/SyncDeleteBackupString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletebackup/SyncDeleteBackupString.java new file mode 100644 index 000000000000..1533b278c299 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletebackup/SyncDeleteBackupString.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.BackupName; +import com.google.protobuf.Empty; + +public class SyncDeleteBackupString { + + public static void main(String[] args) throws Exception { + syncDeleteBackupString(); + } + + public static void syncDeleteBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString(); + alloyDBAdminClient.deleteBackupAsync(name).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletecluster/AsyncDeleteCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletecluster/AsyncDeleteCluster.java new file mode 100644 index 000000000000..779cb8d4a27a --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletecluster/AsyncDeleteCluster.java @@ -0,0 +1,53 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.DeleteClusterRequest; +import com.google.longrunning.Operation; + +public class AsyncDeleteCluster { + + public static void main(String[] args) throws Exception { + asyncDeleteCluster(); + } + + public static void asyncDeleteCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .setForce(true) + .build(); + ApiFuture future = alloyDBAdminClient.deleteClusterCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletecluster/AsyncDeleteClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletecluster/AsyncDeleteClusterLRO.java new file mode 100644 index 000000000000..5abfc81a08e3 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletecluster/AsyncDeleteClusterLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.DeleteClusterRequest; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteClusterLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteClusterLRO(); + } + + public static void asyncDeleteClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .setForce(true) + .build(); + OperationFuture future = + alloyDBAdminClient.deleteClusterOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletecluster/SyncDeleteCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletecluster/SyncDeleteCluster.java new file mode 100644 index 000000000000..447efefe2516 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletecluster/SyncDeleteCluster.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.DeleteClusterRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteCluster { + + public static void main(String[] args) throws Exception { + syncDeleteCluster(); + } + + public static void syncDeleteCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .setForce(true) + .build(); + alloyDBAdminClient.deleteClusterAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletecluster/SyncDeleteClusterClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletecluster/SyncDeleteClusterClustername.java new file mode 100644 index 000000000000..26cafc90922c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletecluster/SyncDeleteClusterClustername.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_Clustername_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.protobuf.Empty; + +public class SyncDeleteClusterClustername { + + public static void main(String[] args) throws Exception { + syncDeleteClusterClustername(); + } + + public static void syncDeleteClusterClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + alloyDBAdminClient.deleteClusterAsync(name).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletecluster/SyncDeleteClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletecluster/SyncDeleteClusterString.java new file mode 100644 index 000000000000..d7a87d03026f --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deletecluster/SyncDeleteClusterString.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.protobuf.Empty; + +public class SyncDeleteClusterString { + + public static void main(String[] args) throws Exception { + syncDeleteClusterString(); + } + + public static void syncDeleteClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + alloyDBAdminClient.deleteClusterAsync(name).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteinstance/AsyncDeleteInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteinstance/AsyncDeleteInstance.java new file mode 100644 index 000000000000..2f7c91b77345 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteinstance/AsyncDeleteInstance.java @@ -0,0 +1,53 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1alpha.InstanceName; +import com.google.longrunning.Operation; + +public class AsyncDeleteInstance { + + public static void main(String[] args) throws Exception { + asyncDeleteInstance(); + } + + public static void asyncDeleteInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.deleteInstanceCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteinstance/AsyncDeleteInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteinstance/AsyncDeleteInstanceLRO.java new file mode 100644 index 000000000000..67f5e15e93aa --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteinstance/AsyncDeleteInstanceLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1alpha.InstanceName; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteInstanceLRO(); + } + + public static void asyncDeleteInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.deleteInstanceOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteinstance/SyncDeleteInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteinstance/SyncDeleteInstance.java new file mode 100644 index 000000000000..04239c2d1206 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteinstance/SyncDeleteInstance.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1alpha.InstanceName; +import com.google.protobuf.Empty; + +public class SyncDeleteInstance { + + public static void main(String[] args) throws Exception { + syncDeleteInstance(); + } + + public static void syncDeleteInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + alloyDBAdminClient.deleteInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteinstance/SyncDeleteInstanceInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteinstance/SyncDeleteInstanceInstancename.java new file mode 100644 index 000000000000..7ca30332abee --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteinstance/SyncDeleteInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_Instancename_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.InstanceName; +import com.google.protobuf.Empty; + +public class SyncDeleteInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncDeleteInstanceInstancename(); + } + + public static void syncDeleteInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + alloyDBAdminClient.deleteInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_Instancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteinstance/SyncDeleteInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteinstance/SyncDeleteInstanceString.java new file mode 100644 index 000000000000..1a356ba65684 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteinstance/SyncDeleteInstanceString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.InstanceName; +import com.google.protobuf.Empty; + +public class SyncDeleteInstanceString { + + public static void main(String[] args) throws Exception { + syncDeleteInstanceString(); + } + + public static void syncDeleteInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + alloyDBAdminClient.deleteInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/failoverinstance/AsyncFailoverInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/failoverinstance/AsyncFailoverInstance.java new file mode 100644 index 000000000000..3bbb09fd145c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/failoverinstance/AsyncFailoverInstance.java @@ -0,0 +1,53 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1alpha.InstanceName; +import com.google.longrunning.Operation; + +public class AsyncFailoverInstance { + + public static void main(String[] args) throws Exception { + asyncFailoverInstance(); + } + + public static void asyncFailoverInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = + alloyDBAdminClient.failoverInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/failoverinstance/AsyncFailoverInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/failoverinstance/AsyncFailoverInstanceLRO.java new file mode 100644 index 000000000000..91d437f22f3d --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/failoverinstance/AsyncFailoverInstanceLRO.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; + +public class AsyncFailoverInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncFailoverInstanceLRO(); + } + + public static void asyncFailoverInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.failoverInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/failoverinstance/SyncFailoverInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/failoverinstance/SyncFailoverInstance.java new file mode 100644 index 000000000000..9558bcdf7545 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/failoverinstance/SyncFailoverInstance.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; + +public class SyncFailoverInstance { + + public static void main(String[] args) throws Exception { + syncFailoverInstance(); + } + + public static void syncFailoverInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Instance response = alloyDBAdminClient.failoverInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/failoverinstance/SyncFailoverInstanceInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/failoverinstance/SyncFailoverInstanceInstancename.java new file mode 100644 index 000000000000..2ae53ba6f314 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/failoverinstance/SyncFailoverInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_Instancename_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; + +public class SyncFailoverInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncFailoverInstanceInstancename(); + } + + public static void syncFailoverInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + Instance response = alloyDBAdminClient.failoverInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_Instancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/failoverinstance/SyncFailoverInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/failoverinstance/SyncFailoverInstanceString.java new file mode 100644 index 000000000000..8baf2f57a397 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/failoverinstance/SyncFailoverInstanceString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; + +public class SyncFailoverInstanceString { + + public static void main(String[] args) throws Exception { + syncFailoverInstanceString(); + } + + public static void syncFailoverInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + Instance response = alloyDBAdminClient.failoverInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/AsyncGenerateClientCertificate.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/AsyncGenerateClientCertificate.java new file mode 100644 index 000000000000..e78f83250ff9 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/AsyncGenerateClientCertificate.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; +import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; +import com.google.protobuf.Duration; + +public class AsyncGenerateClientCertificate { + + public static void main(String[] args) throws Exception { + asyncGenerateClientCertificate(); + } + + public static void asyncGenerateClientCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GenerateClientCertificateRequest request = + GenerateClientCertificateRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setPemCsr("pemCsr-991911478") + .setCertDuration(Duration.newBuilder().build()) + .build(); + ApiFuture future = + alloyDBAdminClient.generateClientCertificateCallable().futureCall(request); + // Do something. + GenerateClientCertificateResponse response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificate.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificate.java new file mode 100644 index 000000000000..08efd59f38d8 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificate.java @@ -0,0 +1,51 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; +import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; +import com.google.protobuf.Duration; + +public class SyncGenerateClientCertificate { + + public static void main(String[] args) throws Exception { + syncGenerateClientCertificate(); + } + + public static void syncGenerateClientCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GenerateClientCertificateRequest request = + GenerateClientCertificateRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setPemCsr("pemCsr-991911478") + .setCertDuration(Duration.newBuilder().build()) + .build(); + GenerateClientCertificateResponse response = + alloyDBAdminClient.generateClientCertificate(request); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificateClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificateClustername.java new file mode 100644 index 000000000000..6ed2d0ba03bc --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificateClustername.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_Clustername_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; + +public class SyncGenerateClientCertificateClustername { + + public static void main(String[] args) throws Exception { + syncGenerateClientCertificateClustername(); + } + + public static void syncGenerateClientCertificateClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + GenerateClientCertificateResponse response = + alloyDBAdminClient.generateClientCertificate(parent); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificateString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificateString.java new file mode 100644 index 000000000000..771fb7776866 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificateString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; + +public class SyncGenerateClientCertificateString { + + public static void main(String[] args) throws Exception { + syncGenerateClientCertificateString(); + } + + public static void syncGenerateClientCertificateString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + GenerateClientCertificateResponse response = + alloyDBAdminClient.generateClientCertificate(parent); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getbackup/AsyncGetBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getbackup/AsyncGetBackup.java new file mode 100644 index 000000000000..a1701a142aa2 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getbackup/AsyncGetBackup.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.BackupName; +import com.google.cloud.alloydb.v1alpha.GetBackupRequest; + +public class AsyncGetBackup { + + public static void main(String[] args) throws Exception { + asyncGetBackup(); + } + + public static void asyncGetBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetBackupRequest request = + GetBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .build(); + ApiFuture future = alloyDBAdminClient.getBackupCallable().futureCall(request); + // Do something. + Backup response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getbackup/SyncGetBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getbackup/SyncGetBackup.java new file mode 100644 index 000000000000..67f537f8702c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getbackup/SyncGetBackup.java @@ -0,0 +1,46 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.BackupName; +import com.google.cloud.alloydb.v1alpha.GetBackupRequest; + +public class SyncGetBackup { + + public static void main(String[] args) throws Exception { + syncGetBackup(); + } + + public static void syncGetBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetBackupRequest request = + GetBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .build(); + Backup response = alloyDBAdminClient.getBackup(request); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getbackup/SyncGetBackupBackupname.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getbackup/SyncGetBackupBackupname.java new file mode 100644 index 000000000000..68458d0ac2cf --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getbackup/SyncGetBackupBackupname.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_Backupname_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.BackupName; + +public class SyncGetBackupBackupname { + + public static void main(String[] args) throws Exception { + syncGetBackupBackupname(); + } + + public static void syncGetBackupBackupname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + Backup response = alloyDBAdminClient.getBackup(name); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_Backupname_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getbackup/SyncGetBackupString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getbackup/SyncGetBackupString.java new file mode 100644 index 000000000000..5779d158a710 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getbackup/SyncGetBackupString.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.BackupName; + +public class SyncGetBackupString { + + public static void main(String[] args) throws Exception { + syncGetBackupString(); + } + + public static void syncGetBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString(); + Backup response = alloyDBAdminClient.getBackup(name); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/AsyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/AsyncGetCluster.java new file mode 100644 index 000000000000..6a8f0f6e98db --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/AsyncGetCluster.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.GetClusterRequest; + +public class AsyncGetCluster { + + public static void main(String[] args) throws Exception { + asyncGetCluster(); + } + + public static void asyncGetCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetClusterRequest request = + GetClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .build(); + ApiFuture future = alloyDBAdminClient.getClusterCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/SyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..fe398825929c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/SyncGetCluster.java @@ -0,0 +1,46 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.GetClusterRequest; + +public class SyncGetCluster { + + public static void main(String[] args) throws Exception { + syncGetCluster(); + } + + public static void syncGetCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetClusterRequest request = + GetClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .build(); + Cluster response = alloyDBAdminClient.getCluster(request); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/SyncGetClusterClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/SyncGetClusterClustername.java new file mode 100644 index 000000000000..c00754a52e08 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/SyncGetClusterClustername.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_Clustername_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.ClusterName; + +public class SyncGetClusterClustername { + + public static void main(String[] args) throws Exception { + syncGetClusterClustername(); + } + + public static void syncGetClusterClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Cluster response = alloyDBAdminClient.getCluster(name); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/SyncGetClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/SyncGetClusterString.java new file mode 100644 index 000000000000..1b096f827f21 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/SyncGetClusterString.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.ClusterName; + +public class SyncGetClusterString { + + public static void main(String[] args) throws Exception { + syncGetClusterString(); + } + + public static void syncGetClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + Cluster response = alloyDBAdminClient.getCluster(name); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getconnectioninfo/AsyncGetConnectionInfo.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getconnectioninfo/AsyncGetConnectionInfo.java new file mode 100644 index 000000000000..31a59d28925c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getconnectioninfo/AsyncGetConnectionInfo.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ConnectionInfo; +import com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; +import com.google.cloud.alloydb.v1alpha.InstanceName; + +public class AsyncGetConnectionInfo { + + public static void main(String[] args) throws Exception { + asyncGetConnectionInfo(); + } + + public static void asyncGetConnectionInfo() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetConnectionInfoRequest request = + GetConnectionInfoRequest.newBuilder() + .setParent( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + alloyDBAdminClient.getConnectionInfoCallable().futureCall(request); + // Do something. + ConnectionInfo response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getconnectioninfo/SyncGetConnectionInfo.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getconnectioninfo/SyncGetConnectionInfo.java new file mode 100644 index 000000000000..e73f7ce8de4a --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getconnectioninfo/SyncGetConnectionInfo.java @@ -0,0 +1,48 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ConnectionInfo; +import com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; +import com.google.cloud.alloydb.v1alpha.InstanceName; + +public class SyncGetConnectionInfo { + + public static void main(String[] args) throws Exception { + syncGetConnectionInfo(); + } + + public static void syncGetConnectionInfo() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetConnectionInfoRequest request = + GetConnectionInfoRequest.newBuilder() + .setParent( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .build(); + ConnectionInfo response = alloyDBAdminClient.getConnectionInfo(request); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getconnectioninfo/SyncGetConnectionInfoInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getconnectioninfo/SyncGetConnectionInfoInstancename.java new file mode 100644 index 000000000000..1ea744ffbe06 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getconnectioninfo/SyncGetConnectionInfoInstancename.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_Instancename_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ConnectionInfo; +import com.google.cloud.alloydb.v1alpha.InstanceName; + +public class SyncGetConnectionInfoInstancename { + + public static void main(String[] args) throws Exception { + syncGetConnectionInfoInstancename(); + } + + public static void syncGetConnectionInfoInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + ConnectionInfo response = alloyDBAdminClient.getConnectionInfo(parent); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_Instancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getconnectioninfo/SyncGetConnectionInfoString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getconnectioninfo/SyncGetConnectionInfoString.java new file mode 100644 index 000000000000..881307fb9e27 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getconnectioninfo/SyncGetConnectionInfoString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ConnectionInfo; +import com.google.cloud.alloydb.v1alpha.InstanceName; + +public class SyncGetConnectionInfoString { + + public static void main(String[] args) throws Exception { + syncGetConnectionInfoString(); + } + + public static void syncGetConnectionInfoString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + ConnectionInfo response = alloyDBAdminClient.getConnectionInfo(parent); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getinstance/AsyncGetInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getinstance/AsyncGetInstance.java new file mode 100644 index 000000000000..86c7ecb03dac --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getinstance/AsyncGetInstance.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.GetInstanceRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; +import com.google.cloud.alloydb.v1alpha.InstanceView; + +public class AsyncGetInstance { + + public static void main(String[] args) throws Exception { + asyncGetInstance(); + } + + public static void asyncGetInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setView(InstanceView.forNumber(0)) + .build(); + ApiFuture future = alloyDBAdminClient.getInstanceCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getinstance/SyncGetInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getinstance/SyncGetInstance.java new file mode 100644 index 000000000000..32211347c397 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getinstance/SyncGetInstance.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.GetInstanceRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; +import com.google.cloud.alloydb.v1alpha.InstanceView; + +public class SyncGetInstance { + + public static void main(String[] args) throws Exception { + syncGetInstance(); + } + + public static void syncGetInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setView(InstanceView.forNumber(0)) + .build(); + Instance response = alloyDBAdminClient.getInstance(request); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getinstance/SyncGetInstanceInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getinstance/SyncGetInstanceInstancename.java new file mode 100644 index 000000000000..82b6778b53d3 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getinstance/SyncGetInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_Instancename_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; + +public class SyncGetInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncGetInstanceInstancename(); + } + + public static void syncGetInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + Instance response = alloyDBAdminClient.getInstance(name); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_Instancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getinstance/SyncGetInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getinstance/SyncGetInstanceString.java new file mode 100644 index 000000000000..9332a61cb17e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getinstance/SyncGetInstanceString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; + +public class SyncGetInstanceString { + + public static void main(String[] args) throws Exception { + syncGetInstanceString(); + } + + public static void syncGetInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + Instance response = alloyDBAdminClient.getInstance(name); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getlocation/AsyncGetLocation.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..b054b3f5a507 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = alloyDBAdminClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetLocation_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getlocation/SyncGetLocation.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..c66368b105cc --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetLocation_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = alloyDBAdminClient.getLocation(request); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetLocation_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listbackups/AsyncListBackups.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listbackups/AsyncListBackups.java new file mode 100644 index 000000000000..25b6bab5bf2b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listbackups/AsyncListBackups.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.ListBackupsRequest; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class AsyncListBackups { + + public static void main(String[] args) throws Exception { + asyncListBackups(); + } + + public static void asyncListBackups() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = alloyDBAdminClient.listBackupsPagedCallable().futureCall(request); + // Do something. + for (Backup element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listbackups/AsyncListBackupsPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listbackups/AsyncListBackupsPaged.java new file mode 100644 index 000000000000..6fe9f571dc31 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listbackups/AsyncListBackupsPaged.java @@ -0,0 +1,63 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_Paged_async] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.ListBackupsRequest; +import com.google.cloud.alloydb.v1alpha.ListBackupsResponse; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.common.base.Strings; + +public class AsyncListBackupsPaged { + + public static void main(String[] args) throws Exception { + asyncListBackupsPaged(); + } + + public static void asyncListBackupsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListBackupsResponse response = alloyDBAdminClient.listBackupsCallable().call(request); + for (Backup element : response.getBackupsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listbackups/SyncListBackups.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listbackups/SyncListBackups.java new file mode 100644 index 000000000000..f993a1ce7b3e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listbackups/SyncListBackups.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.ListBackupsRequest; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class SyncListBackups { + + public static void main(String[] args) throws Exception { + syncListBackups(); + } + + public static void syncListBackups() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Backup element : alloyDBAdminClient.listBackups(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listbackups/SyncListBackupsLocationname.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listbackups/SyncListBackupsLocationname.java new file mode 100644 index 000000000000..7a992eda9fb6 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listbackups/SyncListBackupsLocationname.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_Locationname_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class SyncListBackupsLocationname { + + public static void main(String[] args) throws Exception { + syncListBackupsLocationname(); + } + + public static void syncListBackupsLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_Locationname_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listbackups/SyncListBackupsString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listbackups/SyncListBackupsString.java new file mode 100644 index 000000000000..d733912f5a54 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listbackups/SyncListBackupsString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class SyncListBackupsString { + + public static void main(String[] args) throws Exception { + syncListBackupsString(); + } + + public static void syncListBackupsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listclusters/AsyncListClusters.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listclusters/AsyncListClusters.java new file mode 100644 index 000000000000..fb6a3879269c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listclusters/AsyncListClusters.java @@ -0,0 +1,56 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.ListClustersRequest; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class AsyncListClusters { + + public static void main(String[] args) throws Exception { + asyncListClusters(); + } + + public static void asyncListClusters() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + alloyDBAdminClient.listClustersPagedCallable().futureCall(request); + // Do something. + for (Cluster element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listclusters/AsyncListClustersPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listclusters/AsyncListClustersPaged.java new file mode 100644 index 000000000000..09365a711c1f --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listclusters/AsyncListClustersPaged.java @@ -0,0 +1,63 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_Paged_async] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.ListClustersRequest; +import com.google.cloud.alloydb.v1alpha.ListClustersResponse; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.common.base.Strings; + +public class AsyncListClustersPaged { + + public static void main(String[] args) throws Exception { + asyncListClustersPaged(); + } + + public static void asyncListClustersPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListClustersResponse response = alloyDBAdminClient.listClustersCallable().call(request); + for (Cluster element : response.getClustersList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listclusters/SyncListClusters.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listclusters/SyncListClusters.java new file mode 100644 index 000000000000..290fd36c1b2e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listclusters/SyncListClusters.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.ListClustersRequest; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class SyncListClusters { + + public static void main(String[] args) throws Exception { + syncListClusters(); + } + + public static void syncListClusters() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Cluster element : alloyDBAdminClient.listClusters(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listclusters/SyncListClustersLocationname.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listclusters/SyncListClustersLocationname.java new file mode 100644 index 000000000000..330a3a305229 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listclusters/SyncListClustersLocationname.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_Locationname_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class SyncListClustersLocationname { + + public static void main(String[] args) throws Exception { + syncListClustersLocationname(); + } + + public static void syncListClustersLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Cluster element : alloyDBAdminClient.listClusters(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_Locationname_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listclusters/SyncListClustersString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listclusters/SyncListClustersString.java new file mode 100644 index 000000000000..726f16d0294f --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listclusters/SyncListClustersString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.LocationName; + +public class SyncListClustersString { + + public static void main(String[] args) throws Exception { + syncListClustersString(); + } + + public static void syncListClustersString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Cluster element : alloyDBAdminClient.listClusters(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listinstances/AsyncListInstances.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listinstances/AsyncListInstances.java new file mode 100644 index 000000000000..043a4bb53b01 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listinstances/AsyncListInstances.java @@ -0,0 +1,56 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.ListInstancesRequest; + +public class AsyncListInstances { + + public static void main(String[] args) throws Exception { + asyncListInstances(); + } + + public static void asyncListInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + alloyDBAdminClient.listInstancesPagedCallable().futureCall(request); + // Do something. + for (Instance element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listinstances/AsyncListInstancesPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listinstances/AsyncListInstancesPaged.java new file mode 100644 index 000000000000..3fa008808cda --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listinstances/AsyncListInstancesPaged.java @@ -0,0 +1,63 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_Paged_async] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.ListInstancesRequest; +import com.google.cloud.alloydb.v1alpha.ListInstancesResponse; +import com.google.common.base.Strings; + +public class AsyncListInstancesPaged { + + public static void main(String[] args) throws Exception { + asyncListInstancesPaged(); + } + + public static void asyncListInstancesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListInstancesResponse response = alloyDBAdminClient.listInstancesCallable().call(request); + for (Instance element : response.getInstancesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listinstances/SyncListInstances.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listinstances/SyncListInstances.java new file mode 100644 index 000000000000..b429417e4313 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listinstances/SyncListInstances.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.ListInstancesRequest; + +public class SyncListInstances { + + public static void main(String[] args) throws Exception { + syncListInstances(); + } + + public static void syncListInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Instance element : alloyDBAdminClient.listInstances(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listinstances/SyncListInstancesClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listinstances/SyncListInstancesClustername.java new file mode 100644 index 000000000000..351bb2c7878b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listinstances/SyncListInstancesClustername.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_Clustername_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.Instance; + +public class SyncListInstancesClustername { + + public static void main(String[] args) throws Exception { + syncListInstancesClustername(); + } + + public static void syncListInstancesClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + for (Instance element : alloyDBAdminClient.listInstances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listinstances/SyncListInstancesString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listinstances/SyncListInstancesString.java new file mode 100644 index 000000000000..c047fa5c033e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listinstances/SyncListInstancesString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.Instance; + +public class SyncListInstancesString { + + public static void main(String[] args) throws Exception { + syncListInstancesString(); + } + + public static void syncListInstancesString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + for (Instance element : alloyDBAdminClient.listInstances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listlocations/AsyncListLocations.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..04298c0c5d64 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + alloyDBAdminClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListLocations_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listlocations/AsyncListLocationsPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..0eed39ed0c71 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListLocations_Paged_async] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = alloyDBAdminClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListLocations_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listlocations/SyncListLocations.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..2c9c0b87aac5 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListLocations_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : alloyDBAdminClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListLocations_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlags.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlags.java new file mode 100644 index 000000000000..feb595a8efa3 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlags.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; + +public class AsyncListSupportedDatabaseFlags { + + public static void main(String[] args) throws Exception { + asyncListSupportedDatabaseFlags(); + } + + public static void asyncListSupportedDatabaseFlags() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + alloyDBAdminClient.listSupportedDatabaseFlagsPagedCallable().futureCall(request); + // Do something. + for (SupportedDatabaseFlag element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlagsPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlagsPaged.java new file mode 100644 index 000000000000..39512578ee80 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlagsPaged.java @@ -0,0 +1,62 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_Paged_async] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; +import com.google.common.base.Strings; + +public class AsyncListSupportedDatabaseFlagsPaged { + + public static void main(String[] args) throws Exception { + asyncListSupportedDatabaseFlagsPaged(); + } + + public static void asyncListSupportedDatabaseFlagsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListSupportedDatabaseFlagsResponse response = + alloyDBAdminClient.listSupportedDatabaseFlagsCallable().call(request); + for (SupportedDatabaseFlag element : response.getSupportedDatabaseFlagsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlags.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlags.java new file mode 100644 index 000000000000..78f52086e056 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlags.java @@ -0,0 +1,51 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; + +public class SyncListSupportedDatabaseFlags { + + public static void main(String[] args) throws Exception { + syncListSupportedDatabaseFlags(); + } + + public static void syncListSupportedDatabaseFlags() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (SupportedDatabaseFlag element : + alloyDBAdminClient.listSupportedDatabaseFlags(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsLocationname.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsLocationname.java new file mode 100644 index 000000000000..25eafaf704fb --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsLocationname.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_Locationname_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; + +public class SyncListSupportedDatabaseFlagsLocationname { + + public static void main(String[] args) throws Exception { + syncListSupportedDatabaseFlagsLocationname(); + } + + public static void syncListSupportedDatabaseFlagsLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (SupportedDatabaseFlag element : + alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_Locationname_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsString.java new file mode 100644 index 000000000000..d26a977d2dc0 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; + +public class SyncListSupportedDatabaseFlagsString { + + public static void main(String[] args) throws Exception { + syncListSupportedDatabaseFlagsString(); + } + + public static void syncListSupportedDatabaseFlagsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (SupportedDatabaseFlag element : + alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/promotecluster/AsyncPromoteCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/promotecluster/AsyncPromoteCluster.java new file mode 100644 index 000000000000..71dc182ae523 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/promotecluster/AsyncPromoteCluster.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.PromoteClusterRequest; +import com.google.longrunning.Operation; + +public class AsyncPromoteCluster { + + public static void main(String[] args) throws Exception { + asyncPromoteCluster(); + } + + public static void asyncPromoteCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + PromoteClusterRequest request = + PromoteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.promoteClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/promotecluster/AsyncPromoteClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/promotecluster/AsyncPromoteClusterLRO.java new file mode 100644 index 000000000000..44117fd45a71 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/promotecluster/AsyncPromoteClusterLRO.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; +import com.google.cloud.alloydb.v1alpha.PromoteClusterRequest; + +public class AsyncPromoteClusterLRO { + + public static void main(String[] args) throws Exception { + asyncPromoteClusterLRO(); + } + + public static void asyncPromoteClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + PromoteClusterRequest request = + PromoteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.promoteClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/promotecluster/SyncPromoteCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/promotecluster/SyncPromoteCluster.java new file mode 100644 index 000000000000..2d2654e95385 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/promotecluster/SyncPromoteCluster.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.PromoteClusterRequest; + +public class SyncPromoteCluster { + + public static void main(String[] args) throws Exception { + syncPromoteCluster(); + } + + public static void syncPromoteCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + PromoteClusterRequest request = + PromoteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + Cluster response = alloyDBAdminClient.promoteClusterAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/promotecluster/SyncPromoteClusterClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/promotecluster/SyncPromoteClusterClustername.java new file mode 100644 index 000000000000..1d1a6d20dcb4 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/promotecluster/SyncPromoteClusterClustername.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_Clustername_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.ClusterName; + +public class SyncPromoteClusterClustername { + + public static void main(String[] args) throws Exception { + syncPromoteClusterClustername(); + } + + public static void syncPromoteClusterClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Cluster response = alloyDBAdminClient.promoteClusterAsync(name).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/promotecluster/SyncPromoteClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/promotecluster/SyncPromoteClusterString.java new file mode 100644 index 000000000000..b432ac1bd979 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/promotecluster/SyncPromoteClusterString.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.ClusterName; + +public class SyncPromoteClusterString { + + public static void main(String[] args) throws Exception { + syncPromoteClusterString(); + } + + public static void syncPromoteClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + Cluster response = alloyDBAdminClient.promoteClusterAsync(name).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restartinstance/AsyncRestartInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restartinstance/AsyncRestartInstance.java new file mode 100644 index 000000000000..c9a222a97283 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restartinstance/AsyncRestartInstance.java @@ -0,0 +1,53 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.InstanceName; +import com.google.cloud.alloydb.v1alpha.RestartInstanceRequest; +import com.google.longrunning.Operation; + +public class AsyncRestartInstance { + + public static void main(String[] args) throws Exception { + asyncRestartInstance(); + } + + public static void asyncRestartInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestartInstanceRequest request = + RestartInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = + alloyDBAdminClient.restartInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restartinstance/AsyncRestartInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restartinstance/AsyncRestartInstanceLRO.java new file mode 100644 index 000000000000..428c36b2cc76 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restartinstance/AsyncRestartInstanceLRO.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; +import com.google.cloud.alloydb.v1alpha.RestartInstanceRequest; + +public class AsyncRestartInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncRestartInstanceLRO(); + } + + public static void asyncRestartInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestartInstanceRequest request = + RestartInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.restartInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restartinstance/SyncRestartInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restartinstance/SyncRestartInstance.java new file mode 100644 index 000000000000..cdbe7d522076 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restartinstance/SyncRestartInstance.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; +import com.google.cloud.alloydb.v1alpha.RestartInstanceRequest; + +public class SyncRestartInstance { + + public static void main(String[] args) throws Exception { + syncRestartInstance(); + } + + public static void syncRestartInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestartInstanceRequest request = + RestartInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Instance response = alloyDBAdminClient.restartInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restartinstance/SyncRestartInstanceInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restartinstance/SyncRestartInstanceInstancename.java new file mode 100644 index 000000000000..955f9cdb401b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restartinstance/SyncRestartInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_Instancename_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; + +public class SyncRestartInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncRestartInstanceInstancename(); + } + + public static void syncRestartInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + Instance response = alloyDBAdminClient.restartInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_Instancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restartinstance/SyncRestartInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restartinstance/SyncRestartInstanceString.java new file mode 100644 index 000000000000..320624f6938d --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restartinstance/SyncRestartInstanceString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; + +public class SyncRestartInstanceString { + + public static void main(String[] args) throws Exception { + syncRestartInstanceString(); + } + + public static void syncRestartInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + Instance response = alloyDBAdminClient.restartInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restorecluster/AsyncRestoreCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restorecluster/AsyncRestoreCluster.java new file mode 100644 index 000000000000..92d11eb4c1cc --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restorecluster/AsyncRestoreCluster.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.cloud.alloydb.v1alpha.RestoreClusterRequest; +import com.google.longrunning.Operation; + +public class AsyncRestoreCluster { + + public static void main(String[] args) throws Exception { + asyncRestoreCluster(); + } + + public static void asyncRestoreCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.restoreClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restorecluster/AsyncRestoreClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restorecluster/AsyncRestoreClusterLRO.java new file mode 100644 index 000000000000..f383a5d96f5c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restorecluster/AsyncRestoreClusterLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; +import com.google.cloud.alloydb.v1alpha.RestoreClusterRequest; + +public class AsyncRestoreClusterLRO { + + public static void main(String[] args) throws Exception { + asyncRestoreClusterLRO(); + } + + public static void asyncRestoreClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.restoreClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restorecluster/SyncRestoreCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restorecluster/SyncRestoreCluster.java new file mode 100644 index 000000000000..c52958bd5272 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/restorecluster/SyncRestoreCluster.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.LocationName; +import com.google.cloud.alloydb.v1alpha.RestoreClusterRequest; + +public class SyncRestoreCluster { + + public static void main(String[] args) throws Exception { + syncRestoreCluster(); + } + + public static void syncRestoreCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Cluster response = alloyDBAdminClient.restoreClusterAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatebackup/AsyncUpdateBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatebackup/AsyncUpdateBackup.java new file mode 100644 index 000000000000..30cbde2351fc --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatebackup/AsyncUpdateBackup.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.UpdateBackupRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateBackup { + + public static void main(String[] args) throws Exception { + asyncUpdateBackup(); + } + + public static void asyncUpdateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + ApiFuture future = alloyDBAdminClient.updateBackupCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatebackup/AsyncUpdateBackupLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatebackup/AsyncUpdateBackupLRO.java new file mode 100644 index 000000000000..efbe82d7d6cc --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatebackup/AsyncUpdateBackupLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; +import com.google.cloud.alloydb.v1alpha.UpdateBackupRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateBackupLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateBackupLRO(); + } + + public static void asyncUpdateBackupLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + OperationFuture future = + alloyDBAdminClient.updateBackupOperationCallable().futureCall(request); + // Do something. + Backup response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatebackup/SyncUpdateBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatebackup/SyncUpdateBackup.java new file mode 100644 index 000000000000..730701e81fe4 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatebackup/SyncUpdateBackup.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.cloud.alloydb.v1alpha.UpdateBackupRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateBackup { + + public static void main(String[] args) throws Exception { + syncUpdateBackup(); + } + + public static void syncUpdateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + Backup response = alloyDBAdminClient.updateBackupAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatebackup/SyncUpdateBackupBackupFieldmask.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatebackup/SyncUpdateBackupBackupFieldmask.java new file mode 100644 index 000000000000..3380e3e94668 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatebackup/SyncUpdateBackupBackupFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_BackupFieldmask_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Backup; +import com.google.protobuf.FieldMask; + +public class SyncUpdateBackupBackupFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateBackupBackupFieldmask(); + } + + public static void syncUpdateBackupBackupFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Backup response = alloyDBAdminClient.updateBackupAsync(backup, updateMask).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_BackupFieldmask_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatecluster/AsyncUpdateCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatecluster/AsyncUpdateCluster.java new file mode 100644 index 000000000000..6080cabad034 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatecluster/AsyncUpdateCluster.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.UpdateClusterRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateCluster { + + public static void main(String[] args) throws Exception { + asyncUpdateCluster(); + } + + public static void asyncUpdateCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + ApiFuture future = alloyDBAdminClient.updateClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatecluster/AsyncUpdateClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatecluster/AsyncUpdateClusterLRO.java new file mode 100644 index 000000000000..79a394a47648 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatecluster/AsyncUpdateClusterLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; +import com.google.cloud.alloydb.v1alpha.UpdateClusterRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateClusterLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateClusterLRO(); + } + + public static void asyncUpdateClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + OperationFuture future = + alloyDBAdminClient.updateClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatecluster/SyncUpdateCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatecluster/SyncUpdateCluster.java new file mode 100644 index 000000000000..1c134ae9eb3e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatecluster/SyncUpdateCluster.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.cloud.alloydb.v1alpha.UpdateClusterRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCluster { + + public static void main(String[] args) throws Exception { + syncUpdateCluster(); + } + + public static void syncUpdateCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + Cluster response = alloyDBAdminClient.updateClusterAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatecluster/SyncUpdateClusterClusterFieldmask.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatecluster/SyncUpdateClusterClusterFieldmask.java new file mode 100644 index 000000000000..66bacb27f89e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updatecluster/SyncUpdateClusterClusterFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_ClusterFieldmask_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Cluster; +import com.google.protobuf.FieldMask; + +public class SyncUpdateClusterClusterFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateClusterClusterFieldmask(); + } + + public static void syncUpdateClusterClusterFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + Cluster cluster = Cluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Cluster response = alloyDBAdminClient.updateClusterAsync(cluster, updateMask).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_ClusterFieldmask_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateinstance/AsyncUpdateInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateinstance/AsyncUpdateInstance.java new file mode 100644 index 000000000000..69bd5f8cb023 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateinstance/AsyncUpdateInstance.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateInstance { + + public static void main(String[] args) throws Exception { + asyncUpdateInstance(); + } + + public static void asyncUpdateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + ApiFuture future = alloyDBAdminClient.updateInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateinstance/AsyncUpdateInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateinstance/AsyncUpdateInstanceLRO.java new file mode 100644 index 000000000000..42f245ffeac4 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateinstance/AsyncUpdateInstanceLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; +import com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateInstanceLRO(); + } + + public static void asyncUpdateInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + OperationFuture future = + alloyDBAdminClient.updateInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateinstance/SyncUpdateInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateinstance/SyncUpdateInstance.java new file mode 100644 index 000000000000..176e484812a9 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateinstance/SyncUpdateInstance.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateInstance { + + public static void main(String[] args) throws Exception { + syncUpdateInstance(); + } + + public static void syncUpdateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + Instance response = alloyDBAdminClient.updateInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateinstance/SyncUpdateInstanceInstanceFieldmask.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateinstance/SyncUpdateInstanceInstanceFieldmask.java new file mode 100644 index 000000000000..5a126e4ddf39 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateinstance/SyncUpdateInstanceInstanceFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_InstanceFieldmask_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.protobuf.FieldMask; + +public class SyncUpdateInstanceInstanceFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateInstanceInstanceFieldmask(); + } + + public static void syncUpdateInstanceInstanceFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Instance response = alloyDBAdminClient.updateInstanceAsync(instance, updateMask).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_InstanceFieldmask_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadminsettings/getcluster/SyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadminsettings/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..c84e71b332c7 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadminsettings/getcluster/SyncGetCluster.java @@ -0,0 +1,48 @@ +/* + * 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.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdminSettings_GetCluster_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminSettings; +import java.time.Duration; + +public class SyncGetCluster { + + public static void main(String[] args) throws Exception { + syncGetCluster(); + } + + public static void syncGetCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AlloyDBAdminSettings.Builder alloyDBAdminSettingsBuilder = AlloyDBAdminSettings.newBuilder(); + alloyDBAdminSettingsBuilder + .getClusterSettings() + .setRetrySettings( + alloyDBAdminSettingsBuilder + .getClusterSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AlloyDBAdminSettings alloyDBAdminSettings = alloyDBAdminSettingsBuilder.build(); + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdminSettings_GetCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/stub/alloydbadminstubsettings/getcluster/SyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/stub/alloydbadminstubsettings/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..937a4c4cfba2 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/stub/alloydbadminstubsettings/getcluster/SyncGetCluster.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1alpha.stub.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdminStubSettings_GetCluster_sync] +import com.google.cloud.alloydb.v1alpha.stub.AlloyDBAdminStubSettings; +import java.time.Duration; + +public class SyncGetCluster { + + public static void main(String[] args) throws Exception { + syncGetCluster(); + } + + public static void syncGetCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AlloyDBAdminStubSettings.Builder alloyDBAdminSettingsBuilder = + AlloyDBAdminStubSettings.newBuilder(); + alloyDBAdminSettingsBuilder + .getClusterSettings() + .setRetrySettings( + alloyDBAdminSettingsBuilder + .getClusterSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AlloyDBAdminStubSettings alloyDBAdminSettings = alloyDBAdminSettingsBuilder.build(); + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdminStubSettings_GetCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstances.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstances.java new file mode 100644 index 000000000000..c227d0fc39ad --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstances.java @@ -0,0 +1,53 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.CreateInstanceRequests; +import com.google.longrunning.Operation; + +public class AsyncBatchCreateInstances { + + public static void main(String[] args) throws Exception { + asyncBatchCreateInstances(); + } + + public static void asyncBatchCreateInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + alloyDBAdminClient.batchCreateInstancesCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstancesLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstancesLRO.java new file mode 100644 index 000000000000..c7a6d6841640 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/batchcreateinstances/AsyncBatchCreateInstancesLRO.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.CreateInstanceRequests; +import com.google.cloud.alloydb.v1beta.OperationMetadata; + +public class AsyncBatchCreateInstancesLRO { + + public static void main(String[] args) throws Exception { + asyncBatchCreateInstancesLRO(); + } + + public static void asyncBatchCreateInstancesLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + alloyDBAdminClient.batchCreateInstancesOperationCallable().futureCall(request); + // Do something. + BatchCreateInstancesResponse response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/batchcreateinstances/SyncBatchCreateInstances.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/batchcreateinstances/SyncBatchCreateInstances.java new file mode 100644 index 000000000000..16ecb49d1c14 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/batchcreateinstances/SyncBatchCreateInstances.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; +import com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.CreateInstanceRequests; + +public class SyncBatchCreateInstances { + + public static void main(String[] args) throws Exception { + syncBatchCreateInstances(); + } + + public static void syncBatchCreateInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + BatchCreateInstancesRequest request = + BatchCreateInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequests(CreateInstanceRequests.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + BatchCreateInstancesResponse response = + alloyDBAdminClient.batchCreateInstancesAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/create/SyncCreateSetCredentialsProvider.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..52038e63590b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminSettings; +import com.google.cloud.alloydb.v1beta.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AlloyDBAdminSettings alloyDBAdminSettings = + AlloyDBAdminSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings); + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_Create_SetCredentialsProvider_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/create/SyncCreateSetCredentialsProvider1.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..f90ed48d8249 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,39 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_Create_SetCredentialsProvider1_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AlloyDBAdminSettings alloyDBAdminSettings = AlloyDBAdminSettings.newHttpJsonBuilder().build(); + AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings); + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_Create_SetCredentialsProvider1_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/create/SyncCreateSetEndpoint.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..07540dedcff1 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_Create_SetEndpoint_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminSettings; +import com.google.cloud.alloydb.v1beta.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AlloyDBAdminSettings alloyDBAdminSettings = + AlloyDBAdminSettings.newBuilder().setEndpoint(myEndpoint).build(); + AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings); + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_Create_SetEndpoint_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createbackup/AsyncCreateBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createbackup/AsyncCreateBackup.java new file mode 100644 index 000000000000..7a66f5b5d827 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createbackup/AsyncCreateBackup.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.CreateBackupRequest; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateBackup { + + public static void main(String[] args) throws Exception { + asyncCreateBackup(); + } + + public static void asyncCreateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBackupId("backupId2121930365") + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.createBackupCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createbackup/AsyncCreateBackupLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createbackup/AsyncCreateBackupLRO.java new file mode 100644 index 000000000000..adb91e8c3283 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createbackup/AsyncCreateBackupLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.CreateBackupRequest; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.cloud.alloydb.v1beta.OperationMetadata; + +public class AsyncCreateBackupLRO { + + public static void main(String[] args) throws Exception { + asyncCreateBackupLRO(); + } + + public static void asyncCreateBackupLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBackupId("backupId2121930365") + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.createBackupOperationCallable().futureCall(request); + // Do something. + Backup response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createbackup/SyncCreateBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createbackup/SyncCreateBackup.java new file mode 100644 index 000000000000..892b48f8239b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createbackup/SyncCreateBackup.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.CreateBackupRequest; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class SyncCreateBackup { + + public static void main(String[] args) throws Exception { + syncCreateBackup(); + } + + public static void syncCreateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBackupId("backupId2121930365") + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Backup response = alloyDBAdminClient.createBackupAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createbackup/SyncCreateBackupLocationnameBackupString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createbackup/SyncCreateBackupLocationnameBackupString.java new file mode 100644 index 000000000000..bbd85e54b4a2 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createbackup/SyncCreateBackupLocationnameBackupString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_LocationnameBackupString_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class SyncCreateBackupLocationnameBackupString { + + public static void main(String[] args) throws Exception { + syncCreateBackupLocationnameBackupString(); + } + + public static void syncCreateBackupLocationnameBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + Backup response = alloyDBAdminClient.createBackupAsync(parent, backup, backupId).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_LocationnameBackupString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createbackup/SyncCreateBackupStringBackupString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createbackup/SyncCreateBackupStringBackupString.java new file mode 100644 index 000000000000..2fe6cb5406e5 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createbackup/SyncCreateBackupStringBackupString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_StringBackupString_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class SyncCreateBackupStringBackupString { + + public static void main(String[] args) throws Exception { + syncCreateBackupStringBackupString(); + } + + public static void syncCreateBackupStringBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + Backup response = alloyDBAdminClient.createBackupAsync(parent, backup, backupId).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_StringBackupString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createcluster/AsyncCreateCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createcluster/AsyncCreateCluster.java new file mode 100644 index 000000000000..4cc4c83d289f --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createcluster/AsyncCreateCluster.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.CreateClusterRequest; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateCluster { + + public static void main(String[] args) throws Exception { + asyncCreateCluster(); + } + + public static void asyncCreateCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.createClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createcluster/AsyncCreateClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createcluster/AsyncCreateClusterLRO.java new file mode 100644 index 000000000000..53502829e4d5 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createcluster/AsyncCreateClusterLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.CreateClusterRequest; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.cloud.alloydb.v1beta.OperationMetadata; + +public class AsyncCreateClusterLRO { + + public static void main(String[] args) throws Exception { + asyncCreateClusterLRO(); + } + + public static void asyncCreateClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.createClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createcluster/SyncCreateCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createcluster/SyncCreateCluster.java new file mode 100644 index 000000000000..1cc93390af59 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createcluster/SyncCreateCluster.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.CreateClusterRequest; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class SyncCreateCluster { + + public static void main(String[] args) throws Exception { + syncCreateCluster(); + } + + public static void syncCreateCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Cluster response = alloyDBAdminClient.createClusterAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createcluster/SyncCreateClusterLocationnameClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createcluster/SyncCreateClusterLocationnameClusterString.java new file mode 100644 index 000000000000..2ec30ca72bd2 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createcluster/SyncCreateClusterLocationnameClusterString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_LocationnameClusterString_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class SyncCreateClusterLocationnameClusterString { + + public static void main(String[] args) throws Exception { + syncCreateClusterLocationnameClusterString(); + } + + public static void syncCreateClusterLocationnameClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = alloyDBAdminClient.createClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_LocationnameClusterString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createcluster/SyncCreateClusterStringClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createcluster/SyncCreateClusterStringClusterString.java new file mode 100644 index 000000000000..9eefd6852622 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createcluster/SyncCreateClusterStringClusterString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_StringClusterString_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class SyncCreateClusterStringClusterString { + + public static void main(String[] args) throws Exception { + syncCreateClusterStringClusterString(); + } + + public static void syncCreateClusterStringClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = alloyDBAdminClient.createClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_StringClusterString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createinstance/AsyncCreateInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createinstance/AsyncCreateInstance.java new file mode 100644 index 000000000000..8dd46ee43eb9 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createinstance/AsyncCreateInstance.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.CreateInstanceRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.longrunning.Operation; + +public class AsyncCreateInstance { + + public static void main(String[] args) throws Exception { + asyncCreateInstance(); + } + + public static void asyncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.createInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createinstance/AsyncCreateInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createinstance/AsyncCreateInstanceLRO.java new file mode 100644 index 000000000000..c9a542b53279 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createinstance/AsyncCreateInstanceLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.CreateInstanceRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.OperationMetadata; + +public class AsyncCreateInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncCreateInstanceLRO(); + } + + public static void asyncCreateInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.createInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createinstance/SyncCreateInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createinstance/SyncCreateInstance.java new file mode 100644 index 000000000000..1fa9bfc7843a --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createinstance/SyncCreateInstance.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.CreateInstanceRequest; +import com.google.cloud.alloydb.v1beta.Instance; + +public class SyncCreateInstance { + + public static void main(String[] args) throws Exception { + syncCreateInstance(); + } + + public static void syncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Instance response = alloyDBAdminClient.createInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createinstance/SyncCreateInstanceClusternameInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createinstance/SyncCreateInstanceClusternameInstanceString.java new file mode 100644 index 000000000000..55043dc65418 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createinstance/SyncCreateInstanceClusternameInstanceString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_ClusternameInstanceString_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.Instance; + +public class SyncCreateInstanceClusternameInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateInstanceClusternameInstanceString(); + } + + public static void syncCreateInstanceClusternameInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = + alloyDBAdminClient.createInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_ClusternameInstanceString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createinstance/SyncCreateInstanceStringInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createinstance/SyncCreateInstanceStringInstanceString.java new file mode 100644 index 000000000000..743929be54d1 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createinstance/SyncCreateInstanceStringInstanceString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_StringInstanceString_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.Instance; + +public class SyncCreateInstanceStringInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateInstanceStringInstanceString(); + } + + public static void syncCreateInstanceStringInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = + alloyDBAdminClient.createInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_StringInstanceString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryCluster.java new file mode 100644 index 000000000000..4e73fbae2247 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryCluster.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateSecondaryCluster { + + public static void main(String[] args) throws Exception { + asyncCreateSecondaryCluster(); + } + + public static void asyncCreateSecondaryCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryClusterRequest request = + CreateSecondaryClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = + alloyDBAdminClient.createSecondaryClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryClusterLRO.java new file mode 100644 index 000000000000..762853d68195 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryClusterLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.cloud.alloydb.v1beta.OperationMetadata; + +public class AsyncCreateSecondaryClusterLRO { + + public static void main(String[] args) throws Exception { + asyncCreateSecondaryClusterLRO(); + } + + public static void asyncCreateSecondaryClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryClusterRequest request = + CreateSecondaryClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.createSecondaryClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondarycluster/SyncCreateSecondaryCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondarycluster/SyncCreateSecondaryCluster.java new file mode 100644 index 000000000000..dd61e33f2ac6 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondarycluster/SyncCreateSecondaryCluster.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class SyncCreateSecondaryCluster { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryCluster(); + } + + public static void syncCreateSecondaryCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryClusterRequest request = + CreateSecondaryClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Cluster response = alloyDBAdminClient.createSecondaryClusterAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterLocationnameClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterLocationnameClusterString.java new file mode 100644 index 000000000000..c3010dd0347a --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterLocationnameClusterString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_LocationnameClusterString_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class SyncCreateSecondaryClusterLocationnameClusterString { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryClusterLocationnameClusterString(); + } + + public static void syncCreateSecondaryClusterLocationnameClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = + alloyDBAdminClient.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_LocationnameClusterString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterStringClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterStringClusterString.java new file mode 100644 index 000000000000..035ab0dcdd76 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterStringClusterString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_StringClusterString_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class SyncCreateSecondaryClusterStringClusterString { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryClusterStringClusterString(); + } + + public static void syncCreateSecondaryClusterStringClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = + alloyDBAdminClient.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_StringClusterString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstance.java new file mode 100644 index 000000000000..4d996d92764a --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstance.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.longrunning.Operation; + +public class AsyncCreateSecondaryInstance { + + public static void main(String[] args) throws Exception { + asyncCreateSecondaryInstance(); + } + + public static void asyncCreateSecondaryInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryInstanceRequest request = + CreateSecondaryInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = + alloyDBAdminClient.createSecondaryInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstanceLRO.java new file mode 100644 index 000000000000..b2ed151a2acd --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstanceLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.OperationMetadata; + +public class AsyncCreateSecondaryInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncCreateSecondaryInstanceLRO(); + } + + public static void asyncCreateSecondaryInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryInstanceRequest request = + CreateSecondaryInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.createSecondaryInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstance.java new file mode 100644 index 000000000000..a8a4bd2a151c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstance.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1beta.Instance; + +public class SyncCreateSecondaryInstance { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryInstance(); + } + + public static void syncCreateSecondaryInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryInstanceRequest request = + CreateSecondaryInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Instance response = alloyDBAdminClient.createSecondaryInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceClusternameInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceClusternameInstanceString.java new file mode 100644 index 000000000000..b41fed532b22 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceClusternameInstanceString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_ClusternameInstanceString_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.Instance; + +public class SyncCreateSecondaryInstanceClusternameInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryInstanceClusternameInstanceString(); + } + + public static void syncCreateSecondaryInstanceClusternameInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = + alloyDBAdminClient.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_ClusternameInstanceString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceStringInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceStringInstanceString.java new file mode 100644 index 000000000000..81a00d309b1c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceStringInstanceString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_StringInstanceString_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.Instance; + +public class SyncCreateSecondaryInstanceStringInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryInstanceStringInstanceString(); + } + + public static void syncCreateSecondaryInstanceStringInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = + alloyDBAdminClient.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_StringInstanceString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletebackup/AsyncDeleteBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletebackup/AsyncDeleteBackup.java new file mode 100644 index 000000000000..1c24587671d3 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletebackup/AsyncDeleteBackup.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.BackupName; +import com.google.cloud.alloydb.v1beta.DeleteBackupRequest; +import com.google.longrunning.Operation; + +public class AsyncDeleteBackup { + + public static void main(String[] args) throws Exception { + asyncDeleteBackup(); + } + + public static void asyncDeleteBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + ApiFuture future = alloyDBAdminClient.deleteBackupCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletebackup/AsyncDeleteBackupLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletebackup/AsyncDeleteBackupLRO.java new file mode 100644 index 000000000000..00420e543b6d --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletebackup/AsyncDeleteBackupLRO.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.BackupName; +import com.google.cloud.alloydb.v1beta.DeleteBackupRequest; +import com.google.cloud.alloydb.v1beta.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteBackupLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteBackupLRO(); + } + + public static void asyncDeleteBackupLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + OperationFuture future = + alloyDBAdminClient.deleteBackupOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletebackup/SyncDeleteBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletebackup/SyncDeleteBackup.java new file mode 100644 index 000000000000..53f6d9d011ff --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletebackup/SyncDeleteBackup.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.BackupName; +import com.google.cloud.alloydb.v1beta.DeleteBackupRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteBackup { + + public static void main(String[] args) throws Exception { + syncDeleteBackup(); + } + + public static void syncDeleteBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + alloyDBAdminClient.deleteBackupAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletebackup/SyncDeleteBackupBackupname.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletebackup/SyncDeleteBackupBackupname.java new file mode 100644 index 000000000000..11627c8307e5 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletebackup/SyncDeleteBackupBackupname.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_Backupname_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.BackupName; +import com.google.protobuf.Empty; + +public class SyncDeleteBackupBackupname { + + public static void main(String[] args) throws Exception { + syncDeleteBackupBackupname(); + } + + public static void syncDeleteBackupBackupname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + alloyDBAdminClient.deleteBackupAsync(name).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_Backupname_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletebackup/SyncDeleteBackupString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletebackup/SyncDeleteBackupString.java new file mode 100644 index 000000000000..0fb366505a7d --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletebackup/SyncDeleteBackupString.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.BackupName; +import com.google.protobuf.Empty; + +public class SyncDeleteBackupString { + + public static void main(String[] args) throws Exception { + syncDeleteBackupString(); + } + + public static void syncDeleteBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString(); + alloyDBAdminClient.deleteBackupAsync(name).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletecluster/AsyncDeleteCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletecluster/AsyncDeleteCluster.java new file mode 100644 index 000000000000..3134185b5838 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletecluster/AsyncDeleteCluster.java @@ -0,0 +1,53 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.DeleteClusterRequest; +import com.google.longrunning.Operation; + +public class AsyncDeleteCluster { + + public static void main(String[] args) throws Exception { + asyncDeleteCluster(); + } + + public static void asyncDeleteCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .setForce(true) + .build(); + ApiFuture future = alloyDBAdminClient.deleteClusterCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletecluster/AsyncDeleteClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletecluster/AsyncDeleteClusterLRO.java new file mode 100644 index 000000000000..1f48a819c399 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletecluster/AsyncDeleteClusterLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.DeleteClusterRequest; +import com.google.cloud.alloydb.v1beta.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteClusterLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteClusterLRO(); + } + + public static void asyncDeleteClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .setForce(true) + .build(); + OperationFuture future = + alloyDBAdminClient.deleteClusterOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletecluster/SyncDeleteCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletecluster/SyncDeleteCluster.java new file mode 100644 index 000000000000..2cbdf5a7ef5e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletecluster/SyncDeleteCluster.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.DeleteClusterRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteCluster { + + public static void main(String[] args) throws Exception { + syncDeleteCluster(); + } + + public static void syncDeleteCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .setForce(true) + .build(); + alloyDBAdminClient.deleteClusterAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletecluster/SyncDeleteClusterClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletecluster/SyncDeleteClusterClustername.java new file mode 100644 index 000000000000..99932892816f --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletecluster/SyncDeleteClusterClustername.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_Clustername_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.protobuf.Empty; + +public class SyncDeleteClusterClustername { + + public static void main(String[] args) throws Exception { + syncDeleteClusterClustername(); + } + + public static void syncDeleteClusterClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + alloyDBAdminClient.deleteClusterAsync(name).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletecluster/SyncDeleteClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletecluster/SyncDeleteClusterString.java new file mode 100644 index 000000000000..2fd5e7b1f1dc --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deletecluster/SyncDeleteClusterString.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.protobuf.Empty; + +public class SyncDeleteClusterString { + + public static void main(String[] args) throws Exception { + syncDeleteClusterString(); + } + + public static void syncDeleteClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + alloyDBAdminClient.deleteClusterAsync(name).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteinstance/AsyncDeleteInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteinstance/AsyncDeleteInstance.java new file mode 100644 index 000000000000..8db84b2ab8cd --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteinstance/AsyncDeleteInstance.java @@ -0,0 +1,53 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1beta.InstanceName; +import com.google.longrunning.Operation; + +public class AsyncDeleteInstance { + + public static void main(String[] args) throws Exception { + asyncDeleteInstance(); + } + + public static void asyncDeleteInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.deleteInstanceCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteinstance/AsyncDeleteInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteinstance/AsyncDeleteInstanceLRO.java new file mode 100644 index 000000000000..4bfe5fc6dc5a --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteinstance/AsyncDeleteInstanceLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1beta.InstanceName; +import com.google.cloud.alloydb.v1beta.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteInstanceLRO(); + } + + public static void asyncDeleteInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.deleteInstanceOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteinstance/SyncDeleteInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteinstance/SyncDeleteInstance.java new file mode 100644 index 000000000000..d01a00753bf4 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteinstance/SyncDeleteInstance.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1beta.InstanceName; +import com.google.protobuf.Empty; + +public class SyncDeleteInstance { + + public static void main(String[] args) throws Exception { + syncDeleteInstance(); + } + + public static void syncDeleteInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + alloyDBAdminClient.deleteInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteinstance/SyncDeleteInstanceInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteinstance/SyncDeleteInstanceInstancename.java new file mode 100644 index 000000000000..81cd03706945 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteinstance/SyncDeleteInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_Instancename_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.InstanceName; +import com.google.protobuf.Empty; + +public class SyncDeleteInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncDeleteInstanceInstancename(); + } + + public static void syncDeleteInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + alloyDBAdminClient.deleteInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_Instancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteinstance/SyncDeleteInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteinstance/SyncDeleteInstanceString.java new file mode 100644 index 000000000000..ab39f9ba0c18 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteinstance/SyncDeleteInstanceString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.InstanceName; +import com.google.protobuf.Empty; + +public class SyncDeleteInstanceString { + + public static void main(String[] args) throws Exception { + syncDeleteInstanceString(); + } + + public static void syncDeleteInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + alloyDBAdminClient.deleteInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/failoverinstance/AsyncFailoverInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/failoverinstance/AsyncFailoverInstance.java new file mode 100644 index 000000000000..499af76d02ba --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/failoverinstance/AsyncFailoverInstance.java @@ -0,0 +1,53 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1beta.InstanceName; +import com.google.longrunning.Operation; + +public class AsyncFailoverInstance { + + public static void main(String[] args) throws Exception { + asyncFailoverInstance(); + } + + public static void asyncFailoverInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = + alloyDBAdminClient.failoverInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/failoverinstance/AsyncFailoverInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/failoverinstance/AsyncFailoverInstanceLRO.java new file mode 100644 index 000000000000..fb84817a75cd --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/failoverinstance/AsyncFailoverInstanceLRO.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; +import com.google.cloud.alloydb.v1beta.OperationMetadata; + +public class AsyncFailoverInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncFailoverInstanceLRO(); + } + + public static void asyncFailoverInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.failoverInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/failoverinstance/SyncFailoverInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/failoverinstance/SyncFailoverInstance.java new file mode 100644 index 000000000000..5a102882e62a --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/failoverinstance/SyncFailoverInstance.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.FailoverInstanceRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; + +public class SyncFailoverInstance { + + public static void main(String[] args) throws Exception { + syncFailoverInstance(); + } + + public static void syncFailoverInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Instance response = alloyDBAdminClient.failoverInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/failoverinstance/SyncFailoverInstanceInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/failoverinstance/SyncFailoverInstanceInstancename.java new file mode 100644 index 000000000000..6b325c9f356a --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/failoverinstance/SyncFailoverInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_Instancename_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; + +public class SyncFailoverInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncFailoverInstanceInstancename(); + } + + public static void syncFailoverInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + Instance response = alloyDBAdminClient.failoverInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_Instancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/failoverinstance/SyncFailoverInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/failoverinstance/SyncFailoverInstanceString.java new file mode 100644 index 000000000000..b6403d6a76f5 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/failoverinstance/SyncFailoverInstanceString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; + +public class SyncFailoverInstanceString { + + public static void main(String[] args) throws Exception { + syncFailoverInstanceString(); + } + + public static void syncFailoverInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + Instance response = alloyDBAdminClient.failoverInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/AsyncGenerateClientCertificate.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/AsyncGenerateClientCertificate.java new file mode 100644 index 000000000000..912e6d4fad23 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/AsyncGenerateClientCertificate.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; +import com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; +import com.google.protobuf.Duration; + +public class AsyncGenerateClientCertificate { + + public static void main(String[] args) throws Exception { + asyncGenerateClientCertificate(); + } + + public static void asyncGenerateClientCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GenerateClientCertificateRequest request = + GenerateClientCertificateRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setPemCsr("pemCsr-991911478") + .setCertDuration(Duration.newBuilder().build()) + .build(); + ApiFuture future = + alloyDBAdminClient.generateClientCertificateCallable().futureCall(request); + // Do something. + GenerateClientCertificateResponse response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificate.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificate.java new file mode 100644 index 000000000000..87c9e4438004 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificate.java @@ -0,0 +1,51 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; +import com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; +import com.google.protobuf.Duration; + +public class SyncGenerateClientCertificate { + + public static void main(String[] args) throws Exception { + syncGenerateClientCertificate(); + } + + public static void syncGenerateClientCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GenerateClientCertificateRequest request = + GenerateClientCertificateRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setPemCsr("pemCsr-991911478") + .setCertDuration(Duration.newBuilder().build()) + .build(); + GenerateClientCertificateResponse response = + alloyDBAdminClient.generateClientCertificate(request); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificateClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificateClustername.java new file mode 100644 index 000000000000..fcaa0ffbeee3 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificateClustername.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_Clustername_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; + +public class SyncGenerateClientCertificateClustername { + + public static void main(String[] args) throws Exception { + syncGenerateClientCertificateClustername(); + } + + public static void syncGenerateClientCertificateClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + GenerateClientCertificateResponse response = + alloyDBAdminClient.generateClientCertificate(parent); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificateString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificateString.java new file mode 100644 index 000000000000..d9c981e956f7 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificateString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; + +public class SyncGenerateClientCertificateString { + + public static void main(String[] args) throws Exception { + syncGenerateClientCertificateString(); + } + + public static void syncGenerateClientCertificateString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + GenerateClientCertificateResponse response = + alloyDBAdminClient.generateClientCertificate(parent); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getbackup/AsyncGetBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getbackup/AsyncGetBackup.java new file mode 100644 index 000000000000..63ea335bf5ee --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getbackup/AsyncGetBackup.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.BackupName; +import com.google.cloud.alloydb.v1beta.GetBackupRequest; + +public class AsyncGetBackup { + + public static void main(String[] args) throws Exception { + asyncGetBackup(); + } + + public static void asyncGetBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetBackupRequest request = + GetBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .build(); + ApiFuture future = alloyDBAdminClient.getBackupCallable().futureCall(request); + // Do something. + Backup response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getbackup/SyncGetBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getbackup/SyncGetBackup.java new file mode 100644 index 000000000000..36000d75849c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getbackup/SyncGetBackup.java @@ -0,0 +1,46 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.BackupName; +import com.google.cloud.alloydb.v1beta.GetBackupRequest; + +public class SyncGetBackup { + + public static void main(String[] args) throws Exception { + syncGetBackup(); + } + + public static void syncGetBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetBackupRequest request = + GetBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .build(); + Backup response = alloyDBAdminClient.getBackup(request); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getbackup/SyncGetBackupBackupname.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getbackup/SyncGetBackupBackupname.java new file mode 100644 index 000000000000..6917b1ef7a96 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getbackup/SyncGetBackupBackupname.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_Backupname_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.BackupName; + +public class SyncGetBackupBackupname { + + public static void main(String[] args) throws Exception { + syncGetBackupBackupname(); + } + + public static void syncGetBackupBackupname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + Backup response = alloyDBAdminClient.getBackup(name); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_Backupname_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getbackup/SyncGetBackupString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getbackup/SyncGetBackupString.java new file mode 100644 index 000000000000..ea815ec24e73 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getbackup/SyncGetBackupString.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.BackupName; + +public class SyncGetBackupString { + + public static void main(String[] args) throws Exception { + syncGetBackupString(); + } + + public static void syncGetBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString(); + Backup response = alloyDBAdminClient.getBackup(name); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/AsyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/AsyncGetCluster.java new file mode 100644 index 000000000000..7fb54c39d917 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/AsyncGetCluster.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.GetClusterRequest; + +public class AsyncGetCluster { + + public static void main(String[] args) throws Exception { + asyncGetCluster(); + } + + public static void asyncGetCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetClusterRequest request = + GetClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .build(); + ApiFuture future = alloyDBAdminClient.getClusterCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/SyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..3502fb64011f --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/SyncGetCluster.java @@ -0,0 +1,46 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.GetClusterRequest; + +public class SyncGetCluster { + + public static void main(String[] args) throws Exception { + syncGetCluster(); + } + + public static void syncGetCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetClusterRequest request = + GetClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .build(); + Cluster response = alloyDBAdminClient.getCluster(request); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/SyncGetClusterClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/SyncGetClusterClustername.java new file mode 100644 index 000000000000..b1ad68e0dddf --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/SyncGetClusterClustername.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_Clustername_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.ClusterName; + +public class SyncGetClusterClustername { + + public static void main(String[] args) throws Exception { + syncGetClusterClustername(); + } + + public static void syncGetClusterClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Cluster response = alloyDBAdminClient.getCluster(name); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/SyncGetClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/SyncGetClusterString.java new file mode 100644 index 000000000000..9c8ad444580b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/SyncGetClusterString.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.ClusterName; + +public class SyncGetClusterString { + + public static void main(String[] args) throws Exception { + syncGetClusterString(); + } + + public static void syncGetClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + Cluster response = alloyDBAdminClient.getCluster(name); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getconnectioninfo/AsyncGetConnectionInfo.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getconnectioninfo/AsyncGetConnectionInfo.java new file mode 100644 index 000000000000..a3d6d1f92d81 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getconnectioninfo/AsyncGetConnectionInfo.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ConnectionInfo; +import com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest; +import com.google.cloud.alloydb.v1beta.InstanceName; + +public class AsyncGetConnectionInfo { + + public static void main(String[] args) throws Exception { + asyncGetConnectionInfo(); + } + + public static void asyncGetConnectionInfo() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetConnectionInfoRequest request = + GetConnectionInfoRequest.newBuilder() + .setParent( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + alloyDBAdminClient.getConnectionInfoCallable().futureCall(request); + // Do something. + ConnectionInfo response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getconnectioninfo/SyncGetConnectionInfo.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getconnectioninfo/SyncGetConnectionInfo.java new file mode 100644 index 000000000000..f763160a66ee --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getconnectioninfo/SyncGetConnectionInfo.java @@ -0,0 +1,48 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ConnectionInfo; +import com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest; +import com.google.cloud.alloydb.v1beta.InstanceName; + +public class SyncGetConnectionInfo { + + public static void main(String[] args) throws Exception { + syncGetConnectionInfo(); + } + + public static void syncGetConnectionInfo() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetConnectionInfoRequest request = + GetConnectionInfoRequest.newBuilder() + .setParent( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .build(); + ConnectionInfo response = alloyDBAdminClient.getConnectionInfo(request); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getconnectioninfo/SyncGetConnectionInfoInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getconnectioninfo/SyncGetConnectionInfoInstancename.java new file mode 100644 index 000000000000..6a914787ceea --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getconnectioninfo/SyncGetConnectionInfoInstancename.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_Instancename_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ConnectionInfo; +import com.google.cloud.alloydb.v1beta.InstanceName; + +public class SyncGetConnectionInfoInstancename { + + public static void main(String[] args) throws Exception { + syncGetConnectionInfoInstancename(); + } + + public static void syncGetConnectionInfoInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + ConnectionInfo response = alloyDBAdminClient.getConnectionInfo(parent); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_Instancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getconnectioninfo/SyncGetConnectionInfoString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getconnectioninfo/SyncGetConnectionInfoString.java new file mode 100644 index 000000000000..e4fdfcfb91ec --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getconnectioninfo/SyncGetConnectionInfoString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ConnectionInfo; +import com.google.cloud.alloydb.v1beta.InstanceName; + +public class SyncGetConnectionInfoString { + + public static void main(String[] args) throws Exception { + syncGetConnectionInfoString(); + } + + public static void syncGetConnectionInfoString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + ConnectionInfo response = alloyDBAdminClient.getConnectionInfo(parent); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getinstance/AsyncGetInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getinstance/AsyncGetInstance.java new file mode 100644 index 000000000000..029386bc06ee --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getinstance/AsyncGetInstance.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.GetInstanceRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; +import com.google.cloud.alloydb.v1beta.InstanceView; + +public class AsyncGetInstance { + + public static void main(String[] args) throws Exception { + asyncGetInstance(); + } + + public static void asyncGetInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setView(InstanceView.forNumber(0)) + .build(); + ApiFuture future = alloyDBAdminClient.getInstanceCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getinstance/SyncGetInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getinstance/SyncGetInstance.java new file mode 100644 index 000000000000..0d37d824bf49 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getinstance/SyncGetInstance.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.GetInstanceRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; +import com.google.cloud.alloydb.v1beta.InstanceView; + +public class SyncGetInstance { + + public static void main(String[] args) throws Exception { + syncGetInstance(); + } + + public static void syncGetInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setView(InstanceView.forNumber(0)) + .build(); + Instance response = alloyDBAdminClient.getInstance(request); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getinstance/SyncGetInstanceInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getinstance/SyncGetInstanceInstancename.java new file mode 100644 index 000000000000..005f8d2bbc76 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getinstance/SyncGetInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_Instancename_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; + +public class SyncGetInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncGetInstanceInstancename(); + } + + public static void syncGetInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + Instance response = alloyDBAdminClient.getInstance(name); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_Instancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getinstance/SyncGetInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getinstance/SyncGetInstanceString.java new file mode 100644 index 000000000000..1a691be5803b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getinstance/SyncGetInstanceString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; + +public class SyncGetInstanceString { + + public static void main(String[] args) throws Exception { + syncGetInstanceString(); + } + + public static void syncGetInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + Instance response = alloyDBAdminClient.getInstance(name); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getlocation/AsyncGetLocation.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..326ef2c18420 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = alloyDBAdminClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetLocation_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getlocation/SyncGetLocation.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..ea6cd6e574e1 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetLocation_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = alloyDBAdminClient.getLocation(request); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetLocation_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listbackups/AsyncListBackups.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listbackups/AsyncListBackups.java new file mode 100644 index 000000000000..4f6eccb17be9 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listbackups/AsyncListBackups.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.ListBackupsRequest; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class AsyncListBackups { + + public static void main(String[] args) throws Exception { + asyncListBackups(); + } + + public static void asyncListBackups() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = alloyDBAdminClient.listBackupsPagedCallable().futureCall(request); + // Do something. + for (Backup element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listbackups/AsyncListBackupsPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listbackups/AsyncListBackupsPaged.java new file mode 100644 index 000000000000..d82ebea4e132 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listbackups/AsyncListBackupsPaged.java @@ -0,0 +1,63 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_Paged_async] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.ListBackupsRequest; +import com.google.cloud.alloydb.v1beta.ListBackupsResponse; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.common.base.Strings; + +public class AsyncListBackupsPaged { + + public static void main(String[] args) throws Exception { + asyncListBackupsPaged(); + } + + public static void asyncListBackupsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListBackupsResponse response = alloyDBAdminClient.listBackupsCallable().call(request); + for (Backup element : response.getBackupsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listbackups/SyncListBackups.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listbackups/SyncListBackups.java new file mode 100644 index 000000000000..d02610778929 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listbackups/SyncListBackups.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.ListBackupsRequest; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class SyncListBackups { + + public static void main(String[] args) throws Exception { + syncListBackups(); + } + + public static void syncListBackups() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Backup element : alloyDBAdminClient.listBackups(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listbackups/SyncListBackupsLocationname.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listbackups/SyncListBackupsLocationname.java new file mode 100644 index 000000000000..e0c55230a031 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listbackups/SyncListBackupsLocationname.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_Locationname_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class SyncListBackupsLocationname { + + public static void main(String[] args) throws Exception { + syncListBackupsLocationname(); + } + + public static void syncListBackupsLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_Locationname_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listbackups/SyncListBackupsString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listbackups/SyncListBackupsString.java new file mode 100644 index 000000000000..fd75aa31f126 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listbackups/SyncListBackupsString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class SyncListBackupsString { + + public static void main(String[] args) throws Exception { + syncListBackupsString(); + } + + public static void syncListBackupsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listclusters/AsyncListClusters.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listclusters/AsyncListClusters.java new file mode 100644 index 000000000000..36978b2334cd --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listclusters/AsyncListClusters.java @@ -0,0 +1,56 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.ListClustersRequest; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class AsyncListClusters { + + public static void main(String[] args) throws Exception { + asyncListClusters(); + } + + public static void asyncListClusters() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + alloyDBAdminClient.listClustersPagedCallable().futureCall(request); + // Do something. + for (Cluster element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listclusters/AsyncListClustersPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listclusters/AsyncListClustersPaged.java new file mode 100644 index 000000000000..deebc92a1da9 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listclusters/AsyncListClustersPaged.java @@ -0,0 +1,63 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_Paged_async] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.ListClustersRequest; +import com.google.cloud.alloydb.v1beta.ListClustersResponse; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.common.base.Strings; + +public class AsyncListClustersPaged { + + public static void main(String[] args) throws Exception { + asyncListClustersPaged(); + } + + public static void asyncListClustersPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListClustersResponse response = alloyDBAdminClient.listClustersCallable().call(request); + for (Cluster element : response.getClustersList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listclusters/SyncListClusters.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listclusters/SyncListClusters.java new file mode 100644 index 000000000000..8cfc42ffc4c3 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listclusters/SyncListClusters.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.ListClustersRequest; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class SyncListClusters { + + public static void main(String[] args) throws Exception { + syncListClusters(); + } + + public static void syncListClusters() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Cluster element : alloyDBAdminClient.listClusters(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listclusters/SyncListClustersLocationname.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listclusters/SyncListClustersLocationname.java new file mode 100644 index 000000000000..0675fcb51bd8 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listclusters/SyncListClustersLocationname.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_Locationname_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class SyncListClustersLocationname { + + public static void main(String[] args) throws Exception { + syncListClustersLocationname(); + } + + public static void syncListClustersLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Cluster element : alloyDBAdminClient.listClusters(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_Locationname_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listclusters/SyncListClustersString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listclusters/SyncListClustersString.java new file mode 100644 index 000000000000..7b1fa916284d --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listclusters/SyncListClustersString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.LocationName; + +public class SyncListClustersString { + + public static void main(String[] args) throws Exception { + syncListClustersString(); + } + + public static void syncListClustersString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Cluster element : alloyDBAdminClient.listClusters(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listinstances/AsyncListInstances.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listinstances/AsyncListInstances.java new file mode 100644 index 000000000000..c5e39c55d3c9 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listinstances/AsyncListInstances.java @@ -0,0 +1,56 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.ListInstancesRequest; + +public class AsyncListInstances { + + public static void main(String[] args) throws Exception { + asyncListInstances(); + } + + public static void asyncListInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + alloyDBAdminClient.listInstancesPagedCallable().futureCall(request); + // Do something. + for (Instance element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listinstances/AsyncListInstancesPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listinstances/AsyncListInstancesPaged.java new file mode 100644 index 000000000000..6c07bdd11d7e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listinstances/AsyncListInstancesPaged.java @@ -0,0 +1,63 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_Paged_async] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.ListInstancesRequest; +import com.google.cloud.alloydb.v1beta.ListInstancesResponse; +import com.google.common.base.Strings; + +public class AsyncListInstancesPaged { + + public static void main(String[] args) throws Exception { + asyncListInstancesPaged(); + } + + public static void asyncListInstancesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListInstancesResponse response = alloyDBAdminClient.listInstancesCallable().call(request); + for (Instance element : response.getInstancesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listinstances/SyncListInstances.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listinstances/SyncListInstances.java new file mode 100644 index 000000000000..c0f9d86a74f0 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listinstances/SyncListInstances.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.ListInstancesRequest; + +public class SyncListInstances { + + public static void main(String[] args) throws Exception { + syncListInstances(); + } + + public static void syncListInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Instance element : alloyDBAdminClient.listInstances(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listinstances/SyncListInstancesClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listinstances/SyncListInstancesClustername.java new file mode 100644 index 000000000000..4feffe184264 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listinstances/SyncListInstancesClustername.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_Clustername_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.Instance; + +public class SyncListInstancesClustername { + + public static void main(String[] args) throws Exception { + syncListInstancesClustername(); + } + + public static void syncListInstancesClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + for (Instance element : alloyDBAdminClient.listInstances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listinstances/SyncListInstancesString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listinstances/SyncListInstancesString.java new file mode 100644 index 000000000000..af683becc563 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listinstances/SyncListInstancesString.java @@ -0,0 +1,44 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.Instance; + +public class SyncListInstancesString { + + public static void main(String[] args) throws Exception { + syncListInstancesString(); + } + + public static void syncListInstancesString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + for (Instance element : alloyDBAdminClient.listInstances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listlocations/AsyncListLocations.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..48089f54f741 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + alloyDBAdminClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListLocations_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listlocations/AsyncListLocationsPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..dd92b6316881 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListLocations_Paged_async] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = alloyDBAdminClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListLocations_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listlocations/SyncListLocations.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..bde5cffaf469 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListLocations_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : alloyDBAdminClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListLocations_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlags.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlags.java new file mode 100644 index 000000000000..0da33bc26c96 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlags.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag; + +public class AsyncListSupportedDatabaseFlags { + + public static void main(String[] args) throws Exception { + asyncListSupportedDatabaseFlags(); + } + + public static void asyncListSupportedDatabaseFlags() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + alloyDBAdminClient.listSupportedDatabaseFlagsPagedCallable().futureCall(request); + // Do something. + for (SupportedDatabaseFlag element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlagsPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlagsPaged.java new file mode 100644 index 000000000000..313b13ba2292 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listsupporteddatabaseflags/AsyncListSupportedDatabaseFlagsPaged.java @@ -0,0 +1,62 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_Paged_async] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag; +import com.google.common.base.Strings; + +public class AsyncListSupportedDatabaseFlagsPaged { + + public static void main(String[] args) throws Exception { + asyncListSupportedDatabaseFlagsPaged(); + } + + public static void asyncListSupportedDatabaseFlagsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListSupportedDatabaseFlagsResponse response = + alloyDBAdminClient.listSupportedDatabaseFlagsCallable().call(request); + for (SupportedDatabaseFlag element : response.getSupportedDatabaseFlagsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlags.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlags.java new file mode 100644 index 000000000000..88c6bc0c67df --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlags.java @@ -0,0 +1,51 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag; + +public class SyncListSupportedDatabaseFlags { + + public static void main(String[] args) throws Exception { + syncListSupportedDatabaseFlags(); + } + + public static void syncListSupportedDatabaseFlags() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (SupportedDatabaseFlag element : + alloyDBAdminClient.listSupportedDatabaseFlags(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsLocationname.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsLocationname.java new file mode 100644 index 000000000000..6d1310a83ac7 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsLocationname.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_Locationname_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag; + +public class SyncListSupportedDatabaseFlagsLocationname { + + public static void main(String[] args) throws Exception { + syncListSupportedDatabaseFlagsLocationname(); + } + + public static void syncListSupportedDatabaseFlagsLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (SupportedDatabaseFlag element : + alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_Locationname_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsString.java new file mode 100644 index 000000000000..36bbf1766d9a --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listsupporteddatabaseflags/SyncListSupportedDatabaseFlagsString.java @@ -0,0 +1,45 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag; + +public class SyncListSupportedDatabaseFlagsString { + + public static void main(String[] args) throws Exception { + syncListSupportedDatabaseFlagsString(); + } + + public static void syncListSupportedDatabaseFlagsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (SupportedDatabaseFlag element : + alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/promotecluster/AsyncPromoteCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/promotecluster/AsyncPromoteCluster.java new file mode 100644 index 000000000000..16a7cc32c865 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/promotecluster/AsyncPromoteCluster.java @@ -0,0 +1,52 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.PromoteClusterRequest; +import com.google.longrunning.Operation; + +public class AsyncPromoteCluster { + + public static void main(String[] args) throws Exception { + asyncPromoteCluster(); + } + + public static void asyncPromoteCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + PromoteClusterRequest request = + PromoteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.promoteClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/promotecluster/AsyncPromoteClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/promotecluster/AsyncPromoteClusterLRO.java new file mode 100644 index 000000000000..8b2dd388d11d --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/promotecluster/AsyncPromoteClusterLRO.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.OperationMetadata; +import com.google.cloud.alloydb.v1beta.PromoteClusterRequest; + +public class AsyncPromoteClusterLRO { + + public static void main(String[] args) throws Exception { + asyncPromoteClusterLRO(); + } + + public static void asyncPromoteClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + PromoteClusterRequest request = + PromoteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.promoteClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/promotecluster/SyncPromoteCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/promotecluster/SyncPromoteCluster.java new file mode 100644 index 000000000000..29eb2e9705bd --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/promotecluster/SyncPromoteCluster.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.PromoteClusterRequest; + +public class SyncPromoteCluster { + + public static void main(String[] args) throws Exception { + syncPromoteCluster(); + } + + public static void syncPromoteCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + PromoteClusterRequest request = + PromoteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + Cluster response = alloyDBAdminClient.promoteClusterAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/promotecluster/SyncPromoteClusterClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/promotecluster/SyncPromoteClusterClustername.java new file mode 100644 index 000000000000..d77a6a4948cd --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/promotecluster/SyncPromoteClusterClustername.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_Clustername_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.ClusterName; + +public class SyncPromoteClusterClustername { + + public static void main(String[] args) throws Exception { + syncPromoteClusterClustername(); + } + + public static void syncPromoteClusterClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Cluster response = alloyDBAdminClient.promoteClusterAsync(name).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/promotecluster/SyncPromoteClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/promotecluster/SyncPromoteClusterString.java new file mode 100644 index 000000000000..3716e4a82718 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/promotecluster/SyncPromoteClusterString.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.ClusterName; + +public class SyncPromoteClusterString { + + public static void main(String[] args) throws Exception { + syncPromoteClusterString(); + } + + public static void syncPromoteClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + Cluster response = alloyDBAdminClient.promoteClusterAsync(name).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restartinstance/AsyncRestartInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restartinstance/AsyncRestartInstance.java new file mode 100644 index 000000000000..8da943db7023 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restartinstance/AsyncRestartInstance.java @@ -0,0 +1,53 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.InstanceName; +import com.google.cloud.alloydb.v1beta.RestartInstanceRequest; +import com.google.longrunning.Operation; + +public class AsyncRestartInstance { + + public static void main(String[] args) throws Exception { + asyncRestartInstance(); + } + + public static void asyncRestartInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestartInstanceRequest request = + RestartInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = + alloyDBAdminClient.restartInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restartinstance/AsyncRestartInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restartinstance/AsyncRestartInstanceLRO.java new file mode 100644 index 000000000000..d9d0030e9a0f --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restartinstance/AsyncRestartInstanceLRO.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; +import com.google.cloud.alloydb.v1beta.OperationMetadata; +import com.google.cloud.alloydb.v1beta.RestartInstanceRequest; + +public class AsyncRestartInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncRestartInstanceLRO(); + } + + public static void asyncRestartInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestartInstanceRequest request = + RestartInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.restartInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restartinstance/SyncRestartInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restartinstance/SyncRestartInstance.java new file mode 100644 index 000000000000..c312d2956f85 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restartinstance/SyncRestartInstance.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; +import com.google.cloud.alloydb.v1beta.RestartInstanceRequest; + +public class SyncRestartInstance { + + public static void main(String[] args) throws Exception { + syncRestartInstance(); + } + + public static void syncRestartInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestartInstanceRequest request = + RestartInstanceRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Instance response = alloyDBAdminClient.restartInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restartinstance/SyncRestartInstanceInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restartinstance/SyncRestartInstanceInstancename.java new file mode 100644 index 000000000000..9f848baea4c0 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restartinstance/SyncRestartInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_Instancename_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; + +public class SyncRestartInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncRestartInstanceInstancename(); + } + + public static void syncRestartInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + Instance response = alloyDBAdminClient.restartInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_Instancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restartinstance/SyncRestartInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restartinstance/SyncRestartInstanceString.java new file mode 100644 index 000000000000..0273d68f31ea --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restartinstance/SyncRestartInstanceString.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; + +public class SyncRestartInstanceString { + + public static void main(String[] args) throws Exception { + syncRestartInstanceString(); + } + + public static void syncRestartInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + Instance response = alloyDBAdminClient.restartInstanceAsync(name).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restorecluster/AsyncRestoreCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restorecluster/AsyncRestoreCluster.java new file mode 100644 index 000000000000..de8f3876da25 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restorecluster/AsyncRestoreCluster.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.cloud.alloydb.v1beta.RestoreClusterRequest; +import com.google.longrunning.Operation; + +public class AsyncRestoreCluster { + + public static void main(String[] args) throws Exception { + asyncRestoreCluster(); + } + + public static void asyncRestoreCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.restoreClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restorecluster/AsyncRestoreClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restorecluster/AsyncRestoreClusterLRO.java new file mode 100644 index 000000000000..515ae8e8e014 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restorecluster/AsyncRestoreClusterLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.cloud.alloydb.v1beta.OperationMetadata; +import com.google.cloud.alloydb.v1beta.RestoreClusterRequest; + +public class AsyncRestoreClusterLRO { + + public static void main(String[] args) throws Exception { + asyncRestoreClusterLRO(); + } + + public static void asyncRestoreClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.restoreClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restorecluster/SyncRestoreCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restorecluster/SyncRestoreCluster.java new file mode 100644 index 000000000000..ae54afee6171 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/restorecluster/SyncRestoreCluster.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.LocationName; +import com.google.cloud.alloydb.v1beta.RestoreClusterRequest; + +public class SyncRestoreCluster { + + public static void main(String[] args) throws Exception { + syncRestoreCluster(); + } + + public static void syncRestoreCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + RestoreClusterRequest request = + RestoreClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Cluster response = alloyDBAdminClient.restoreClusterAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatebackup/AsyncUpdateBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatebackup/AsyncUpdateBackup.java new file mode 100644 index 000000000000..b16ea86fa233 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatebackup/AsyncUpdateBackup.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.UpdateBackupRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateBackup { + + public static void main(String[] args) throws Exception { + asyncUpdateBackup(); + } + + public static void asyncUpdateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + ApiFuture future = alloyDBAdminClient.updateBackupCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatebackup/AsyncUpdateBackupLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatebackup/AsyncUpdateBackupLRO.java new file mode 100644 index 000000000000..6281b4f22bf6 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatebackup/AsyncUpdateBackupLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.OperationMetadata; +import com.google.cloud.alloydb.v1beta.UpdateBackupRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateBackupLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateBackupLRO(); + } + + public static void asyncUpdateBackupLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + OperationFuture future = + alloyDBAdminClient.updateBackupOperationCallable().futureCall(request); + // Do something. + Backup response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatebackup/SyncUpdateBackup.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatebackup/SyncUpdateBackup.java new file mode 100644 index 000000000000..a723170b1fb5 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatebackup/SyncUpdateBackup.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.cloud.alloydb.v1beta.UpdateBackupRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateBackup { + + public static void main(String[] args) throws Exception { + syncUpdateBackup(); + } + + public static void syncUpdateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setBackup(Backup.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + Backup response = alloyDBAdminClient.updateBackupAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatebackup/SyncUpdateBackupBackupFieldmask.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatebackup/SyncUpdateBackupBackupFieldmask.java new file mode 100644 index 000000000000..a78c8df74b8b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatebackup/SyncUpdateBackupBackupFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_BackupFieldmask_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Backup; +import com.google.protobuf.FieldMask; + +public class SyncUpdateBackupBackupFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateBackupBackupFieldmask(); + } + + public static void syncUpdateBackupBackupFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Backup response = alloyDBAdminClient.updateBackupAsync(backup, updateMask).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_BackupFieldmask_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatecluster/AsyncUpdateCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatecluster/AsyncUpdateCluster.java new file mode 100644 index 000000000000..5fad7a4afe2e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatecluster/AsyncUpdateCluster.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.UpdateClusterRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateCluster { + + public static void main(String[] args) throws Exception { + asyncUpdateCluster(); + } + + public static void asyncUpdateCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + ApiFuture future = alloyDBAdminClient.updateClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatecluster/AsyncUpdateClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatecluster/AsyncUpdateClusterLRO.java new file mode 100644 index 000000000000..5ba4edf624f8 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatecluster/AsyncUpdateClusterLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.OperationMetadata; +import com.google.cloud.alloydb.v1beta.UpdateClusterRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateClusterLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateClusterLRO(); + } + + public static void asyncUpdateClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + OperationFuture future = + alloyDBAdminClient.updateClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatecluster/SyncUpdateCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatecluster/SyncUpdateCluster.java new file mode 100644 index 000000000000..a2c425e23b5c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatecluster/SyncUpdateCluster.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.cloud.alloydb.v1beta.UpdateClusterRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCluster { + + public static void main(String[] args) throws Exception { + syncUpdateCluster(); + } + + public static void syncUpdateCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + Cluster response = alloyDBAdminClient.updateClusterAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatecluster/SyncUpdateClusterClusterFieldmask.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatecluster/SyncUpdateClusterClusterFieldmask.java new file mode 100644 index 000000000000..4518c8f5cafe --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updatecluster/SyncUpdateClusterClusterFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_ClusterFieldmask_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Cluster; +import com.google.protobuf.FieldMask; + +public class SyncUpdateClusterClusterFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateClusterClusterFieldmask(); + } + + public static void syncUpdateClusterClusterFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + Cluster cluster = Cluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Cluster response = alloyDBAdminClient.updateClusterAsync(cluster, updateMask).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_ClusterFieldmask_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateinstance/AsyncUpdateInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateinstance/AsyncUpdateInstance.java new file mode 100644 index 000000000000..bc31864b32a7 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateinstance/AsyncUpdateInstance.java @@ -0,0 +1,54 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.UpdateInstanceRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateInstance { + + public static void main(String[] args) throws Exception { + asyncUpdateInstance(); + } + + public static void asyncUpdateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + ApiFuture future = alloyDBAdminClient.updateInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateinstance/AsyncUpdateInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateinstance/AsyncUpdateInstanceLRO.java new file mode 100644 index 000000000000..5da9d92a0d98 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateinstance/AsyncUpdateInstanceLRO.java @@ -0,0 +1,55 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.OperationMetadata; +import com.google.cloud.alloydb.v1beta.UpdateInstanceRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateInstanceLRO(); + } + + public static void asyncUpdateInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + OperationFuture future = + alloyDBAdminClient.updateInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateinstance/SyncUpdateInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateinstance/SyncUpdateInstance.java new file mode 100644 index 000000000000..cc5cef415b15 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateinstance/SyncUpdateInstance.java @@ -0,0 +1,50 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.UpdateInstanceRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateInstance { + + public static void main(String[] args) throws Exception { + syncUpdateInstance(); + } + + public static void syncUpdateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + Instance response = alloyDBAdminClient.updateInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateinstance/SyncUpdateInstanceInstanceFieldmask.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateinstance/SyncUpdateInstanceInstanceFieldmask.java new file mode 100644 index 000000000000..9b3db8619e74 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateinstance/SyncUpdateInstanceInstanceFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_InstanceFieldmask_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.protobuf.FieldMask; + +public class SyncUpdateInstanceInstanceFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateInstanceInstanceFieldmask(); + } + + public static void syncUpdateInstanceInstanceFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require 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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Instance response = alloyDBAdminClient.updateInstanceAsync(instance, updateMask).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_InstanceFieldmask_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadminsettings/getcluster/SyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadminsettings/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..b09c9a2f70d5 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadminsettings/getcluster/SyncGetCluster.java @@ -0,0 +1,48 @@ +/* + * 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.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdminSettings_GetCluster_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminSettings; +import java.time.Duration; + +public class SyncGetCluster { + + public static void main(String[] args) throws Exception { + syncGetCluster(); + } + + public static void syncGetCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AlloyDBAdminSettings.Builder alloyDBAdminSettingsBuilder = AlloyDBAdminSettings.newBuilder(); + alloyDBAdminSettingsBuilder + .getClusterSettings() + .setRetrySettings( + alloyDBAdminSettingsBuilder + .getClusterSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AlloyDBAdminSettings alloyDBAdminSettings = alloyDBAdminSettingsBuilder.build(); + } +} +// [END alloydb_v1beta_generated_AlloyDBAdminSettings_GetCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/stub/alloydbadminstubsettings/getcluster/SyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/stub/alloydbadminstubsettings/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..3ef087b5b8ea --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/stub/alloydbadminstubsettings/getcluster/SyncGetCluster.java @@ -0,0 +1,49 @@ +/* + * 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.alloydb.v1beta.stub.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdminStubSettings_GetCluster_sync] +import com.google.cloud.alloydb.v1beta.stub.AlloyDBAdminStubSettings; +import java.time.Duration; + +public class SyncGetCluster { + + public static void main(String[] args) throws Exception { + syncGetCluster(); + } + + public static void syncGetCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AlloyDBAdminStubSettings.Builder alloyDBAdminSettingsBuilder = + AlloyDBAdminStubSettings.newBuilder(); + alloyDBAdminSettingsBuilder + .getClusterSettings() + .setRetrySettings( + alloyDBAdminSettingsBuilder + .getClusterSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AlloyDBAdminStubSettings alloyDBAdminSettings = alloyDBAdminSettingsBuilder.build(); + } +} +// [END alloydb_v1beta_generated_AlloyDBAdminStubSettings_GetCluster_sync] diff --git a/java-bigquerymigration/README.md b/java-bigquerymigration/README.md index 9e6e592198d1..16f22df56f2f 100644 --- a/java-bigquerymigration/README.md +++ b/java-bigquerymigration/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [BigQuery Migration][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-bigquerymigration" % "0.14.0" ``` + ## Authentication diff --git a/java-certificate-manager/README.md b/java-certificate-manager/README.md index 679f0ea0b10d..747046e5d6bf 100644 --- a/java-certificate-manager/README.md +++ b/java-certificate-manager/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Certificate Manager][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-certificate-manager" % "0.14.0" ``` + ## Authentication diff --git a/java-maps-mapsplatformdatasets/README.md b/java-maps-mapsplatformdatasets/README.md index e12b92bb954b..ebb4730dc9fb 100644 --- a/java-maps-mapsplatformdatasets/README.md +++ b/java-maps-mapsplatformdatasets/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Maps Platform Datasets API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.maps" % "google-maps-mapsplatformdatasets" % "0.0.0" ``` + ## Authentication diff --git a/pom.xml b/pom.xml index 9026082b6202..1b7e5a28ad00 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,7 @@ java-accesscontextmanager java-advisorynotifications java-aiplatform + java-alloydb java-analytics-admin java-analytics-data java-analyticshub diff --git a/versions.txt b/versions.txt index b74e5bfb463e..735f6933291d 100644 --- a/versions.txt +++ b/versions.txt @@ -617,3 +617,10 @@ grpc-google-maps-mapsplatformdatasets-v1alpha:0.0.0:0.0.1-SNAPSHOT google-cloud-kmsinventory:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-kmsinventory-v1:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-kmsinventory-v1:0.0.0:0.0.1-SNAPSHOT +google-cloud-alloydb:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-alloydb-v1:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-alloydb-v1beta:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-alloydb-v1alpha:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-alloydb-v1beta:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-alloydb-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-alloydb-v1alpha:0.0.0:0.0.1-SNAPSHOT